summaryrefslogtreecommitdiffstats
path: root/lib/rdoc/ri/ri_cache.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
commit6b65e32e8ca27a6a59f9cac823ad2ed60ff6bf0f (patch)
treeac67cd6d58dbc0b675cc6e74ab3df2002c0fd503 /lib/rdoc/ri/ri_cache.rb
parent321601ec07ae6f59a7257155a424bfc3e0c1feee (diff)
downloadruby-6b65e32e8ca27a6a59f9cac823ad2ed60ff6bf0f.tar.gz
ruby-6b65e32e8ca27a6a59f9cac823ad2ed60ff6bf0f.tar.xz
ruby-6b65e32e8ca27a6a59f9cac823ad2ed60ff6bf0f.zip
ri now merges the documentation if it finds the same class in multiple places
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@6838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/ri/ri_cache.rb')
-rw-r--r--lib/rdoc/ri/ri_cache.rb19
1 files changed, 15 insertions, 4 deletions
diff --git a/lib/rdoc/ri/ri_cache.rb b/lib/rdoc/ri/ri_cache.rb
index 189817485..1844ac969 100644
--- a/lib/rdoc/ri/ri_cache.rb
+++ b/lib/rdoc/ri/ri_cache.rb
@@ -3,10 +3,10 @@ module RI
class ClassEntry
attr_reader :name
- attr_reader :path_name
+ attr_reader :path_names
def initialize(path_name, name, in_class)
- @path_name = path_name
+ @path_names = [ path_name ]
@name = name
@in_class = in_class
@class_methods = []
@@ -14,6 +14,12 @@ module RI
@inferior_classes = []
end
+ # We found this class in more tha one place, so add
+ # in the name from there.
+ def add_path(path)
+ @path_names << path
+ end
+
# read in our methods and any classes
# and modules in our namespace. Methods are
# stored in files called name-c|i.yaml,
@@ -38,9 +44,14 @@ module RI
else
full_name = File.join(dir, name)
if File.directory?(full_name)
- inf_class = ClassEntry.new(full_name, name, self)
+ inf_class = @inferior_classes.find {|c| c.name == name }
+ if inf_class
+ inf_class.add_path(full_name)
+ else
+ inf_class = ClassEntry.new(full_name, name, self)
+ @inferior_classes << inf_class
+ end
inf_class.load_from(full_name)
- @inferior_classes << inf_class
end
end
end