aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rdoc/top_level.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-16 04:59:24 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-16 04:59:24 +0000
commitb7528b5edb1f9148ea00ebb6151720e5943b3f0b (patch)
tree4caf55c53adb188170240f54b924892fbc5f9814 /lib/rdoc/top_level.rb
parent97ac172d58d695305c39d555155318edb99f1ea7 (diff)
downloadruby-b7528b5edb1f9148ea00ebb6151720e5943b3f0b.tar.gz
* lib/rdoc.rb: Import RDoc 3.7 release candidate
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rdoc/top_level.rb')
-rw-r--r--lib/rdoc/top_level.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/rdoc/top_level.rb b/lib/rdoc/top_level.rb
index d0ea621f8c..b9fd5c9f6f 100644
--- a/lib/rdoc/top_level.rb
+++ b/lib/rdoc/top_level.rb
@@ -220,6 +220,20 @@ class RDoc::TopLevel < RDoc::Context
end
##
+ # Creates a new RDoc::TopLevel with +file_name+ only if one with the same
+ # name does not exist in all_files.
+
+ def self.new file_name
+ if top_level = @all_files_hash[file_name] then
+ top_level
+ else
+ top_level = super
+ @all_files_hash[file_name] = top_level
+ top_level
+ end
+ end
+
+ ##
# Removes from +all_hash+ the contexts that are nodoc or have no content.
#
# See RDoc::Context#remove_from_documentation?
@@ -296,6 +310,15 @@ class RDoc::TopLevel < RDoc::Context
end
##
+ # An RDoc::TopLevel is equal to another with the same absolute_name
+
+ def == other
+ other.class === self and @absolute_name == other.absolute_name
+ end
+
+ alias eql? ==
+
+ ##
# Adds +an_alias+ to +Object+ instead of +self+.
def add_alias(an_alias)
@@ -376,6 +399,14 @@ class RDoc::TopLevel < RDoc::Context
end
##
+ # An RDoc::TopLevel has the same hash as another with the same
+ # absolute_name
+
+ def hash
+ @absolute_name.hash
+ end
+
+ ##
# URL for this with a +prefix+
def http_url(prefix)