summaryrefslogtreecommitdiff
path: root/lib/rdoc/any_method.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/any_method.rb
parent97ac172d58d695305c39d555155318edb99f1ea7 (diff)
* 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/any_method.rb')
-rw-r--r--lib/rdoc/any_method.rb19
1 files changed, 12 insertions, 7 deletions
diff --git a/lib/rdoc/any_method.rb b/lib/rdoc/any_method.rb
index f691598910..c008edfe95 100644
--- a/lib/rdoc/any_method.rb
+++ b/lib/rdoc/any_method.rb
@@ -6,7 +6,7 @@ require 'rdoc/token_stream'
class RDoc::AnyMethod < RDoc::MethodAttr
- MARSHAL_VERSION = 0 # :nodoc:
+ MARSHAL_VERSION = 1 # :nodoc:
##
# Don't rename \#initialize to \::new
@@ -44,7 +44,7 @@ class RDoc::AnyMethod < RDoc::MethodAttr
##
# Adds +an_alias+ as an alias for this method in +context+.
- def add_alias(an_alias, context = nil )
+ def add_alias an_alias, context = nil
method = self.class.new an_alias.text, an_alias.new_name
method.record_location an_alias.file
@@ -54,7 +54,7 @@ class RDoc::AnyMethod < RDoc::MethodAttr
method.comment = an_alias.comment
method.is_alias_for = self
@aliases << method
- context.add_method( method ) if context
+ context.add_method method if context
method
end
@@ -83,7 +83,7 @@ class RDoc::AnyMethod < RDoc::MethodAttr
def marshal_dump
aliases = @aliases.map do |a|
- [a.full_name, parse(a.comment)]
+ [a.name, parse(a.comment)]
end
[ MARSHAL_VERSION,
@@ -96,6 +96,7 @@ class RDoc::AnyMethod < RDoc::MethodAttr
@block_params,
aliases,
@params,
+ @file.absolute_name,
]
end
@@ -112,6 +113,7 @@ class RDoc::AnyMethod < RDoc::MethodAttr
@token_stream = nil
@aliases = []
+ version = array[0]
@name = array[1]
@full_name = array[2]
@singleton = array[3]
@@ -119,6 +121,11 @@ class RDoc::AnyMethod < RDoc::MethodAttr
@comment = array[5]
@call_seq = array[6]
@block_params = array[7]
+
+ array[8].each do |new_name, comment|
+ add_alias RDoc::Alias.new(nil, @name, new_name, comment, @singleton)
+ end
+
@params = array[9]
@parent_name = if @full_name =~ /#/ then
@@ -129,9 +136,7 @@ class RDoc::AnyMethod < RDoc::MethodAttr
name.join '::'
end
- array[8].each do |new_name, comment|
- add_alias RDoc::Alias.new(nil, @name, new_name, comment, @singleton)
- end
+ @file = RDoc::TopLevel.new array[10] if version > 0
end
##