summaryrefslogtreecommitdiff
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
commit8e94bb29ae5c33d988cba29f130ba0d0a7276b00 (patch)
tree17f3eb310a24fabe871f4f407bd2b98f6ccb270c /lib/rdoc/ri/ri_cache.rb
parente80e14c7882d3955eb88d078f43822af030a1bf4 (diff)
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_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 189817485b..1844ac969e 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