rdoc 3.8 → 3.9
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/History.txt +21 -1
- data/Manifest.txt +2 -0
- data/Rakefile +18 -4
- data/bin/rdoc +7 -0
- data/bin/ri +7 -0
- data/lib/rdoc.rb +1 -1
- data/lib/rdoc/class_module.rb +3 -0
- data/lib/rdoc/code_object.rb +43 -0
- data/lib/rdoc/context.rb +5 -2
- data/lib/rdoc/cross_reference.rb +173 -0
- data/lib/rdoc/generator/darkfish.rb +1 -1
- data/lib/rdoc/generator/template/darkfish/classpage.rhtml +2 -0
- data/lib/rdoc/markup.rb +32 -30
- data/lib/rdoc/markup/document.rb +13 -3
- data/lib/rdoc/markup/formatter.rb +4 -0
- data/lib/rdoc/markup/parser.rb +12 -6
- data/lib/rdoc/markup/pre_process.rb +103 -34
- data/lib/rdoc/markup/to_html.rb +7 -6
- data/lib/rdoc/markup/to_html_crossref.rb +62 -146
- data/lib/rdoc/parser.rb +5 -0
- data/lib/rdoc/parser/c.rb +4 -8
- data/lib/rdoc/parser/ruby.rb +18 -36
- data/lib/rdoc/parser/ruby_tools.rb +2 -0
- data/lib/rdoc/ri/driver.rb +23 -10
- data/test/test_rdoc_code_object.rb +59 -3
- data/test/test_rdoc_cross_reference.rb +154 -0
- data/test/test_rdoc_generator_darkfish.rb +6 -0
- data/test/test_rdoc_markup_document.rb +18 -0
- data/test/test_rdoc_markup_parser.rb +38 -0
- data/test/test_rdoc_markup_pre_process.rb +269 -71
- data/test/test_rdoc_markup_to_html.rb +8 -0
- data/test/test_rdoc_markup_to_html_crossref.rb +44 -117
- data/test/test_rdoc_parser_ruby.rb +40 -55
- data/test/test_rdoc_ri_driver.rb +122 -37
- data/test/xref_test_case.rb +5 -0
- metadata +15 -5
- metadata.gz.sig +0 -0
@@ -306,6 +306,14 @@ class TestRDocMarkupToHtml < RDoc::Markup::FormatterTestCase
|
|
306
306
|
@to.gen_url('link:example', 'example')
|
307
307
|
end
|
308
308
|
|
309
|
+
def test_handle_special_HYPERLINK_link
|
310
|
+
special = RDoc::Markup::Special.new 0, 'link:README.txt'
|
311
|
+
|
312
|
+
link = @to.handle_special_HYPERLINK special
|
313
|
+
|
314
|
+
assert_equal '<a href="README.txt">README.txt</a>', link
|
315
|
+
end
|
316
|
+
|
309
317
|
def test_list_verbatim_2
|
310
318
|
str = "* one\n verb1\n verb2\n* two\n"
|
311
319
|
|
@@ -10,159 +10,86 @@ class TestRDocMarkupToHtmlCrossref < XrefTestCase
|
|
10
10
|
def setup
|
11
11
|
super
|
12
12
|
|
13
|
-
@
|
13
|
+
@to = RDoc::Markup::ToHtmlCrossref.new 'index.html', @c1, true
|
14
14
|
end
|
15
15
|
|
16
|
-
def
|
17
|
-
|
18
|
-
end
|
16
|
+
def test_convert_CROSSREF
|
17
|
+
result = @to.convert 'C1'
|
19
18
|
|
20
|
-
|
21
|
-
assert_equal "\n<p>#{body}</p>\n", @xref.convert(ref)
|
19
|
+
assert_equal "\n<p><a href=\"C1.html\">C1</a></p>\n", result
|
22
20
|
end
|
23
21
|
|
24
|
-
def
|
25
|
-
|
26
|
-
|
27
|
-
refute_ref '#m', '#m'
|
22
|
+
def test_convert_HYPERLINK_rdoc_ref
|
23
|
+
result = @to.convert 'rdoc-ref:C1'
|
28
24
|
|
29
|
-
|
30
|
-
assert_ref '../C2/C3.html', 'C2::C3'
|
31
|
-
assert_ref '../C2/C3.html#method-i-m', 'C2::C3#m'
|
32
|
-
assert_ref '../C2/C3/H1.html', 'C3::H1'
|
33
|
-
assert_ref '../C4.html', 'C4'
|
34
|
-
|
35
|
-
assert_ref '../C3/H2.html', 'C3::H2'
|
36
|
-
refute_ref 'H1', 'H1'
|
25
|
+
assert_equal "\n<p><a href=\"C1.html\">C1</a></p>\n", result
|
37
26
|
end
|
38
27
|
|
39
|
-
def
|
40
|
-
|
41
|
-
|
42
|
-
assert_ref '../../C2/C3.html#method-i-m', '#m'
|
43
|
-
|
44
|
-
assert_ref '../../C2/C3.html', 'C3'
|
45
|
-
assert_ref '../../C2/C3.html#method-i-m', 'C3#m'
|
46
|
-
|
47
|
-
assert_ref '../../C2/C3/H1.html', 'H1'
|
48
|
-
assert_ref '../../C2/C3/H1.html', 'C3::H1'
|
49
|
-
|
50
|
-
assert_ref '../../C4.html', 'C4'
|
51
|
-
|
52
|
-
assert_ref '../../C3/H2.html', 'C3::H2'
|
28
|
+
def test_handle_special_CROSSREF
|
29
|
+
assert_equal "<a href=\"C2/C3.html\">C2::C3</a>", SPECIAL('C2::C3')
|
53
30
|
end
|
54
31
|
|
55
|
-
def
|
56
|
-
@
|
57
|
-
|
58
|
-
assert_ref '../C3.html', 'C3'
|
59
|
-
|
60
|
-
refute_ref '#m', '#m'
|
61
|
-
refute_ref 'C3#m', 'C3#m'
|
62
|
-
|
63
|
-
assert_ref '../C3/H1.html', 'H1'
|
64
|
-
|
65
|
-
assert_ref '../C3/H1.html', 'C3::H1'
|
66
|
-
assert_ref '../C3/H2.html', 'C3::H2'
|
67
|
-
|
68
|
-
assert_ref '../C4.html', 'C4'
|
69
|
-
end
|
70
|
-
|
71
|
-
def test_handle_special_CROSSREF_C4
|
72
|
-
@xref = RDoc::Markup::ToHtmlCrossref.new 'classes/C4.html', @c4, true
|
32
|
+
def test_handle_special_CROSSREF_show_hash_false
|
33
|
+
@to.show_hash = false
|
73
34
|
|
74
|
-
|
75
|
-
|
35
|
+
assert_equal "<a href=\"C1.html#method-i-m\">m</a>",
|
36
|
+
SPECIAL('#m')
|
76
37
|
end
|
77
38
|
|
78
|
-
def
|
79
|
-
|
39
|
+
def test_handle_special_HYPERLINK_rdoc
|
40
|
+
RDoc::TopLevel.new 'README.txt'
|
41
|
+
@to = RDoc::Markup::ToHtmlCrossref.new 'C2.html', @c2, true
|
80
42
|
|
81
|
-
|
82
|
-
# resolve to the inner C4 class.
|
83
|
-
assert_ref '../../C4/C4.html', 'C4'
|
84
|
-
end
|
43
|
+
link = @to.handle_special_HYPERLINK hyper 'C2::C3'
|
85
44
|
|
86
|
-
|
87
|
-
assert_ref 'C1.html', 'C1'
|
88
|
-
refute_ref 'H1', 'H1'
|
45
|
+
assert_equal '<a href="C2/C3.html">C2::C3</a>', link
|
89
46
|
|
90
|
-
|
91
|
-
assert_ref 'C2/C3.html', 'C2::C3'
|
92
|
-
assert_ref 'C2/C3/H1.html', 'C2::C3::H1'
|
47
|
+
link = @to.handle_special_HYPERLINK hyper 'C4'
|
93
48
|
|
94
|
-
|
95
|
-
assert_ref 'C3/H1.html', '::C3::H1'
|
49
|
+
assert_equal '<a href="C4.html">C4</a>', link
|
96
50
|
|
97
|
-
|
98
|
-
end
|
51
|
+
link = @to.handle_special_HYPERLINK hyper 'README.txt'
|
99
52
|
|
100
|
-
|
101
|
-
assert_ref 'xref_data_rb.html', 'xref_data.rb'
|
53
|
+
assert_equal '<a href="README_txt.html">README.txt</a>', link
|
102
54
|
end
|
103
55
|
|
104
|
-
def
|
105
|
-
|
106
|
-
|
107
|
-
assert_ref 'C1.html#method-c-m', '::m'
|
108
|
-
|
109
|
-
assert_ref 'C1.html#method-i-m', 'C1#m'
|
110
|
-
assert_ref 'C1.html#method-c-m', 'C1.m'
|
111
|
-
assert_ref 'C1.html#method-c-m', 'C1::m'
|
56
|
+
def test_handle_special_TIDYLINK_rdoc
|
57
|
+
RDoc::TopLevel.new 'README.txt'
|
58
|
+
@to = RDoc::Markup::ToHtmlCrossref.new 'C2.html', @c2, true
|
112
59
|
|
113
|
-
|
114
|
-
assert_ref 'C1.html#method-i-m', 'C1#m()'
|
115
|
-
assert_ref 'C1.html#method-i-m', 'C1#m(*)'
|
60
|
+
link = @to.handle_special_TIDYLINK tidy 'C2::C3'
|
116
61
|
|
117
|
-
|
118
|
-
assert_ref 'C1.html#method-c-m', 'C1.m()'
|
119
|
-
assert_ref 'C1.html#method-c-m', 'C1.m(*)'
|
62
|
+
assert_equal '<a href="C2/C3.html">tidy</a>', link
|
120
63
|
|
121
|
-
|
122
|
-
assert_ref 'C1.html#method-c-m', 'C1::m()'
|
123
|
-
assert_ref 'C1.html#method-c-m', 'C1::m(*)'
|
64
|
+
link = @to.handle_special_TIDYLINK tidy 'C4'
|
124
65
|
|
125
|
-
|
66
|
+
assert_equal '<a href="C4.html">tidy</a>', link
|
126
67
|
|
127
|
-
|
68
|
+
link = @to.handle_special_TIDYLINK tidy 'README.txt'
|
128
69
|
|
129
|
-
|
130
|
-
assert_ref 'C2/C3/H1.html#method-i-m-3F', 'C2::C3::H1#m?'
|
131
|
-
|
132
|
-
assert_ref 'C2/C3.html#method-i-m', '::C2::C3#m'
|
133
|
-
assert_ref 'C2/C3.html#method-i-m', '::C2::C3#m()'
|
134
|
-
assert_ref 'C2/C3.html#method-i-m', '::C2::C3#m(*)'
|
70
|
+
assert_equal '<a href="README_txt.html">tidy</a>', link
|
135
71
|
end
|
136
72
|
|
137
|
-
def
|
138
|
-
assert_equal '', @
|
139
|
-
|
140
|
-
refute_ref 'bogus', 'bogus'
|
141
|
-
refute_ref 'bogus', '\bogus'
|
142
|
-
refute_ref '\bogus', '\\\bogus'
|
143
|
-
|
144
|
-
refute_ref '#n', '\#n'
|
145
|
-
refute_ref '#n()', '\#n()'
|
146
|
-
refute_ref '#n(*)', '\#n(*)'
|
73
|
+
def test_link
|
74
|
+
assert_equal 'n', @to.link('n', 'n')
|
147
75
|
|
148
|
-
|
149
|
-
|
76
|
+
assert_equal '<a href="C1.html#method-c-m">m</a>', @to.link('m', 'm')
|
77
|
+
end
|
150
78
|
|
151
|
-
|
152
|
-
|
153
|
-
refute_ref '::C3::H1#n', '\::C3::H1#n'
|
79
|
+
def SPECIAL text
|
80
|
+
@to.handle_special_CROSSREF special text
|
154
81
|
end
|
155
82
|
|
156
|
-
def
|
157
|
-
|
83
|
+
def hyper reference
|
84
|
+
RDoc::Markup::Special.new 0, "rdoc-ref:#{reference}"
|
85
|
+
end
|
158
86
|
|
159
|
-
|
160
|
-
|
87
|
+
def special text
|
88
|
+
RDoc::Markup::Special.new 0, text
|
161
89
|
end
|
162
90
|
|
163
|
-
def
|
164
|
-
|
165
|
-
@xref.convert('C2::C3;method(*)')
|
91
|
+
def tidy reference
|
92
|
+
RDoc::Markup::Special.new 0, "{tidy}[rdoc-ref:#{reference}]"
|
166
93
|
end
|
167
94
|
|
168
95
|
end
|
@@ -313,22 +313,6 @@ class C; end
|
|
313
313
|
comment
|
314
314
|
end
|
315
315
|
|
316
|
-
def test_look_for_directives_in_enddoc
|
317
|
-
util_parser ""
|
318
|
-
|
319
|
-
@parser.look_for_directives_in @top_level, "# :enddoc:\n"
|
320
|
-
|
321
|
-
assert @top_level.done_documenting
|
322
|
-
end
|
323
|
-
|
324
|
-
def test_look_for_directives_in_main
|
325
|
-
util_parser ""
|
326
|
-
|
327
|
-
@parser.look_for_directives_in @top_level, "# :main: new main page\n"
|
328
|
-
|
329
|
-
assert_equal 'new main page', @options.main_page
|
330
|
-
end
|
331
|
-
|
332
316
|
def test_look_for_directives_in_method
|
333
317
|
util_parser ""
|
334
318
|
|
@@ -345,31 +329,6 @@ class C; end
|
|
345
329
|
assert_equal "# :singleton-method: my_method\n", comment
|
346
330
|
end
|
347
331
|
|
348
|
-
def test_look_for_directives_in_startdoc
|
349
|
-
util_parser ""
|
350
|
-
|
351
|
-
@top_level.stop_doc
|
352
|
-
assert !@top_level.document_self
|
353
|
-
assert !@top_level.document_children
|
354
|
-
|
355
|
-
@parser.look_for_directives_in @top_level, "# :startdoc:\n"
|
356
|
-
|
357
|
-
assert @top_level.document_self
|
358
|
-
assert @top_level.document_children
|
359
|
-
end
|
360
|
-
|
361
|
-
def test_look_for_directives_in_stopdoc
|
362
|
-
util_parser ""
|
363
|
-
|
364
|
-
assert @top_level.document_self
|
365
|
-
assert @top_level.document_children
|
366
|
-
|
367
|
-
@parser.look_for_directives_in @top_level, "# :stopdoc:\n"
|
368
|
-
|
369
|
-
assert !@top_level.document_self
|
370
|
-
assert !@top_level.document_children
|
371
|
-
end
|
372
|
-
|
373
332
|
def test_look_for_directives_in_section
|
374
333
|
util_parser ""
|
375
334
|
|
@@ -384,14 +343,6 @@ class C; end
|
|
384
343
|
assert_equal '', comment
|
385
344
|
end
|
386
345
|
|
387
|
-
def test_look_for_directives_in_title
|
388
|
-
util_parser ""
|
389
|
-
|
390
|
-
@parser.look_for_directives_in @top_level, "# :title: new title\n"
|
391
|
-
|
392
|
-
assert_equal 'new title', @options.title
|
393
|
-
end
|
394
|
-
|
395
346
|
def test_look_for_directives_in_unhandled
|
396
347
|
util_parser ""
|
397
348
|
|
@@ -797,12 +748,7 @@ end
|
|
797
748
|
|
798
749
|
@parser.parse_class @top_level, RDoc::Parser::Ruby::NORMAL, tk, comment
|
799
750
|
|
800
|
-
|
801
|
-
assert_equal 'Foo', foo.full_name
|
802
|
-
assert_equal 'my class', foo.comment
|
803
|
-
assert_equal [@top_level], foo.in_files
|
804
|
-
assert_equal 0, foo.offset
|
805
|
-
assert_equal 1, foo.line
|
751
|
+
assert_empty @top_level.classes.first.comment
|
806
752
|
end
|
807
753
|
|
808
754
|
def test_parse_multi_ghost_methods
|
@@ -2227,6 +2173,45 @@ end
|
|
2227
2173
|
assert_empty @top_level.comment
|
2228
2174
|
end
|
2229
2175
|
|
2176
|
+
def test_parse_top_level_statements_stopdoc_integration
|
2177
|
+
content = <<-CONTENT
|
2178
|
+
# :stopdoc:
|
2179
|
+
|
2180
|
+
class Example
|
2181
|
+
def method_name
|
2182
|
+
end
|
2183
|
+
end
|
2184
|
+
CONTENT
|
2185
|
+
|
2186
|
+
util_parser content
|
2187
|
+
|
2188
|
+
@parser.parse_top_level_statements @top_level
|
2189
|
+
|
2190
|
+
assert_equal 1, @top_level.classes.length
|
2191
|
+
assert_empty @top_level.modules
|
2192
|
+
|
2193
|
+
assert @top_level.find_module_named('Example').ignored?
|
2194
|
+
end
|
2195
|
+
|
2196
|
+
# This tests parse_comment
|
2197
|
+
def test_parse_top_level_statements_constant_nodoc_integration
|
2198
|
+
content = <<-CONTENT
|
2199
|
+
class A
|
2200
|
+
C = A # :nodoc:
|
2201
|
+
end
|
2202
|
+
CONTENT
|
2203
|
+
|
2204
|
+
util_parser content
|
2205
|
+
|
2206
|
+
@parser.parse_top_level_statements @top_level
|
2207
|
+
|
2208
|
+
klass = @top_level.find_module_named('A')
|
2209
|
+
|
2210
|
+
c = klass.constants.first
|
2211
|
+
|
2212
|
+
assert_nil c.document_self, 'C should not be documented'
|
2213
|
+
end
|
2214
|
+
|
2230
2215
|
def test_parse_yield_in_braces_with_parens
|
2231
2216
|
klass = RDoc::NormalClass.new 'Foo'
|
2232
2217
|
klass.parent = @top_level
|
data/test/test_rdoc_ri_driver.rb
CHANGED
@@ -5,6 +5,7 @@ require 'tmpdir'
|
|
5
5
|
require 'fileutils'
|
6
6
|
require 'stringio'
|
7
7
|
require 'rdoc/ri/driver'
|
8
|
+
require 'rdoc/rdoc'
|
8
9
|
|
9
10
|
class TestRDocRIDriver < MiniTest::Unit::TestCase
|
10
11
|
|
@@ -223,7 +224,7 @@ class TestRDocRIDriver < MiniTest::Unit::TestCase
|
|
223
224
|
def test_add_method_list_none
|
224
225
|
out = @RM::Document.new
|
225
226
|
|
226
|
-
@driver.add_method_list out,
|
227
|
+
@driver.add_method_list out, [], 'Class'
|
227
228
|
|
228
229
|
assert_equal @RM::Document.new, out
|
229
230
|
end
|
@@ -249,6 +250,46 @@ class TestRDocRIDriver < MiniTest::Unit::TestCase
|
|
249
250
|
assert_equal expected, @driver.classes
|
250
251
|
end
|
251
252
|
|
253
|
+
def test_class_document
|
254
|
+
util_store
|
255
|
+
|
256
|
+
tl1 = RDoc::TopLevel.new 'one.rb'
|
257
|
+
tl2 = RDoc::TopLevel.new 'two.rb'
|
258
|
+
|
259
|
+
@cFoo.add_comment 'one', tl1
|
260
|
+
@cFoo.add_comment 'two', tl2
|
261
|
+
@store.save_class @cFoo
|
262
|
+
|
263
|
+
found = [
|
264
|
+
[@store, @store.load_class(@cFoo.full_name)]
|
265
|
+
]
|
266
|
+
|
267
|
+
out = @driver.class_document @cFoo.full_name, found, [], []
|
268
|
+
|
269
|
+
expected = @RM::Document.new
|
270
|
+
@driver.add_class expected, 'Foo', []
|
271
|
+
@driver.add_includes expected, []
|
272
|
+
@driver.add_from expected, @store
|
273
|
+
expected << @RM::Rule.new(1)
|
274
|
+
|
275
|
+
doc = @RM::Document.new(@RM::Paragraph.new('one'))
|
276
|
+
doc.file = 'one.rb'
|
277
|
+
expected.push doc
|
278
|
+
expected << @RM::BlankLine.new
|
279
|
+
doc = @RM::Document.new(@RM::Paragraph.new('two'))
|
280
|
+
doc.file = 'two.rb'
|
281
|
+
expected.push doc
|
282
|
+
|
283
|
+
expected << @RM::Rule.new(1)
|
284
|
+
expected << @RM::Heading.new(1, 'Instance methods:')
|
285
|
+
expected << @RM::BlankLine.new
|
286
|
+
expected << @RM::Verbatim.new('inherit')
|
287
|
+
expected << @RM::Verbatim.new('override')
|
288
|
+
expected << @RM::BlankLine.new
|
289
|
+
|
290
|
+
assert_equal expected, out
|
291
|
+
end
|
292
|
+
|
252
293
|
def test_complete
|
253
294
|
store = RDoc::RI::Store.new @home_ri
|
254
295
|
store.cache[:ancestors] = {
|
@@ -633,8 +674,24 @@ Foo::Bar#bother
|
|
633
674
|
def test_list_methods_matching
|
634
675
|
util_store
|
635
676
|
|
636
|
-
assert_equal %w[
|
637
|
-
|
677
|
+
assert_equal %w[
|
678
|
+
Foo::Bar#attr
|
679
|
+
Foo::Bar#blah
|
680
|
+
Foo::Bar#bother
|
681
|
+
Foo::Bar::new
|
682
|
+
],
|
683
|
+
@driver.list_methods_matching('Foo::Bar.').sort
|
684
|
+
end
|
685
|
+
|
686
|
+
def test_list_methods_matching_inherit
|
687
|
+
util_multi_store
|
688
|
+
|
689
|
+
assert_equal %w[
|
690
|
+
Bar#baz
|
691
|
+
Bar#inherit
|
692
|
+
Bar#override
|
693
|
+
],
|
694
|
+
@driver.list_methods_matching('Bar.').sort
|
638
695
|
end
|
639
696
|
|
640
697
|
def test_list_methods_matching_regexp
|
@@ -805,6 +862,42 @@ Foo::Bar#bother
|
|
805
862
|
assert_equal 'baz', meth, 'Foo::Bar#baz method'
|
806
863
|
end
|
807
864
|
|
865
|
+
def test_parse_name_special
|
866
|
+
specials = %w[
|
867
|
+
%
|
868
|
+
&
|
869
|
+
*
|
870
|
+
+
|
871
|
+
+@
|
872
|
+
-
|
873
|
+
-@
|
874
|
+
/
|
875
|
+
<
|
876
|
+
<<
|
877
|
+
<=
|
878
|
+
<=>
|
879
|
+
==
|
880
|
+
===
|
881
|
+
=>
|
882
|
+
=~
|
883
|
+
>
|
884
|
+
>>
|
885
|
+
[]
|
886
|
+
[]=
|
887
|
+
^
|
888
|
+
`
|
889
|
+
|
|
890
|
+
~
|
891
|
+
~@
|
892
|
+
]
|
893
|
+
|
894
|
+
specials.each do |special|
|
895
|
+
parsed = @driver.parse_name special
|
896
|
+
|
897
|
+
assert_equal ['', '.', special], parsed
|
898
|
+
end
|
899
|
+
end
|
900
|
+
|
808
901
|
def _test_setup_pager # this test doesn't do anything anymore :(
|
809
902
|
@driver.use_stdout = false
|
810
903
|
|
@@ -864,29 +957,28 @@ Foo::Bar#bother
|
|
864
957
|
|
865
958
|
def util_multi_store
|
866
959
|
util_store
|
960
|
+
|
867
961
|
@store1 = @store
|
868
962
|
|
963
|
+
@top_level = RDoc::TopLevel.new 'file.rb'
|
964
|
+
|
869
965
|
@home_ri2 = "#{@home_ri}2"
|
870
966
|
@store2 = RDoc::RI::Store.new @home_ri2
|
871
967
|
|
872
968
|
# as if seen in a namespace like class Ambiguous::Other
|
873
|
-
@mAmbiguous = RDoc::NormalModule
|
969
|
+
@mAmbiguous = @top_level.add_module RDoc::NormalModule, 'Ambiguous'
|
874
970
|
|
875
|
-
@cFoo = RDoc::NormalClass
|
971
|
+
@cFoo = @top_level.add_class RDoc::NormalClass, 'Foo'
|
876
972
|
|
877
|
-
@cBar = RDoc::NormalClass
|
878
|
-
@
|
879
|
-
@cFoo_Baz = RDoc::NormalClass.new 'Baz'
|
880
|
-
@cFoo_Baz.parent = @cFoo
|
973
|
+
@cBar = @top_level.add_class RDoc::NormalClass, 'Bar', 'Foo'
|
974
|
+
@cFoo_Baz = @cFoo.add_class RDoc::NormalClass, 'Baz'
|
881
975
|
|
882
|
-
@baz = RDoc::AnyMethod.new
|
976
|
+
@baz = @cBar.add_method RDoc::AnyMethod.new(nil, 'baz')
|
883
977
|
@baz.record_location @top_level
|
884
|
-
@cBar.add_method @baz
|
885
978
|
|
886
|
-
@override = RDoc::AnyMethod.new
|
979
|
+
@override = @cBar.add_method RDoc::AnyMethod.new(nil, 'override')
|
887
980
|
@override.comment = 'must be displayed'
|
888
981
|
@override.record_location @top_level
|
889
|
-
@cBar.add_method @override
|
890
982
|
|
891
983
|
@store2.save_class @mAmbiguous
|
892
984
|
@store2.save_class @cBar
|
@@ -898,6 +990,8 @@ Foo::Bar#bother
|
|
898
990
|
@store2.save_cache
|
899
991
|
|
900
992
|
@driver.stores = [@store1, @store2]
|
993
|
+
|
994
|
+
RDoc::RDoc.reset
|
901
995
|
end
|
902
996
|
|
903
997
|
def util_store
|
@@ -905,53 +999,42 @@ Foo::Bar#bother
|
|
905
999
|
|
906
1000
|
@top_level = RDoc::TopLevel.new 'file.rb'
|
907
1001
|
|
908
|
-
@cFoo
|
909
|
-
@mInc
|
910
|
-
@cAmbiguous = RDoc::NormalClass
|
1002
|
+
@cFoo = @top_level.add_class RDoc::NormalClass, 'Foo'
|
1003
|
+
@mInc = @top_level.add_module RDoc::NormalModule, 'Inc'
|
1004
|
+
@cAmbiguous = @top_level.add_class RDoc::NormalClass, 'Ambiguous'
|
911
1005
|
|
912
1006
|
doc = @RM::Document.new @RM::Paragraph.new('Include thingy')
|
913
|
-
|
914
|
-
@cFooInc = RDoc::Include.new 'Inc', doc
|
1007
|
+
@cFooInc = @cFoo.add_include RDoc::Include.new('Inc', doc)
|
915
1008
|
@cFooInc.record_location @top_level
|
916
|
-
@cFoo.add_include @cFooInc
|
917
1009
|
|
918
|
-
@cFoo_Bar = RDoc::NormalClass
|
919
|
-
@cFoo_Bar.parent = @cFoo
|
1010
|
+
@cFoo_Bar = @cFoo.add_class RDoc::NormalClass, 'Bar'
|
920
1011
|
|
921
|
-
@blah = RDoc::AnyMethod.new
|
1012
|
+
@blah = @cFoo_Bar.add_method RDoc::AnyMethod.new(nil, 'blah')
|
922
1013
|
@blah.call_seq = "blah(5) => 5\nblah(6) => 6\n"
|
923
1014
|
@blah.record_location @top_level
|
924
1015
|
|
925
|
-
@bother = RDoc::AnyMethod.new
|
1016
|
+
@bother = @cFoo_Bar.add_method RDoc::AnyMethod.new(nil, 'bother')
|
926
1017
|
@bother.block_params = "stuff"
|
927
1018
|
@bother.params = "(things)"
|
928
1019
|
@bother.record_location @top_level
|
929
1020
|
|
930
|
-
@new
|
1021
|
+
@new = @cFoo_Bar.add_method RDoc::AnyMethod.new nil, 'new'
|
931
1022
|
@new.record_location @top_level
|
932
1023
|
@new.singleton = true
|
933
1024
|
|
934
|
-
@cFoo_Bar.
|
935
|
-
@cFoo_Bar.add_method @bother
|
936
|
-
@cFoo_Bar.add_method @new
|
937
|
-
|
938
|
-
@attr = RDoc::Attr.new nil, 'attr', 'RW', ''
|
1025
|
+
@attr = @cFoo_Bar.add_attribute RDoc::Attr.new nil, 'attr', 'RW', ''
|
939
1026
|
@attr.record_location @top_level
|
940
1027
|
|
941
|
-
@
|
942
|
-
|
943
|
-
@cFoo_Baz = RDoc::NormalClass.new 'Baz'
|
944
|
-
@cFoo_Baz.parent = @cFoo
|
1028
|
+
@cFoo_Baz = @cFoo.add_class RDoc::NormalClass, 'Baz'
|
1029
|
+
@cFoo_Baz.record_location @top_level
|
945
1030
|
|
946
|
-
@inherit = RDoc::AnyMethod.new
|
1031
|
+
@inherit = @cFoo.add_method RDoc::AnyMethod.new(nil, 'inherit')
|
947
1032
|
@inherit.record_location @top_level
|
948
|
-
@cFoo.add_method @inherit
|
949
1033
|
|
950
1034
|
# overriden by Bar in multi_store
|
951
|
-
@overriden = RDoc::AnyMethod.new
|
1035
|
+
@overriden = @cFoo.add_method RDoc::AnyMethod.new(nil, 'override')
|
952
1036
|
@overriden.comment = 'must not be displayed'
|
953
1037
|
@overriden.record_location @top_level
|
954
|
-
@cFoo.add_method @overriden
|
955
1038
|
|
956
1039
|
@store.save_class @cFoo
|
957
1040
|
@store.save_class @cFoo_Bar
|
@@ -970,6 +1053,8 @@ Foo::Bar#bother
|
|
970
1053
|
@store.save_cache
|
971
1054
|
|
972
1055
|
@driver.stores = [@store]
|
1056
|
+
|
1057
|
+
RDoc::RDoc.reset
|
973
1058
|
end
|
974
1059
|
|
975
1060
|
end
|