Skip to content

Commit d9a6c18

Browse files
committed
Fix ri location information for gem, one line per class on ri output
1 parent a872e2b commit d9a6c18

File tree

3 files changed

+24
-13
lines changed

3 files changed

+24
-13
lines changed

History.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
=== 2.3.0 / 200?-??-??
22

33
* X Major Enhancements
4-
* RDoc now automatically loads rdoc/discover.rb files from installed gems.
5-
* RDoc now uses Michael Granger's Darkfish generator by default.
4+
* rdoc/discover.rb files are loaded automatically from installed gems
5+
* Michael Granger's Darkfish generator is now the default
66
* Various rdoc generation speedups by Hongli Lai. Patches #22555, #22556,
77
#22557, #22562, #22565.
88

99
* Y Minor Enhancements
1010
* Added a space after the commas in ri class method lists. RubyForge
1111
enhancement #22182.
1212
* Improved ri --interactive
13-
* Generators can now override generated file locations.
14-
* Moved unmaintained CHM generator to it's own package.
15-
* Moved unmaintained extra HTML templates to their own package.
16-
* Removed experimental texinfo generator.
17-
* Converted to minitest.
13+
* Generators can now override generated file locations
14+
* Moved unmaintained CHM generator to it's own package
15+
* Moved unmaintained extra HTML templates to their own package
16+
* Removed experimental texinfo generator
17+
* Converted to minitest
18+
* Known classes and modules list outputs once per line now for grep
1819

1920
* Z Bug Fixes
2021
* Fix missing superclass in ri output
@@ -30,6 +31,7 @@
3031
* RDoc now only accepts adjacent comments for rb_define_module and
3132
rb_define_class
3233
* C file RDoc is no longer included in token stream
34+
* Scan all gem paths to match gem name for ri output
3335

3436
=== 2.2.1 / 2008-09-24
3537
This version provides some minor fixes and enhancements to 2.2.0 intended

lib/rdoc/ri/display.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,9 @@ def list_known_classes(classes)
280280
@formatter.draw_line "Known classes and modules"
281281
@formatter.blankline
282282

283-
@formatter.wrap classes.sort.join(', ')
283+
classes.sort.each do |klass|
284+
@formatter.wrap klass
285+
end
284286
end
285287
end
286288
end

lib/rdoc/ri/driver.rb

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,9 @@ def interactive
595595
formatter.raw_print_line "#{e.message}\n"
596596
end
597597
end
598+
599+
rescue Interrupt
600+
exit
598601
end
599602

600603
##
@@ -670,13 +673,17 @@ def create_cache_for(klassname, path)
670673
if system_file then
671674
method["source_path"] = "Ruby #{RDoc::RI::Paths::VERSION}"
672675
else
673-
if(f =~ %r%gems/[\d.]+/doc/([^/]+)%) then
674-
ext_path = "gem #{$1}"
675-
else
676-
ext_path = f
676+
gem = Gem.path.any? do |path|
677+
pattern = File.join Regexp.escape(path), 'doc', '(.*?)', ''
678+
679+
f =~ /^#{pattern}/
677680
end
678681

679-
method["source_path"] = ext_path
682+
method["source_path"] = if gem then
683+
"gem #{$1}"
684+
else
685+
f
686+
end
680687
end
681688

682689
name = method["full_name"]

0 commit comments

Comments
 (0)