diff options
author | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-21 07:28:54 +0000 |
---|---|---|
committer | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-21 07:28:54 +0000 |
commit | da99e407fbf36051bf9ebce01418589bff557298 (patch) | |
tree | 2d673dc5133830cc910ac4e05106236659ff1658 /bin | |
parent | 6228cbe5efb35f3fb867f42525905cf2ded37aad (diff) |
Add file.c comments (and necessary support in parse_c.rb)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5234 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ri | 32 |
1 files changed, 19 insertions, 13 deletions
@@ -48,7 +48,7 @@ class RiDisplay exit 1 end @ri_reader = RI::RiReader.new(RI::RiCache.new(paths)) - @formatter = RI::RiFormatter.new(@options.width, " ") + @formatter = RI::TextFormatter.create(@options, " ") end @@ -127,7 +127,7 @@ end def display_class_info(class_entry) klass = @ri_reader.get_class(class_entry) - @formatter.draw_line("Class: " + klass.full_name) + @formatter.draw_line(klass.display_name + ": " + klass.full_name) display_flow(klass.comment) @formatter.draw_line @@ -190,12 +190,15 @@ end def report_method_stuff(requested_method_name, methods) if methods.size == 1 display_method_info(methods[0]) - elsif (entry = methods.find {|m| m.name == requested_method_name}) - display_method_info(entry) else - puts "More than one method matched your request. You can refine" - puts "your search by asking for information on one of:\n\n" - @formatter.wrap(methods.map {|m| m.full_name} .join(", ")) + entries = methods.find_all {|m| m.name == requested_method_name} + if entries.size == 1 + display_method_info(entries[0]) + else + puts "More than one method matched your request. You can refine" + puts "your search by asking for information on one of:\n\n" + @formatter.wrap(methods.map {|m| m.full_name} .join(", ")) + end end end @@ -204,12 +207,15 @@ end def report_class_stuff(requested_class_name, namespaces) if namespaces.size == 1 display_class_info(namespaces[0]) - elsif (entry = namespaces.find {|m| m.name == requested_class_name}) - display_class_info(entry) - else - puts "More than one class or module matched your request. You can refine" - puts "your search by asking for information on one of:\n\n" - @formatter.wrap(namespaces.map {|m| m.full_name}.join(", ")) + else + entries = namespaces.find_all {|m| m.name == requested_class_name} + if entries.size == 1 + display_class_info(entries[0]) + else + puts "More than one class or module matched your request. You can refine" + puts "your search by asking for information on one of:\n\n" + @formatter.wrap(namespaces.map {|m| m.full_name}.join(", ")) + end end end |