aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rdoc/ri/ri_driver.rb
diff options
context:
space:
mode:
authordave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-08-30 14:22:26 +0000
committerdave <dave@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-08-30 14:22:26 +0000
commit8e94bb29ae5c33d988cba29f130ba0d0a7276b00 (patch)
tree17f3eb310a24fabe871f4f407bd2b98f6ccb270c /lib/rdoc/ri/ri_driver.rb
parente80e14c7882d3955eb88d078f43822af030a1bf4 (diff)
downloadruby-8e94bb29ae5c33d988cba29f130ba0d0a7276b00.tar.gz
ri now merges the documentation if it finds the same class in multiple places
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/ri/ri_driver.rb')
-rw-r--r--lib/rdoc/ri/ri_driver.rb26
1 files changed, 16 insertions, 10 deletions
diff --git a/lib/rdoc/ri/ri_driver.rb b/lib/rdoc/ri/ri_driver.rb
index 35c20a7a1a..d2545bb1da 100644
--- a/lib/rdoc/ri/ri_driver.rb
+++ b/lib/rdoc/ri/ri_driver.rb
@@ -1,3 +1,4 @@
+require 'rdoc/usage'
require 'rdoc/ri/ri_paths'
require 'rdoc/ri/ri_cache'
require 'rdoc/ri/ri_util'
@@ -22,18 +23,23 @@ class RiDriver
paths = @options.paths || RI::Paths::PATH
if paths.empty?
- $stderr.puts "No ri documentation found in:"
- [ RI::Paths::SYSDIR, RI::Paths::SITEDIR, RI::Paths::HOMEDIR].each do |d|
- $stderr.puts " #{d}"
- end
- $stderr.puts "\nWas rdoc run to create documentation?"
- exit 1
+ report_missing_documentation(paths)
end
@ri_reader = RI::RiReader.new(RI::RiCache.new(paths))
@display = @options.displayer
end
-
+ # Couldn't find documentation in paths, so tell the user
+ # what to do
+
+ def report_missing_documentation(paths)
+ STDERR.puts "No ri documentation found in:"
+ paths.each do |d|
+ STDERR.puts " #{d}"
+ end
+ STDERR.puts "\nWas rdoc run to create documentation?\n\n"
+ RDoc::usage("Installing Documentation")
+ end
######################################################################
@@ -79,7 +85,7 @@ class RiDriver
def get_info_for(arg)
desc = NameDescriptor.new(arg)
-
+
namespaces = @ri_reader.top_level_namespace
for class_name in desc.class_names
@@ -102,7 +108,7 @@ class RiDriver
methods = @ri_reader.find_methods(desc.method_name,
desc.is_class_method,
namespaces)
-
+
if methods.empty?
raise RiError.new("Nothing known about #{arg}")
else
@@ -129,7 +135,7 @@ class RiDriver
get_info_for(arg)
end
rescue RiError => e
- $stderr.puts(e.message)
+ STDERR.puts(e.message)
exit(1)
end
end