diff options
author | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-19 03:58:57 +0000 |
---|---|---|
committer | dave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-12-19 03:58:57 +0000 |
commit | 8ed8664aa7ca657f536d507ac6de84d71e02e31b (patch) | |
tree | c38efde703164c6ecbbade0b477a7b1318c18086 /bin | |
parent | d3b74e1806e572592b4242bee140813ffeefdaf1 (diff) | |
download | ruby-8ed8664aa7ca657f536d507ac6de84d71e02e31b.tar.gz |
Add boot_classes to rdoc parsing, fix a couple of bugs
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ri | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -10,6 +10,8 @@ # All names may be abbreviated to their minimum unbiguous form. If a name # _is_ ambiguous, all valid options will be listed. # +# The form '.' method matches either class or instance methods, while +# #method matches only instance and ::method matches only class methods. require 'rdoc/ri/ri_paths' require 'rdoc/ri/ri_cache' @@ -199,14 +201,15 @@ end ###################################################################### -def report_class_stuff(namespaces) - if namespaces.size > 1 +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" - puts @formatter.wrap("", namespaces.map {|m| m.full_name} .join(", ")) - else - class_desc = @ri_reader.get_class(namespaces[0]) - display_class_info(namespaces[0]) + @formatter.wrap(namespaces.map {|m| m.full_name}.join(", ")) end end @@ -229,7 +232,7 @@ def display_info_for(arg) begin if desc.method_name.nil? - report_class_stuff(namespaces) + report_class_stuff(desc.class_names.join('::'), namespaces) else methods = @ri_reader.find_methods(desc.method_name, desc.is_class_method, |