diff options
author | Jeroen van Meeuwen (OGD) <j.van.meeuwen@ogd.nl> | 2009-12-21 23:45:12 +0100 |
---|---|---|
committer | Jeroen van Meeuwen (OGD) <j.van.meeuwen@ogd.nl> | 2009-12-21 23:45:12 +0100 |
commit | 44c689d58539d56b8fdf2553986a519207f3df92 (patch) | |
tree | f65f60a9d89e9cb1b8010235e66a5a0b32840dd2 | |
parent | bfb24b1e7a4a5412b0938749c818abaf6f726506 (diff) | |
download | ruby-44c689d58539d56b8fdf2553986a519207f3df92.tar.gz ruby-44c689d58539d56b8fdf2553986a519207f3df92.tar.xz ruby-44c689d58539d56b8fdf2553986a519207f3df92.zip |
Ri should look through multiple gem paths
-rw-r--r-- | lib/rdoc/ri/ri_options.rb | 8 | ||||
-rw-r--r-- | lib/rdoc/ri/ri_paths.rb | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/lib/rdoc/ri/ri_options.rb b/lib/rdoc/ri/ri_options.rb index db9f4afec..d2be71790 100644 --- a/lib/rdoc/ri/ri_options.rb +++ b/lib/rdoc/ri/ri_options.rb @@ -63,7 +63,7 @@ module RI [ "--gems", nil, nil, "Include documentation from Rubygems:\n " + - (RI::Paths::GEMDIRS ? "#{Gem.path}/doc/*/ri" : + (RI::Paths::GEMDIRS ? Gem.path.map {|path| "#{path}/doc/*/ri" }.join(', ') : "No Rubygems ri found.") ], [ "--format", "-f", "<name>", @@ -136,7 +136,11 @@ module RI RI::Paths::HOMEDIR ] - directories << "#{Gem.path}/doc/*/ri" if RI::Paths::GEMDIRS + if RI::Paths::GEMDIRS + Gem.path.each {|gempath| + directories << "#{gempath}/doc/*/ri" + } + end directories = directories.join("\n ") diff --git a/lib/rdoc/ri/ri_paths.rb b/lib/rdoc/ri/ri_paths.rb index 32363bf70..180141d54 100644 --- a/lib/rdoc/ri/ri_paths.rb +++ b/lib/rdoc/ri/ri_paths.rb @@ -44,7 +44,7 @@ module RI begin require 'rubygems' - GEMDIRS = Dir["#{Gem.path}/doc/*/ri"] + GEMDIRS = Gem.path.map {|path| Dir["#{path}/doc/*/ri"]}.flatten GEMDIRS.each { |path| RI::Paths::PATH << path } rescue LoadError GEMDIRS = nil |