mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rdoc: Update to RDoc 4.1.0.preview.1
RDoc 4.1.0 contains a number of enhancements including a new default style and accessibility support. You can see the changelog here: https://github.com/rdoc/rdoc/blob/v4.1.0.preview.1/History.rdoc * test/rdoc: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fed428007c
commit
df7dac9174
118 changed files with 5394 additions and 3600 deletions
|
@ -9,8 +9,11 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|||
# Added calls_super
|
||||
# Added parent name and class
|
||||
# Added section title
|
||||
# 3::
|
||||
# RDoc 4.1
|
||||
# Added is_alias_for
|
||||
|
||||
MARSHAL_VERSION = 2 # :nodoc:
|
||||
MARSHAL_VERSION = 3 # :nodoc:
|
||||
|
||||
##
|
||||
# Don't rename \#initialize to \::new
|
||||
|
@ -25,7 +28,7 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|||
##
|
||||
# Different ways to call this method
|
||||
|
||||
attr_accessor :call_seq
|
||||
attr_reader :call_seq
|
||||
|
||||
##
|
||||
# Parameters for this method
|
||||
|
@ -89,6 +92,37 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|||
end
|
||||
end
|
||||
|
||||
##
|
||||
# Sets the different ways you can call this method. If an empty +call_seq+
|
||||
# is given nil is assumed.
|
||||
#
|
||||
# See also #param_seq
|
||||
|
||||
def call_seq= call_seq
|
||||
return if call_seq.empty?
|
||||
|
||||
@call_seq = call_seq
|
||||
end
|
||||
|
||||
##
|
||||
# Loads is_alias_for from the internal name. Returns nil if the alias
|
||||
# cannot be found.
|
||||
|
||||
def is_alias_for # :nodoc:
|
||||
case @is_alias_for
|
||||
when RDoc::MethodAttr then
|
||||
@is_alias_for
|
||||
when Array then
|
||||
return nil unless @store
|
||||
|
||||
klass_name, singleton, method_name = @is_alias_for
|
||||
|
||||
return nil unless klass = @store.find_class_or_module(klass_name)
|
||||
|
||||
@is_alias_for = klass.find_method method_name, singleton
|
||||
end
|
||||
end
|
||||
|
||||
##
|
||||
# Dumps this AnyMethod for use by ri. See also #marshal_load
|
||||
|
||||
|
@ -97,6 +131,12 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|||
[a.name, parse(a.comment)]
|
||||
end
|
||||
|
||||
is_alias_for = [
|
||||
@is_alias_for.parent.full_name,
|
||||
@is_alias_for.singleton,
|
||||
@is_alias_for.name
|
||||
] if @is_alias_for
|
||||
|
||||
[ MARSHAL_VERSION,
|
||||
@name,
|
||||
full_name,
|
||||
|
@ -112,6 +152,7 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|||
@parent.name,
|
||||
@parent.class,
|
||||
@section.title,
|
||||
is_alias_for,
|
||||
]
|
||||
end
|
||||
|
||||
|
@ -126,7 +167,6 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|||
initialize_visibility
|
||||
|
||||
@dont_rename_initialize = nil
|
||||
@is_alias_for = nil
|
||||
@token_stream = nil
|
||||
@aliases = []
|
||||
@parent = nil
|
||||
|
@ -150,6 +190,7 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|||
@parent_name = array[12]
|
||||
@parent_title = array[13]
|
||||
@section_title = array[14]
|
||||
@is_alias_for = array[15]
|
||||
|
||||
array[8].each do |new_name, comment|
|
||||
add_alias RDoc::Alias.new(nil, @name, new_name, comment, @singleton)
|
||||
|
@ -174,7 +215,10 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|||
def name
|
||||
return @name if @name
|
||||
|
||||
@name = @call_seq[/^.*?\.(\w+)/, 1] || @call_seq if @call_seq
|
||||
@name =
|
||||
@call_seq[/^.*?\.(\w+)/, 1] ||
|
||||
@call_seq[/^.*?(\w+)/, 1] ||
|
||||
@call_seq if @call_seq
|
||||
end
|
||||
|
||||
##
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue