rdoc 2.4.3 → 2.5
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rdoc might be problematic. Click here for more details.
- data.tar.gz.sig +0 -0
- data/.autotest +3 -1
- data/History.txt +68 -0
- data/LICENSE.txt +57 -0
- data/Manifest.txt +37 -19
- data/README.txt +2 -12
- data/Rakefile +12 -12
- data/bin/rdoc +4 -4
- data/lib/rdoc.rb +32 -9
- data/lib/rdoc/alias.rb +2 -2
- data/lib/rdoc/any_method.rb +108 -16
- data/lib/rdoc/attr.rb +87 -1
- data/lib/rdoc/class_module.rb +131 -5
- data/lib/rdoc/code_object.rb +28 -5
- data/lib/rdoc/constant.rb +22 -0
- data/lib/rdoc/context.rb +80 -37
- data/lib/rdoc/gauntlet.rb +48 -0
- data/lib/rdoc/generator/darkfish.rb +25 -23
- data/lib/rdoc/generator/markup.rb +6 -29
- data/lib/rdoc/generator/ri.rb +39 -189
- data/lib/rdoc/generator/template/darkfish/classpage.rhtml +17 -1
- data/lib/rdoc/generator/template/darkfish/filepage.rhtml +10 -0
- data/lib/rdoc/generator/template/darkfish/images/brick.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/brick_link.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/bullet_black.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/bullet_toggle_minus.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/bullet_toggle_plus.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/date.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/find.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/package.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/page_green.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/page_white_text.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/page_white_width.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/plugin.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/ruby.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/tag_green.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/wrench.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/wrench_orange.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/zoom.png +0 -0
- data/lib/rdoc/generator/template/darkfish/index.rhtml +2 -2
- data/lib/rdoc/generator/template/darkfish/rdoc.css +38 -33
- data/lib/rdoc/include.rb +22 -0
- data/lib/rdoc/markup.rb +10 -262
- data/lib/rdoc/markup/attribute_manager.rb +57 -50
- data/lib/rdoc/markup/blank_line.rb +19 -0
- data/lib/rdoc/markup/document.rb +72 -0
- data/lib/rdoc/markup/formatter.rb +118 -0
- data/lib/rdoc/markup/formatter_test_case.rb +341 -0
- data/lib/rdoc/markup/heading.rb +17 -0
- data/lib/rdoc/markup/inline.rb +6 -5
- data/lib/rdoc/markup/list.rb +78 -0
- data/lib/rdoc/markup/list_item.rb +83 -0
- data/lib/rdoc/markup/paragraph.rb +66 -0
- data/lib/rdoc/markup/parser.rb +528 -0
- data/lib/rdoc/markup/rule.rb +17 -0
- data/lib/rdoc/markup/to_ansi.rb +72 -0
- data/lib/rdoc/markup/to_bs.rb +74 -0
- data/lib/rdoc/markup/to_html.rb +106 -172
- data/lib/rdoc/markup/to_html_crossref.rb +10 -4
- data/lib/rdoc/markup/to_rdoc.rb +243 -0
- data/lib/rdoc/markup/to_test.rb +27 -16
- data/lib/rdoc/markup/verbatim.rb +42 -0
- data/lib/rdoc/normal_class.rb +38 -1
- data/lib/rdoc/normal_module.rb +38 -8
- data/lib/rdoc/options.rb +39 -151
- data/lib/rdoc/parser.rb +36 -18
- data/lib/rdoc/parser/c.rb +102 -109
- data/lib/rdoc/parser/ruby.rb +359 -1662
- data/lib/rdoc/parser/ruby_tools.rb +157 -0
- data/lib/rdoc/parser/simple.rb +0 -2
- data/lib/rdoc/rdoc.rb +142 -82
- data/lib/rdoc/ri.rb +10 -0
- data/lib/rdoc/ri/driver.rb +674 -444
- data/lib/rdoc/ri/formatter.rb +2 -651
- data/lib/rdoc/ri/paths.rb +70 -45
- data/lib/rdoc/ri/store.rb +248 -0
- data/lib/rdoc/ruby_lex.rb +1284 -0
- data/lib/rdoc/ruby_token.rb +416 -0
- data/lib/rdoc/single_class.rb +5 -0
- data/lib/rdoc/stats.rb +152 -83
- data/lib/rdoc/task.rb +27 -49
- data/lib/rdoc/text.rb +130 -0
- data/lib/rdoc/tokenstream.rb +28 -9
- data/lib/rdoc/top_level.rb +49 -43
- data/test/hidden.zip.txt +1 -0
- data/test/test_attribute_manager.rb +9 -16
- data/test/test_rdoc_any_method.rb +23 -0
- data/test/test_rdoc_attr.rb +40 -0
- data/test/test_rdoc_class_module.rb +100 -0
- data/test/test_rdoc_code_object.rb +18 -2
- data/test/test_rdoc_context.rb +41 -0
- data/test/test_rdoc_generator_ri.rb +56 -0
- data/test/test_rdoc_markup.rb +21 -610
- data/test/test_rdoc_markup_attribute_manager.rb +14 -17
- data/test/test_rdoc_markup_document.rb +51 -0
- data/test/test_rdoc_markup_paragraph.rb +27 -0
- data/test/test_rdoc_markup_parser.rb +1327 -0
- data/test/test_rdoc_markup_to_ansi.rb +426 -0
- data/test/test_rdoc_markup_to_bs.rb +443 -0
- data/test/test_rdoc_markup_to_html.rb +183 -18
- data/test/test_rdoc_markup_to_html_crossref.rb +1 -3
- data/test/test_rdoc_markup_to_rdoc.rb +426 -0
- data/test/test_rdoc_normal_class.rb +17 -0
- data/test/test_rdoc_normal_module.rb +6 -6
- data/test/test_rdoc_options.rb +41 -0
- data/test/test_rdoc_parser.rb +66 -13
- data/test/test_rdoc_parser_c.rb +93 -38
- data/test/test_rdoc_parser_perl.rb +2 -3
- data/test/test_rdoc_parser_ruby.rb +291 -28
- data/test/test_rdoc_parser_simple.rb +48 -0
- data/test/test_rdoc_rdoc.rb +66 -0
- data/test/test_rdoc_ri_driver.rb +752 -38
- data/test/test_rdoc_ri_paths.rb +39 -0
- data/test/test_rdoc_ri_store.rb +309 -0
- data/test/test_rdoc_text.rb +157 -0
- data/test/test_rdoc_top_level.rb +35 -9
- data/test/xref_data.rb +9 -1
- data/test/xref_test_case.rb +8 -3
- metadata +110 -38
- metadata.gz.sig +0 -0
- data/lib/rdoc/cache.rb +0 -41
- data/lib/rdoc/diagram.rb +0 -340
- data/lib/rdoc/dot.rb +0 -249
- data/lib/rdoc/markup/fragments.rb +0 -377
- data/lib/rdoc/markup/lines.rb +0 -156
- data/lib/rdoc/markup/to_flow.rb +0 -211
- data/lib/rdoc/markup/to_latex.rb +0 -328
- data/lib/rdoc/markup/to_texinfo.rb +0 -73
- data/lib/rdoc/ri/cache.rb +0 -187
- data/lib/rdoc/ri/descriptions.rb +0 -156
- data/lib/rdoc/ri/display.rb +0 -340
- data/lib/rdoc/ri/reader.rb +0 -106
- data/lib/rdoc/ri/util.rb +0 -79
- data/lib/rdoc/ri/writer.rb +0 -68
- data/test/test_rdoc_ri_attribute_formatter.rb +0 -44
- data/test/test_rdoc_ri_default_display.rb +0 -302
- data/test/test_rdoc_ri_formatter.rb +0 -320
- data/test/test_rdoc_ri_html_formatter.rb +0 -141
- data/test/test_rdoc_ri_overstrike_formatter.rb +0 -71
data/lib/rdoc/alias.rb
CHANGED
@@ -39,9 +39,10 @@ class RDoc::Alias < RDoc::CodeObject
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def inspect # :nodoc:
|
42
|
+
parent_name = parent ? parent.name : '(unknown)'
|
42
43
|
"#<%s:0x%x %s.alias_method %s, %s>" % [
|
43
44
|
self.class, object_id,
|
44
|
-
|
45
|
+
parent_name, @old_name, @new_name,
|
45
46
|
]
|
46
47
|
end
|
47
48
|
|
@@ -51,4 +52,3 @@ class RDoc::Alias < RDoc::CodeObject
|
|
51
52
|
|
52
53
|
end
|
53
54
|
|
54
|
-
|
data/lib/rdoc/any_method.rb
CHANGED
@@ -6,6 +6,10 @@ require 'rdoc/tokenstream'
|
|
6
6
|
|
7
7
|
class RDoc::AnyMethod < RDoc::CodeObject
|
8
8
|
|
9
|
+
MARSHAL_VERSION = 0 # :nodoc:
|
10
|
+
|
11
|
+
include Comparable
|
12
|
+
|
9
13
|
##
|
10
14
|
# Method name
|
11
15
|
|
@@ -74,15 +78,19 @@ class RDoc::AnyMethod < RDoc::CodeObject
|
|
74
78
|
|
75
79
|
def initialize(text, name)
|
76
80
|
super()
|
81
|
+
|
77
82
|
@text = text
|
78
83
|
@name = name
|
79
|
-
|
80
|
-
@
|
84
|
+
|
85
|
+
@aliases = []
|
86
|
+
@block_params = nil
|
87
|
+
@call_seq = nil
|
81
88
|
@dont_rename_initialize = false
|
82
|
-
@
|
83
|
-
@
|
84
|
-
@
|
85
|
-
@
|
89
|
+
@is_alias_for = nil
|
90
|
+
@parent_name = nil
|
91
|
+
@singleton = nil
|
92
|
+
@token_stream = nil
|
93
|
+
@visibility = :public
|
86
94
|
|
87
95
|
@aref = @@aref
|
88
96
|
@@aref = @@aref.succ
|
@@ -111,21 +119,73 @@ class RDoc::AnyMethod < RDoc::CodeObject
|
|
111
119
|
|
112
120
|
def inspect # :nodoc:
|
113
121
|
alias_for = @is_alias_for ? " (alias for #{@is_alias_for.name})" : nil
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
alias_for,
|
121
|
-
]
|
122
|
+
"#<%s:0x%x %s (%s)%s>" % [
|
123
|
+
self.class, object_id,
|
124
|
+
full_name,
|
125
|
+
visibility,
|
126
|
+
alias_for,
|
127
|
+
]
|
122
128
|
end
|
123
129
|
|
124
130
|
##
|
125
131
|
# Full method name including namespace
|
126
132
|
|
127
133
|
def full_name
|
128
|
-
"#{@parent.full_name}#{pretty_name}"
|
134
|
+
@full_name ||= "#{@parent ? @parent.full_name : '(unknown)'}#{pretty_name}"
|
135
|
+
end
|
136
|
+
|
137
|
+
##
|
138
|
+
# Dumps this AnyMethod for use by ri. See also #marshal_load
|
139
|
+
|
140
|
+
def marshal_dump
|
141
|
+
aliases = @aliases.map do |a|
|
142
|
+
[a.full_name, parse(a.comment)]
|
143
|
+
end
|
144
|
+
|
145
|
+
[ MARSHAL_VERSION,
|
146
|
+
@name,
|
147
|
+
full_name,
|
148
|
+
@singleton,
|
149
|
+
@visibility,
|
150
|
+
parse(@comment),
|
151
|
+
@call_seq,
|
152
|
+
@block_params,
|
153
|
+
aliases,
|
154
|
+
]
|
155
|
+
end
|
156
|
+
|
157
|
+
##
|
158
|
+
# Loads this AnyMethod from +array+. For a loaded AnyMethod the following
|
159
|
+
# methods will return cached values:
|
160
|
+
#
|
161
|
+
# * #full_name
|
162
|
+
# * #parent_name
|
163
|
+
|
164
|
+
def marshal_load(array)
|
165
|
+
@aliases = []
|
166
|
+
@dont_rename_initialize = nil
|
167
|
+
@is_alias_for = nil
|
168
|
+
@token_stream = nil
|
169
|
+
|
170
|
+
@name = array[1]
|
171
|
+
@full_name = array[2]
|
172
|
+
@singleton = array[3]
|
173
|
+
@visibility = array[4]
|
174
|
+
@comment = array[5]
|
175
|
+
@call_seq = array[6]
|
176
|
+
@block_params = array[7]
|
177
|
+
|
178
|
+
@parent_name = if @full_name =~ /#/ then
|
179
|
+
$`
|
180
|
+
else
|
181
|
+
name = @full_name.split('::')
|
182
|
+
name.pop
|
183
|
+
name.join '::'
|
184
|
+
end
|
185
|
+
|
186
|
+
array[8].each do |old_name, new_name, comment|
|
187
|
+
add_alias RDoc::Alias.new(nil, old_name, new_name, comment)
|
188
|
+
end
|
129
189
|
end
|
130
190
|
|
131
191
|
##
|
@@ -134,7 +194,7 @@ class RDoc::AnyMethod < RDoc::CodeObject
|
|
134
194
|
def name
|
135
195
|
return @name if @name
|
136
196
|
|
137
|
-
@name = @call_seq[/^.*?\.(\w+)/, 1] || @call_seq
|
197
|
+
@name = @call_seq[/^.*?\.(\w+)/, 1] || @call_seq if @call_seq
|
138
198
|
end
|
139
199
|
|
140
200
|
##
|
@@ -161,6 +221,13 @@ class RDoc::AnyMethod < RDoc::CodeObject
|
|
161
221
|
params
|
162
222
|
end
|
163
223
|
|
224
|
+
##
|
225
|
+
# Name of our parent with special handling for un-marshaled methods
|
226
|
+
|
227
|
+
def parent_name
|
228
|
+
@parent_name || super
|
229
|
+
end
|
230
|
+
|
164
231
|
##
|
165
232
|
# Path to this method
|
166
233
|
|
@@ -175,6 +242,31 @@ class RDoc::AnyMethod < RDoc::CodeObject
|
|
175
242
|
"#{singleton ? '::' : '#'}#{@name}"
|
176
243
|
end
|
177
244
|
|
245
|
+
def pretty_print q # :nodoc:
|
246
|
+
alias_for = @is_alias_for ? "alias for #{@is_alias_for.name}" : nil
|
247
|
+
|
248
|
+
q.group 2, "[#{self.class.name} #{full_name} #{visibility}", "]" do
|
249
|
+
if alias_for then
|
250
|
+
q.breakable
|
251
|
+
q.text alias_for
|
252
|
+
end
|
253
|
+
|
254
|
+
if text then
|
255
|
+
q.breakable
|
256
|
+
q.text "text:"
|
257
|
+
q.breakable
|
258
|
+
q.pp @text
|
259
|
+
end
|
260
|
+
|
261
|
+
unless comment.empty? then
|
262
|
+
q.breakable
|
263
|
+
q.text "comment:"
|
264
|
+
q.breakable
|
265
|
+
q.pp @comment
|
266
|
+
end
|
267
|
+
end
|
268
|
+
end
|
269
|
+
|
178
270
|
def to_s # :nodoc:
|
179
271
|
"#{self.class.name}: #{full_name} (#{@text})\n#{@comment}"
|
180
272
|
end
|
data/lib/rdoc/attr.rb
CHANGED
@@ -6,6 +6,8 @@ require 'rdoc/code_object'
|
|
6
6
|
|
7
7
|
class RDoc::Attr < RDoc::CodeObject
|
8
8
|
|
9
|
+
MARSHAL_VERSION = 0 # :nodoc:
|
10
|
+
|
9
11
|
##
|
10
12
|
# Name of the attribute
|
11
13
|
|
@@ -42,6 +44,35 @@ class RDoc::Attr < RDoc::CodeObject
|
|
42
44
|
self.name <=> other.name
|
43
45
|
end
|
44
46
|
|
47
|
+
##
|
48
|
+
# Attributes are equal when their names and rw is identical
|
49
|
+
|
50
|
+
def == other
|
51
|
+
self.class == other.class and
|
52
|
+
self.name == other.name and
|
53
|
+
self.rw == other.rw
|
54
|
+
end
|
55
|
+
|
56
|
+
##
|
57
|
+
# Returns nil, for duck typing with RDoc::AnyMethod
|
58
|
+
|
59
|
+
def block_params
|
60
|
+
end
|
61
|
+
|
62
|
+
##
|
63
|
+
# Returns nil, for duck typing with RDoc::AnyMethod
|
64
|
+
|
65
|
+
def call_seq
|
66
|
+
end
|
67
|
+
|
68
|
+
##
|
69
|
+
# Partially bogus as Attr has no parent. For duck typing with
|
70
|
+
# RDoc::AnyMethod.
|
71
|
+
|
72
|
+
def full_name
|
73
|
+
@full_name ||= "#{@parent ? @parent.full_name : '(unknown)'}##{name}"
|
74
|
+
end
|
75
|
+
|
45
76
|
##
|
46
77
|
# An HTML id-friendly representation of #name
|
47
78
|
|
@@ -64,6 +95,43 @@ class RDoc::Attr < RDoc::CodeObject
|
|
64
95
|
]
|
65
96
|
end
|
66
97
|
|
98
|
+
##
|
99
|
+
# Dumps this Attr for use by ri. See also #marshal_load
|
100
|
+
|
101
|
+
def marshal_dump
|
102
|
+
[ MARSHAL_VERSION,
|
103
|
+
@name,
|
104
|
+
full_name,
|
105
|
+
@rw,
|
106
|
+
@visibility,
|
107
|
+
parse(@comment),
|
108
|
+
]
|
109
|
+
end
|
110
|
+
|
111
|
+
##
|
112
|
+
# Loads this AnyMethod from +array+. For a loaded AnyMethod the following
|
113
|
+
# methods will return cached values:
|
114
|
+
#
|
115
|
+
# * #full_name
|
116
|
+
# * #parent_name
|
117
|
+
|
118
|
+
def marshal_load array
|
119
|
+
@name = array[1]
|
120
|
+
@full_name = array[2]
|
121
|
+
@rw = array[3]
|
122
|
+
@visibility = array[4]
|
123
|
+
@comment = array[5]
|
124
|
+
|
125
|
+
@parent_name = @full_name
|
126
|
+
end
|
127
|
+
|
128
|
+
##
|
129
|
+
# Name of our parent with special handling for un-marshaled methods
|
130
|
+
|
131
|
+
def parent_name
|
132
|
+
@parent_name || super
|
133
|
+
end
|
134
|
+
|
67
135
|
##
|
68
136
|
# URL path for this attribute
|
69
137
|
|
@@ -71,8 +139,26 @@ class RDoc::Attr < RDoc::CodeObject
|
|
71
139
|
"#{@parent.path}##{@name}"
|
72
140
|
end
|
73
141
|
|
142
|
+
##
|
143
|
+
# For duck typing with RDoc::AnyMethod
|
144
|
+
|
145
|
+
def singleton
|
146
|
+
false
|
147
|
+
end
|
148
|
+
|
74
149
|
def to_s # :nodoc:
|
75
|
-
"
|
150
|
+
"#{type} #{name}\n#{comment}"
|
151
|
+
end
|
152
|
+
|
153
|
+
##
|
154
|
+
# Returns attr_reader, attr_writer or attr_accessor as appropriate
|
155
|
+
|
156
|
+
def type
|
157
|
+
case @rw
|
158
|
+
when 'RW' then 'attr_accessor'
|
159
|
+
when 'R' then 'attr_reader'
|
160
|
+
when 'W' then 'attr_writer'
|
161
|
+
end
|
76
162
|
end
|
77
163
|
|
78
164
|
end
|
data/lib/rdoc/class_module.rb
CHANGED
@@ -6,6 +6,8 @@ require 'rdoc/context'
|
|
6
6
|
|
7
7
|
class RDoc::ClassModule < RDoc::Context
|
8
8
|
|
9
|
+
MARSHAL_VERSION = 0 # :nodoc:
|
10
|
+
|
9
11
|
attr_accessor :diagram
|
10
12
|
|
11
13
|
##
|
@@ -19,13 +21,37 @@ class RDoc::ClassModule < RDoc::Context
|
|
19
21
|
super()
|
20
22
|
end
|
21
23
|
|
24
|
+
##
|
25
|
+
# Ancestors list for this ClassModule (abstract)
|
26
|
+
|
27
|
+
def ancestors
|
28
|
+
raise NotImplementedError
|
29
|
+
end
|
30
|
+
|
31
|
+
##
|
32
|
+
# Appends +comment+ to the current comment, but separated by a rule. Works
|
33
|
+
# more like <tt>+=</tt>.
|
34
|
+
|
35
|
+
def comment=(comment)
|
36
|
+
return if comment.empty?
|
37
|
+
|
38
|
+
comment = "#{@comment}\n---\n#{normalize_comment comment}" unless
|
39
|
+
@comment.empty?
|
40
|
+
|
41
|
+
super
|
42
|
+
end
|
43
|
+
|
22
44
|
##
|
23
45
|
# Finds a class or module with +name+ in this namespace or its descendents
|
24
46
|
|
25
47
|
def find_class_named(name)
|
26
48
|
return self if full_name == name
|
27
|
-
|
28
|
-
|
49
|
+
return self if @name == name
|
50
|
+
|
51
|
+
@classes.values.find do |klass|
|
52
|
+
next if klass == self
|
53
|
+
klass.find_class_named name
|
54
|
+
end
|
29
55
|
end
|
30
56
|
|
31
57
|
##
|
@@ -46,6 +72,108 @@ class RDoc::ClassModule < RDoc::Context
|
|
46
72
|
module? ? 'module' : 'class'
|
47
73
|
end
|
48
74
|
|
75
|
+
def marshal_dump # :nodoc:
|
76
|
+
attrs = attributes.sort.map do |attr|
|
77
|
+
[attr.name, attr.rw]
|
78
|
+
end
|
79
|
+
|
80
|
+
method_types = methods_by_type.map do |type, visibilities|
|
81
|
+
visibilities = visibilities.map do |visibility, methods|
|
82
|
+
method_names = methods.map do |method|
|
83
|
+
method.name
|
84
|
+
end
|
85
|
+
|
86
|
+
[visibility, method_names.uniq]
|
87
|
+
end
|
88
|
+
|
89
|
+
[type, visibilities]
|
90
|
+
end
|
91
|
+
|
92
|
+
[ MARSHAL_VERSION,
|
93
|
+
@name,
|
94
|
+
full_name,
|
95
|
+
@superclass,
|
96
|
+
parse(@comment),
|
97
|
+
attrs,
|
98
|
+
constants.map do |const|
|
99
|
+
[const.name, parse(const.comment)]
|
100
|
+
end,
|
101
|
+
includes.map do |incl|
|
102
|
+
[incl.name, parse(incl.comment)]
|
103
|
+
end,
|
104
|
+
method_types,
|
105
|
+
]
|
106
|
+
end
|
107
|
+
|
108
|
+
def marshal_load array # :nodoc:
|
109
|
+
initialize_methods_etc
|
110
|
+
@document_self = true
|
111
|
+
@done_documenting = false
|
112
|
+
@current_section = nil
|
113
|
+
|
114
|
+
@name = array[1]
|
115
|
+
@full_name = array[2]
|
116
|
+
@superclass = array[3]
|
117
|
+
@comment = array[4]
|
118
|
+
|
119
|
+
array[5].each do |name, rw|
|
120
|
+
add_attribute RDoc::Attr.new(nil, name, rw, nil)
|
121
|
+
end
|
122
|
+
|
123
|
+
array[6].each do |name, comment|
|
124
|
+
add_constant RDoc::Constant.new(name, nil, comment)
|
125
|
+
end
|
126
|
+
|
127
|
+
array[7].each do |name, comment|
|
128
|
+
add_include RDoc::Include.new(name, comment)
|
129
|
+
end
|
130
|
+
|
131
|
+
array[8].each do |type, visibilities|
|
132
|
+
visibilities.each do |visibility, methods|
|
133
|
+
@visibility = visibility
|
134
|
+
|
135
|
+
methods.each do |name|
|
136
|
+
method = RDoc::AnyMethod.new nil, name
|
137
|
+
method.singleton = true if type == 'class'
|
138
|
+
add_method method
|
139
|
+
end
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
##
|
145
|
+
# Merges +class_module+ into this ClassModule
|
146
|
+
|
147
|
+
def merge class_module
|
148
|
+
if class_module.comment then
|
149
|
+
document = parse @comment
|
150
|
+
|
151
|
+
class_module.comment.parts.push(*document.parts)
|
152
|
+
|
153
|
+
@comment = class_module.comment
|
154
|
+
end
|
155
|
+
|
156
|
+
class_module.each_attribute do |attr|
|
157
|
+
if match = attributes.find { |a| a.name == attr.name } then
|
158
|
+
match.rw = [match.rw, attr.rw].compact.join
|
159
|
+
else
|
160
|
+
add_attribute attr
|
161
|
+
end
|
162
|
+
end
|
163
|
+
|
164
|
+
class_module.each_constant do |const|
|
165
|
+
add_constant const
|
166
|
+
end
|
167
|
+
|
168
|
+
class_module.each_include do |incl|
|
169
|
+
add_include incl
|
170
|
+
end
|
171
|
+
|
172
|
+
class_module.each_method do |meth|
|
173
|
+
add_method meth
|
174
|
+
end
|
175
|
+
end
|
176
|
+
|
49
177
|
##
|
50
178
|
# Does this object represent a module?
|
51
179
|
|
@@ -65,9 +193,7 @@ class RDoc::ClassModule < RDoc::Context
|
|
65
193
|
# object, returns the name if it is not known.
|
66
194
|
|
67
195
|
def superclass
|
68
|
-
|
69
|
-
|
70
|
-
RDoc::TopLevel.find_class_named(@superclass) || @superclass
|
196
|
+
RDoc::TopLevel.find_class_named_from(@superclass, parent) || @superclass
|
71
197
|
end
|
72
198
|
|
73
199
|
##
|