rdoc 3.1 → 6.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CONTRIBUTING.rdoc +220 -0
- data/CVE-2013-0256.rdoc +49 -0
- data/ExampleMarkdown.md +37 -0
- data/ExampleRDoc.rdoc +208 -0
- data/Gemfile +12 -0
- data/History.rdoc +1666 -0
- data/LEGAL.rdoc +50 -0
- data/LICENSE.rdoc +57 -0
- data/README.rdoc +129 -0
- data/RI.rdoc +57 -0
- data/Rakefile +84 -81
- data/TODO.rdoc +59 -0
- data/bin/console +7 -0
- data/bin/setup +6 -0
- data/{bin → exe}/rdoc +11 -2
- data/exe/ri +12 -0
- data/lib/rdoc/alias.rb +1 -2
- data/lib/rdoc/anon_class.rb +3 -2
- data/lib/rdoc/any_method.rb +234 -40
- data/lib/rdoc/attr.rb +79 -11
- data/lib/rdoc/class_module.rb +443 -71
- data/lib/rdoc/code_object.rb +216 -20
- data/lib/rdoc/code_objects.rb +4 -21
- data/lib/rdoc/comment.rb +250 -0
- data/lib/rdoc/constant.rb +110 -9
- data/lib/rdoc/context/section.rb +232 -0
- data/lib/rdoc/context.rb +392 -172
- data/lib/rdoc/cross_reference.rb +202 -0
- data/lib/rdoc/encoding.rb +83 -28
- data/lib/rdoc/erb_partial.rb +19 -0
- data/lib/rdoc/erbio.rb +8 -3
- data/lib/rdoc/extend.rb +10 -0
- data/lib/rdoc/generator/darkfish.rb +507 -84
- data/lib/rdoc/generator/json_index.rb +300 -0
- data/lib/rdoc/generator/markup.rb +27 -74
- data/lib/rdoc/generator/pot/message_extractor.rb +68 -0
- data/lib/rdoc/generator/pot/po.rb +84 -0
- data/lib/rdoc/generator/pot/po_entry.rb +141 -0
- data/lib/rdoc/generator/pot.rb +98 -0
- data/lib/rdoc/generator/ri.rb +8 -62
- data/lib/rdoc/generator/template/darkfish/_footer.rhtml +5 -0
- data/lib/rdoc/generator/template/darkfish/_head.rhtml +22 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml +19 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +9 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +15 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml +9 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +15 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +15 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +12 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml +11 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +12 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +11 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +14 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +11 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +18 -0
- data/lib/rdoc/generator/template/darkfish/class.rhtml +172 -0
- data/lib/rdoc/generator/template/darkfish/css/fonts.css +167 -0
- data/lib/rdoc/generator/template/darkfish/css/rdoc.css +639 -0
- data/lib/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/images/add.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/arrow_up.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/delete.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/tag_blue.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/transparent.png +0 -0
- data/lib/rdoc/generator/template/darkfish/index.rhtml +18 -60
- data/lib/rdoc/generator/template/darkfish/js/darkfish.js +51 -83
- data/lib/rdoc/generator/template/darkfish/js/search.js +110 -0
- data/lib/rdoc/generator/template/darkfish/page.rhtml +18 -0
- data/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +18 -0
- data/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +62 -0
- data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +58 -0
- data/lib/rdoc/generator/template/json_index/.document +1 -0
- data/lib/rdoc/generator/template/json_index/js/navigation.js +105 -0
- data/lib/rdoc/generator/template/json_index/js/searcher.js +229 -0
- data/lib/rdoc/generator.rb +24 -13
- data/lib/rdoc/ghost_method.rb +1 -2
- data/lib/rdoc/i18n/locale.rb +102 -0
- data/lib/rdoc/i18n/text.rb +126 -0
- data/lib/rdoc/i18n.rb +10 -0
- data/lib/rdoc/include.rb +5 -95
- data/lib/rdoc/known_classes.rb +5 -2
- data/lib/rdoc/markdown/entities.rb +2132 -0
- data/lib/rdoc/markdown/literals.kpeg +23 -0
- data/lib/rdoc/markdown/literals.rb +416 -0
- data/lib/rdoc/markdown.kpeg +1237 -0
- data/lib/rdoc/markdown.rb +16684 -0
- data/lib/rdoc/markup/attr_changer.rb +23 -0
- data/lib/rdoc/markup/attr_span.rb +36 -0
- data/lib/rdoc/markup/attribute_manager.rb +135 -62
- data/lib/rdoc/markup/attributes.rb +71 -0
- data/lib/rdoc/markup/blank_line.rb +1 -0
- data/lib/rdoc/markup/block_quote.rb +15 -0
- data/lib/rdoc/markup/document.rb +96 -9
- data/lib/rdoc/markup/formatter.rb +138 -25
- data/lib/rdoc/markup/hard_break.rb +32 -0
- data/lib/rdoc/markup/heading.rb +61 -2
- data/lib/rdoc/markup/include.rb +43 -0
- data/lib/rdoc/markup/indented_paragraph.rb +48 -0
- data/lib/rdoc/markup/list.rb +25 -4
- data/lib/rdoc/markup/list_item.rb +18 -4
- data/lib/rdoc/markup/paragraph.rb +15 -0
- data/lib/rdoc/markup/parser.rb +180 -88
- data/lib/rdoc/markup/pre_process.rb +183 -38
- data/lib/rdoc/markup/raw.rb +6 -5
- data/lib/rdoc/markup/regexp_handling.rb +41 -0
- data/lib/rdoc/markup/rule.rb +1 -0
- data/lib/rdoc/markup/table.rb +47 -0
- data/lib/rdoc/markup/to_ansi.rb +17 -7
- data/lib/rdoc/markup/to_bs.rb +5 -8
- data/lib/rdoc/markup/to_html.rb +238 -137
- data/lib/rdoc/markup/to_html_crossref.rb +125 -152
- data/lib/rdoc/markup/to_html_snippet.rb +285 -0
- data/lib/rdoc/markup/to_joined_paragraph.rb +47 -0
- data/lib/rdoc/markup/to_label.rb +75 -0
- data/lib/rdoc/markup/to_markdown.rb +192 -0
- data/lib/rdoc/markup/to_rdoc.rb +85 -15
- data/lib/rdoc/markup/to_table_of_contents.rb +89 -0
- data/lib/rdoc/markup/to_test.rb +2 -4
- data/lib/rdoc/markup/to_tt_only.rb +121 -0
- data/lib/rdoc/markup/verbatim.rb +39 -0
- data/lib/rdoc/markup.rb +388 -110
- data/lib/rdoc/meta_method.rb +1 -2
- data/lib/rdoc/method_attr.rb +87 -21
- data/lib/rdoc/mixin.rb +121 -0
- data/lib/rdoc/normal_class.rb +39 -10
- data/lib/rdoc/normal_module.rb +22 -7
- data/lib/rdoc/options.rb +613 -73
- data/lib/rdoc/parser/c.rb +621 -287
- data/lib/rdoc/parser/changelog.rb +335 -0
- data/lib/rdoc/parser/markdown.rb +24 -0
- data/lib/rdoc/parser/rd.rb +23 -0
- data/lib/rdoc/parser/ripper_state_lex.rb +590 -0
- data/lib/rdoc/parser/ruby.rb +1368 -762
- data/lib/rdoc/parser/ruby_tools.rb +42 -35
- data/lib/rdoc/parser/simple.rb +23 -11
- data/lib/rdoc/parser/text.rb +12 -0
- data/lib/rdoc/parser.rb +162 -89
- data/lib/rdoc/rd/block_parser.rb +1056 -0
- data/lib/rdoc/rd/block_parser.ry +639 -0
- data/lib/rdoc/rd/inline.rb +72 -0
- data/lib/rdoc/rd/inline_parser.rb +1208 -0
- data/lib/rdoc/rd/inline_parser.ry +593 -0
- data/lib/rdoc/rd.rb +100 -0
- data/lib/rdoc/rdoc.rb +208 -115
- data/lib/rdoc/require.rb +1 -2
- data/lib/rdoc/ri/driver.rb +734 -239
- data/lib/rdoc/ri/formatter.rb +1 -0
- data/lib/rdoc/ri/paths.rb +91 -48
- data/lib/rdoc/ri/store.rb +3 -261
- data/lib/rdoc/ri/task.rb +71 -0
- data/lib/rdoc/ri.rb +5 -2
- data/lib/rdoc/rubygems_hook.rb +246 -0
- data/lib/rdoc/servlet.rb +451 -0
- data/lib/rdoc/single_class.rb +14 -2
- data/lib/rdoc/stats/normal.rb +19 -12
- data/lib/rdoc/stats/quiet.rb +1 -0
- data/lib/rdoc/stats/verbose.rb +1 -0
- data/lib/rdoc/stats.rb +262 -104
- data/lib/rdoc/store.rb +979 -0
- data/lib/rdoc/task.rb +84 -44
- data/lib/rdoc/text.rb +117 -72
- data/lib/rdoc/token_stream.rb +73 -4
- data/lib/rdoc/tom_doc.rb +263 -0
- data/lib/rdoc/top_level.rb +111 -261
- data/lib/rdoc/version.rb +8 -0
- data/lib/rdoc.rb +127 -64
- data/man/ri.1 +247 -0
- data/rdoc.gemspec +249 -0
- metadata +171 -291
- data/.autotest +0 -16
- data/.document +0 -5
- data/History.txt +0 -594
- data/LICENSE.txt +0 -57
- data/Manifest.txt +0 -158
- data/README.txt +0 -45
- data/RI.txt +0 -58
- data/bin/ri +0 -5
- data/lib/rdoc/gauntlet.rb +0 -52
- data/lib/rdoc/generator/template/darkfish/classpage.rhtml +0 -296
- data/lib/rdoc/generator/template/darkfish/filepage.rhtml +0 -124
- data/lib/rdoc/generator/template/darkfish/js/jquery.js +0 -32
- data/lib/rdoc/generator/template/darkfish/js/quicksearch.js +0 -114
- data/lib/rdoc/generator/template/darkfish/js/thickbox-compressed.js +0 -10
- data/lib/rdoc/generator/template/darkfish/rdoc.css +0 -706
- data/lib/rdoc/markup/formatter_test_case.rb +0 -689
- data/lib/rdoc/markup/inline.rb +0 -137
- data/lib/rdoc/markup/text_formatter_test_case.rb +0 -116
- data/lib/rdoc/ruby_lex.rb +0 -1291
- data/lib/rdoc/ruby_token.rb +0 -416
- data/test/README +0 -1
- data/test/binary.dat +0 -0
- data/test/hidden.zip.txt +0 -1
- data/test/test.ja.rdoc +0 -10
- data/test/test.ja.txt +0 -8
- data/test/test.txt +0 -1
- data/test/test_attribute_manager.rb +0 -120
- data/test/test_rdoc_alias.rb +0 -13
- data/test/test_rdoc_any_method.rb +0 -126
- data/test/test_rdoc_attr.rb +0 -61
- data/test/test_rdoc_class_module.rb +0 -233
- data/test/test_rdoc_code_object.rb +0 -165
- data/test/test_rdoc_constant.rb +0 -15
- data/test/test_rdoc_context.rb +0 -370
- data/test/test_rdoc_encoding.rb +0 -166
- data/test/test_rdoc_generator_darkfish.rb +0 -119
- data/test/test_rdoc_generator_ri.rb +0 -76
- data/test/test_rdoc_include.rb +0 -96
- data/test/test_rdoc_markup.rb +0 -37
- data/test/test_rdoc_markup_attribute_manager.rb +0 -240
- data/test/test_rdoc_markup_document.rb +0 -51
- data/test/test_rdoc_markup_paragraph.rb +0 -9
- data/test/test_rdoc_markup_parser.rb +0 -1395
- data/test/test_rdoc_markup_pre_process.rb +0 -185
- data/test/test_rdoc_markup_raw.rb +0 -27
- data/test/test_rdoc_markup_to_ansi.rb +0 -328
- data/test/test_rdoc_markup_to_bs.rb +0 -341
- data/test/test_rdoc_markup_to_html.rb +0 -335
- data/test/test_rdoc_markup_to_html_crossref.rb +0 -169
- data/test/test_rdoc_markup_to_rdoc.rb +0 -327
- data/test/test_rdoc_method_attr.rb +0 -122
- data/test/test_rdoc_normal_class.rb +0 -17
- data/test/test_rdoc_normal_module.rb +0 -31
- data/test/test_rdoc_options.rb +0 -342
- data/test/test_rdoc_parser.rb +0 -83
- data/test/test_rdoc_parser_c.rb +0 -912
- data/test/test_rdoc_parser_ruby.rb +0 -1754
- data/test/test_rdoc_parser_simple.rb +0 -99
- data/test/test_rdoc_rdoc.rb +0 -164
- data/test/test_rdoc_require.rb +0 -25
- data/test/test_rdoc_ri_driver.rb +0 -846
- data/test/test_rdoc_ri_paths.rb +0 -43
- data/test/test_rdoc_ri_store.rb +0 -352
- data/test/test_rdoc_ruby_lex.rb +0 -23
- data/test/test_rdoc_stats.rb +0 -38
- data/test/test_rdoc_task.rb +0 -92
- data/test/test_rdoc_text.rb +0 -251
- data/test/test_rdoc_top_level.rb +0 -120
- data/test/xref_data.rb +0 -62
- data/test/xref_test_case.rb +0 -61
- data.tar.gz.sig +0 -3
- metadata.gz.sig +0 -0
data/test/test_rdoc_ri_driver.rb
DELETED
|
@@ -1,846 +0,0 @@
|
|
|
1
|
-
require 'pp'
|
|
2
|
-
require 'rubygems'
|
|
3
|
-
require 'minitest/autorun'
|
|
4
|
-
require 'tmpdir'
|
|
5
|
-
require 'fileutils'
|
|
6
|
-
require 'rdoc/ri/driver'
|
|
7
|
-
|
|
8
|
-
class TestRDocRIDriver < MiniTest::Unit::TestCase
|
|
9
|
-
|
|
10
|
-
def setup
|
|
11
|
-
@RM = RDoc::Markup
|
|
12
|
-
|
|
13
|
-
@tmpdir = File.join Dir.tmpdir, "test_rdoc_ri_driver_#{$$}"
|
|
14
|
-
@home_ri = File.join @tmpdir, 'dot_ri'
|
|
15
|
-
|
|
16
|
-
FileUtils.mkdir_p @tmpdir
|
|
17
|
-
FileUtils.mkdir_p @home_ri
|
|
18
|
-
|
|
19
|
-
@orig_ri = ENV['RI']
|
|
20
|
-
@orig_home = ENV['HOME']
|
|
21
|
-
ENV['HOME'] = @tmpdir
|
|
22
|
-
ENV.delete 'RI'
|
|
23
|
-
|
|
24
|
-
options = RDoc::RI::Driver.process_args []
|
|
25
|
-
options[:home] = @tmpdir
|
|
26
|
-
options[:use_stdout] = true
|
|
27
|
-
options[:formatter] = @RM::ToRdoc
|
|
28
|
-
@driver = RDoc::RI::Driver.new options
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
def teardown
|
|
32
|
-
ENV['HOME'] = @orig_home
|
|
33
|
-
ENV['RI'] = @orig_ri
|
|
34
|
-
FileUtils.rm_rf @tmpdir
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
DUMMY_PAGER = ":;\n"
|
|
38
|
-
|
|
39
|
-
def with_dummy_pager
|
|
40
|
-
pager_env, ENV['RI_PAGER'] = ENV['RI_PAGER'], DUMMY_PAGER
|
|
41
|
-
yield
|
|
42
|
-
ensure
|
|
43
|
-
ENV['RI_PAGER'] = pager_env
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
def mu_pp(obj)
|
|
47
|
-
s = ''
|
|
48
|
-
s = PP.pp obj, s
|
|
49
|
-
s = s.force_encoding(Encoding.default_external) if defined? Encoding
|
|
50
|
-
s.chomp
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
def test_self_dump
|
|
54
|
-
util_store
|
|
55
|
-
|
|
56
|
-
out, = capture_io do
|
|
57
|
-
RDoc::RI::Driver.dump @store.cache_path
|
|
58
|
-
end
|
|
59
|
-
|
|
60
|
-
assert_match %r%:class_methods%, out
|
|
61
|
-
assert_match %r%:modules%, out
|
|
62
|
-
assert_match %r%:instance_methods%, out
|
|
63
|
-
assert_match %r%:ancestors%, out
|
|
64
|
-
end
|
|
65
|
-
|
|
66
|
-
def test_add_also_in_empty
|
|
67
|
-
out = @RM::Document.new
|
|
68
|
-
|
|
69
|
-
@driver.add_also_in out, []
|
|
70
|
-
|
|
71
|
-
assert_empty out
|
|
72
|
-
end
|
|
73
|
-
|
|
74
|
-
def test_add_also_in
|
|
75
|
-
util_multi_store
|
|
76
|
-
@store1.type = :system
|
|
77
|
-
@store2.type = :home
|
|
78
|
-
|
|
79
|
-
out = @RM::Document.new
|
|
80
|
-
|
|
81
|
-
@driver.add_also_in out, [@store1, @store2]
|
|
82
|
-
|
|
83
|
-
expected = @RM::Document.new(
|
|
84
|
-
@RM::Rule.new(1),
|
|
85
|
-
@RM::Paragraph.new('Also found in:'),
|
|
86
|
-
@RM::Verbatim.new("ruby core\n",
|
|
87
|
-
"~/.ri\n"))
|
|
88
|
-
|
|
89
|
-
assert_equal expected, out
|
|
90
|
-
end
|
|
91
|
-
|
|
92
|
-
def test_add_class
|
|
93
|
-
util_multi_store
|
|
94
|
-
|
|
95
|
-
out = @RM::Document.new
|
|
96
|
-
|
|
97
|
-
@driver.add_class out, 'Bar', [@cBar]
|
|
98
|
-
|
|
99
|
-
expected = @RM::Document.new(
|
|
100
|
-
@RM::Heading.new(1, 'Bar < Foo'),
|
|
101
|
-
@RM::BlankLine.new)
|
|
102
|
-
|
|
103
|
-
assert_equal expected, out
|
|
104
|
-
end
|
|
105
|
-
|
|
106
|
-
def test_add_from
|
|
107
|
-
util_store
|
|
108
|
-
@store.type = :system
|
|
109
|
-
|
|
110
|
-
out = @RM::Document.new
|
|
111
|
-
|
|
112
|
-
@driver.add_from out, @store
|
|
113
|
-
|
|
114
|
-
expected = @RM::Document.new @RM::Paragraph.new("(from ruby core)")
|
|
115
|
-
|
|
116
|
-
assert_equal expected, out
|
|
117
|
-
end
|
|
118
|
-
|
|
119
|
-
def test_add_includes_empty
|
|
120
|
-
out = @RM::Document.new
|
|
121
|
-
|
|
122
|
-
@driver.add_includes out, []
|
|
123
|
-
|
|
124
|
-
assert_empty out
|
|
125
|
-
end
|
|
126
|
-
|
|
127
|
-
def test_add_includes_many
|
|
128
|
-
util_store
|
|
129
|
-
|
|
130
|
-
out = @RM::Document.new
|
|
131
|
-
|
|
132
|
-
enum = RDoc::Include.new 'Enumerable', nil
|
|
133
|
-
@cFoo.add_include enum
|
|
134
|
-
|
|
135
|
-
@driver.add_includes out, [[[@cFooInc, enum], @store]]
|
|
136
|
-
|
|
137
|
-
expected = @RM::Document.new(
|
|
138
|
-
@RM::Rule.new(1),
|
|
139
|
-
@RM::Heading.new(1, "Includes:"),
|
|
140
|
-
@RM::Paragraph.new("(from #{@store.friendly_path})"),
|
|
141
|
-
@RM::BlankLine.new,
|
|
142
|
-
@RM::Paragraph.new("Inc"),
|
|
143
|
-
@RM::BlankLine.new,
|
|
144
|
-
@RM::Paragraph.new("Include thingy"),
|
|
145
|
-
@RM::BlankLine.new,
|
|
146
|
-
@RM::Verbatim.new("Enumerable\n"))
|
|
147
|
-
|
|
148
|
-
assert_equal expected, out
|
|
149
|
-
end
|
|
150
|
-
|
|
151
|
-
def test_add_includes_many_no_doc
|
|
152
|
-
util_store
|
|
153
|
-
|
|
154
|
-
out = @RM::Document.new
|
|
155
|
-
|
|
156
|
-
enum = RDoc::Include.new 'Enumerable', nil
|
|
157
|
-
@cFoo.add_include enum
|
|
158
|
-
@cFooInc.instance_variable_set :@comment, ''
|
|
159
|
-
|
|
160
|
-
@driver.add_includes out, [[[@cFooInc, enum], @store]]
|
|
161
|
-
|
|
162
|
-
expected = @RM::Document.new(
|
|
163
|
-
@RM::Rule.new(1),
|
|
164
|
-
@RM::Heading.new(1, "Includes:"),
|
|
165
|
-
@RM::Paragraph.new("(from #{@store.friendly_path})"),
|
|
166
|
-
@RM::Verbatim.new("Inc\n",
|
|
167
|
-
"Enumerable\n"))
|
|
168
|
-
|
|
169
|
-
assert_equal expected, out
|
|
170
|
-
end
|
|
171
|
-
|
|
172
|
-
def test_add_includes_one
|
|
173
|
-
util_store
|
|
174
|
-
|
|
175
|
-
out = @RM::Document.new
|
|
176
|
-
|
|
177
|
-
@driver.add_includes out, [[[@cFooInc], @store]]
|
|
178
|
-
|
|
179
|
-
expected = @RM::Document.new(
|
|
180
|
-
@RM::Rule.new(1),
|
|
181
|
-
@RM::Heading.new(1, "Includes:"),
|
|
182
|
-
@RM::Paragraph.new("Inc (from #{@store.friendly_path})"),
|
|
183
|
-
@RM::BlankLine.new,
|
|
184
|
-
@RM::Paragraph.new("Include thingy"),
|
|
185
|
-
@RM::BlankLine.new)
|
|
186
|
-
|
|
187
|
-
assert_equal expected, out
|
|
188
|
-
end
|
|
189
|
-
|
|
190
|
-
def test_add_method_list
|
|
191
|
-
out = @RM::Document.new
|
|
192
|
-
|
|
193
|
-
@driver.add_method_list out, %w[new], 'Class methods'
|
|
194
|
-
|
|
195
|
-
expected = @RM::Document.new(
|
|
196
|
-
@RM::Heading.new(1, 'Class methods:'),
|
|
197
|
-
@RM::BlankLine.new,
|
|
198
|
-
@RM::Verbatim.new('new'),
|
|
199
|
-
@RM::BlankLine.new)
|
|
200
|
-
|
|
201
|
-
assert_equal expected, out
|
|
202
|
-
end
|
|
203
|
-
|
|
204
|
-
def test_add_method_list_none
|
|
205
|
-
out = @RM::Document.new
|
|
206
|
-
|
|
207
|
-
@driver.add_method_list out, nil, 'Class'
|
|
208
|
-
|
|
209
|
-
assert_equal @RM::Document.new, out
|
|
210
|
-
end
|
|
211
|
-
|
|
212
|
-
def test_ancestors_of
|
|
213
|
-
util_ancestors_store
|
|
214
|
-
|
|
215
|
-
assert_equal %w[X Mixin Object Foo], @driver.ancestors_of('Foo::Bar')
|
|
216
|
-
end
|
|
217
|
-
|
|
218
|
-
def test_classes
|
|
219
|
-
util_multi_store
|
|
220
|
-
|
|
221
|
-
expected = {
|
|
222
|
-
'Ambiguous' => [@store1, @store2],
|
|
223
|
-
'Bar' => [@store2],
|
|
224
|
-
'Foo' => [@store1],
|
|
225
|
-
'Foo::Bar' => [@store1],
|
|
226
|
-
'Foo::Baz' => [@store1, @store2],
|
|
227
|
-
'Inc' => [@store1],
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
assert_equal expected, @driver.classes
|
|
231
|
-
end
|
|
232
|
-
|
|
233
|
-
def test_complete
|
|
234
|
-
store = RDoc::RI::Store.new @home_ri
|
|
235
|
-
store.cache[:ancestors] = {
|
|
236
|
-
'Foo' => %w[Object],
|
|
237
|
-
'Foo::Bar' => %w[Object],
|
|
238
|
-
}
|
|
239
|
-
store.cache[:class_methods] = {
|
|
240
|
-
'Foo' => %w[bar]
|
|
241
|
-
}
|
|
242
|
-
store.cache[:instance_methods] = {
|
|
243
|
-
'Foo' => %w[Bar]
|
|
244
|
-
}
|
|
245
|
-
store.cache[:modules] = %w[
|
|
246
|
-
Foo
|
|
247
|
-
Foo::Bar
|
|
248
|
-
]
|
|
249
|
-
|
|
250
|
-
@driver.stores = [store]
|
|
251
|
-
|
|
252
|
-
assert_equal %w[Foo Foo::Bar], @driver.complete('F')
|
|
253
|
-
assert_equal %w[ Foo::Bar], @driver.complete('Foo::B')
|
|
254
|
-
|
|
255
|
-
assert_equal %w[Foo#Bar], @driver.complete('Foo#'), 'Foo#'
|
|
256
|
-
assert_equal %w[Foo#Bar Foo::bar], @driver.complete('Foo.'), 'Foo.'
|
|
257
|
-
assert_equal %w[Foo::Bar Foo::bar], @driver.complete('Foo::'), 'Foo::'
|
|
258
|
-
end
|
|
259
|
-
|
|
260
|
-
def test_complete_ancestor
|
|
261
|
-
util_ancestors_store
|
|
262
|
-
|
|
263
|
-
assert_equal %w[Foo::Bar#i_method], @driver.complete('Foo::Bar#')
|
|
264
|
-
|
|
265
|
-
assert_equal %w[Foo::Bar#i_method Foo::Bar::c_method Foo::Bar::new],
|
|
266
|
-
@driver.complete('Foo::Bar.')
|
|
267
|
-
end
|
|
268
|
-
|
|
269
|
-
def test_complete_classes
|
|
270
|
-
util_store
|
|
271
|
-
|
|
272
|
-
assert_equal %w[Foo Foo::Bar Foo::Baz], @driver.complete('F')
|
|
273
|
-
assert_equal %w[Foo:: Foo::Bar Foo::Baz], @driver.complete('Foo::')
|
|
274
|
-
assert_equal %w[ Foo::Bar Foo::Baz], @driver.complete('Foo::B')
|
|
275
|
-
end
|
|
276
|
-
|
|
277
|
-
def test_complete_multistore
|
|
278
|
-
util_multi_store
|
|
279
|
-
|
|
280
|
-
assert_equal %w[Bar], @driver.complete('B')
|
|
281
|
-
assert_equal %w[Foo Foo::Bar Foo::Baz], @driver.complete('F')
|
|
282
|
-
end
|
|
283
|
-
|
|
284
|
-
def test_display
|
|
285
|
-
doc = @RM::Document.new(
|
|
286
|
-
@RM::Paragraph.new('hi'))
|
|
287
|
-
|
|
288
|
-
out, = capture_io do
|
|
289
|
-
@driver.display doc
|
|
290
|
-
end
|
|
291
|
-
|
|
292
|
-
assert_equal "hi\n", out
|
|
293
|
-
end
|
|
294
|
-
|
|
295
|
-
def test_display_class
|
|
296
|
-
util_store
|
|
297
|
-
|
|
298
|
-
out, = capture_io do
|
|
299
|
-
@driver.display_class 'Foo::Bar'
|
|
300
|
-
end
|
|
301
|
-
|
|
302
|
-
assert_match %r%^= Foo::Bar%, out
|
|
303
|
-
assert_match %r%^\(from%, out
|
|
304
|
-
|
|
305
|
-
assert_match %r%^= Class methods:%, out
|
|
306
|
-
assert_match %r%^ new%, out
|
|
307
|
-
assert_match %r%^= Instance methods:%, out
|
|
308
|
-
assert_match %r%^ blah%, out
|
|
309
|
-
assert_match %r%^= Attributes:%, out
|
|
310
|
-
assert_match %r%^ attr_accessor attr%, out
|
|
311
|
-
|
|
312
|
-
assert_equal 1, out.scan(/-\n/).length
|
|
313
|
-
end
|
|
314
|
-
|
|
315
|
-
def test_display_class_ambiguous
|
|
316
|
-
util_multi_store
|
|
317
|
-
|
|
318
|
-
out, = capture_io do
|
|
319
|
-
@driver.display_class 'Ambiguous'
|
|
320
|
-
end
|
|
321
|
-
|
|
322
|
-
assert_match %r%^= Ambiguous < Object$%, out
|
|
323
|
-
end
|
|
324
|
-
|
|
325
|
-
def test_display_class_multi_no_doc
|
|
326
|
-
util_multi_store
|
|
327
|
-
|
|
328
|
-
out, = capture_io do
|
|
329
|
-
@driver.display_class 'Foo::Baz'
|
|
330
|
-
end
|
|
331
|
-
|
|
332
|
-
assert_match %r%^= Foo::Baz%, out
|
|
333
|
-
assert_match %r%-\n%, out
|
|
334
|
-
assert_match %r%Also found in:%, out
|
|
335
|
-
assert_match %r%#{Regexp.escape @home_ri}%, out
|
|
336
|
-
assert_match %r%#{Regexp.escape @home_ri2}%, out
|
|
337
|
-
end
|
|
338
|
-
|
|
339
|
-
def test_display_class_superclass
|
|
340
|
-
util_multi_store
|
|
341
|
-
|
|
342
|
-
out, = capture_io do
|
|
343
|
-
@driver.display_class 'Bar'
|
|
344
|
-
end
|
|
345
|
-
|
|
346
|
-
assert_match %r%^= Bar < Foo%, out
|
|
347
|
-
end
|
|
348
|
-
|
|
349
|
-
def test_display_class_module
|
|
350
|
-
util_store
|
|
351
|
-
|
|
352
|
-
out, = capture_io do
|
|
353
|
-
@driver.display_class 'Inc'
|
|
354
|
-
end
|
|
355
|
-
|
|
356
|
-
assert_match %r%^= Inc$%, out
|
|
357
|
-
end
|
|
358
|
-
|
|
359
|
-
def test_display_method
|
|
360
|
-
util_store
|
|
361
|
-
|
|
362
|
-
out, = capture_io do
|
|
363
|
-
@driver.display_method 'Foo::Bar#blah'
|
|
364
|
-
end
|
|
365
|
-
|
|
366
|
-
assert_match %r%Foo::Bar#blah%, out
|
|
367
|
-
assert_match %r%blah.5%, out
|
|
368
|
-
assert_match %r%blah.6%, out
|
|
369
|
-
end
|
|
370
|
-
|
|
371
|
-
def test_display_method_attribute
|
|
372
|
-
util_store
|
|
373
|
-
|
|
374
|
-
out, = capture_io do
|
|
375
|
-
@driver.display_method 'Foo::Bar#attr'
|
|
376
|
-
end
|
|
377
|
-
|
|
378
|
-
assert_match %r%Foo::Bar#attr%, out
|
|
379
|
-
refute_match %r%Implementation from%, out
|
|
380
|
-
end
|
|
381
|
-
|
|
382
|
-
def test_display_method_inherited
|
|
383
|
-
util_multi_store
|
|
384
|
-
|
|
385
|
-
out, = capture_io do
|
|
386
|
-
@driver.display_method 'Bar#inherit'
|
|
387
|
-
end
|
|
388
|
-
|
|
389
|
-
assert_match %r%^= Bar#inherit%, out
|
|
390
|
-
assert_match %r%^=== Implementation from Foo%, out
|
|
391
|
-
end
|
|
392
|
-
|
|
393
|
-
def test_display_name_not_found_class
|
|
394
|
-
util_store
|
|
395
|
-
|
|
396
|
-
out, = capture_io do
|
|
397
|
-
assert_equal false, @driver.display_name('Foo::B')
|
|
398
|
-
end
|
|
399
|
-
|
|
400
|
-
expected = <<-EXPECTED
|
|
401
|
-
Foo::B not found, maybe you meant:
|
|
402
|
-
|
|
403
|
-
Foo::Bar
|
|
404
|
-
Foo::Baz
|
|
405
|
-
EXPECTED
|
|
406
|
-
|
|
407
|
-
assert_equal expected, out
|
|
408
|
-
end
|
|
409
|
-
|
|
410
|
-
def test_display_name_not_found_method
|
|
411
|
-
util_store
|
|
412
|
-
|
|
413
|
-
out, = capture_io do
|
|
414
|
-
assert_equal false, @driver.display_name('Foo::Bar#b')
|
|
415
|
-
end
|
|
416
|
-
|
|
417
|
-
expected = <<-EXPECTED
|
|
418
|
-
Foo::Bar#b not found, maybe you meant:
|
|
419
|
-
|
|
420
|
-
Foo::Bar#blah
|
|
421
|
-
Foo::Bar#bother
|
|
422
|
-
EXPECTED
|
|
423
|
-
|
|
424
|
-
assert_equal expected, out
|
|
425
|
-
end
|
|
426
|
-
|
|
427
|
-
def test_display_method_params
|
|
428
|
-
util_store
|
|
429
|
-
|
|
430
|
-
out, = capture_io do
|
|
431
|
-
@driver.display_method 'Foo::Bar#bother'
|
|
432
|
-
end
|
|
433
|
-
|
|
434
|
-
assert_match %r%things.*stuff%, out
|
|
435
|
-
end
|
|
436
|
-
|
|
437
|
-
def test_expand_class
|
|
438
|
-
util_store
|
|
439
|
-
|
|
440
|
-
assert_equal 'Foo', @driver.expand_class('F')
|
|
441
|
-
assert_equal 'Foo::Bar', @driver.expand_class('F::Bar')
|
|
442
|
-
|
|
443
|
-
assert_raises RDoc::RI::Driver::NotFoundError do
|
|
444
|
-
@driver.expand_class 'F::B'
|
|
445
|
-
end
|
|
446
|
-
end
|
|
447
|
-
|
|
448
|
-
def test_expand_name
|
|
449
|
-
util_store
|
|
450
|
-
|
|
451
|
-
assert_equal '.b', @driver.expand_name('b')
|
|
452
|
-
assert_equal 'Foo', @driver.expand_name('F')
|
|
453
|
-
assert_equal 'Foo::Bar#', @driver.expand_name('F::Bar#')
|
|
454
|
-
|
|
455
|
-
e = assert_raises RDoc::RI::Driver::NotFoundError do
|
|
456
|
-
@driver.expand_name 'Z'
|
|
457
|
-
end
|
|
458
|
-
|
|
459
|
-
assert_equal 'Z', e.name
|
|
460
|
-
end
|
|
461
|
-
|
|
462
|
-
def test_find_methods
|
|
463
|
-
util_store
|
|
464
|
-
|
|
465
|
-
items = []
|
|
466
|
-
|
|
467
|
-
@driver.find_methods 'Foo::Bar.' do |store, klass, ancestor, types, method|
|
|
468
|
-
items << [store, klass, ancestor, types, method]
|
|
469
|
-
end
|
|
470
|
-
|
|
471
|
-
expected = [
|
|
472
|
-
[@store, 'Foo::Bar', 'Foo::Bar', :both, nil],
|
|
473
|
-
]
|
|
474
|
-
|
|
475
|
-
assert_equal expected, items
|
|
476
|
-
end
|
|
477
|
-
|
|
478
|
-
def test_find_methods_method
|
|
479
|
-
util_store
|
|
480
|
-
|
|
481
|
-
items = []
|
|
482
|
-
|
|
483
|
-
@driver.find_methods '.blah' do |store, klass, ancestor, types, method|
|
|
484
|
-
items << [store, klass, ancestor, types, method]
|
|
485
|
-
end
|
|
486
|
-
|
|
487
|
-
expected = [
|
|
488
|
-
[@store, 'Ambiguous', 'Ambiguous', :both, 'blah'],
|
|
489
|
-
[@store, 'Foo', 'Foo', :both, 'blah'],
|
|
490
|
-
[@store, 'Foo::Bar', 'Foo::Bar', :both, 'blah'],
|
|
491
|
-
[@store, 'Foo::Baz', 'Foo::Baz', :both, 'blah'],
|
|
492
|
-
[@store, 'Inc', 'Inc', :both, 'blah'],
|
|
493
|
-
]
|
|
494
|
-
|
|
495
|
-
assert_equal expected, items
|
|
496
|
-
end
|
|
497
|
-
|
|
498
|
-
def test_formatter
|
|
499
|
-
tty = Object.new
|
|
500
|
-
def tty.tty?() true; end
|
|
501
|
-
|
|
502
|
-
driver = RDoc::RI::Driver.new
|
|
503
|
-
|
|
504
|
-
assert_instance_of @RM::ToAnsi, driver.formatter(tty)
|
|
505
|
-
|
|
506
|
-
assert_instance_of @RM::ToBs, driver.formatter(StringIO.new)
|
|
507
|
-
|
|
508
|
-
driver.instance_variable_set :@paging, true
|
|
509
|
-
|
|
510
|
-
assert_instance_of @RM::ToBs, driver.formatter(StringIO.new)
|
|
511
|
-
|
|
512
|
-
driver.instance_variable_set :@formatter_klass, @RM::ToHtml
|
|
513
|
-
|
|
514
|
-
assert_instance_of @RM::ToHtml, driver.formatter(tty)
|
|
515
|
-
end
|
|
516
|
-
|
|
517
|
-
def test_in_path_eh
|
|
518
|
-
path = ENV['PATH']
|
|
519
|
-
|
|
520
|
-
refute @driver.in_path?('/nonexistent')
|
|
521
|
-
|
|
522
|
-
ENV['PATH'] = File.expand_path '..', __FILE__
|
|
523
|
-
|
|
524
|
-
assert @driver.in_path?(File.basename(__FILE__))
|
|
525
|
-
ensure
|
|
526
|
-
ENV['PATH'] = path
|
|
527
|
-
end
|
|
528
|
-
|
|
529
|
-
def test_method_type
|
|
530
|
-
assert_equal :both, @driver.method_type(nil)
|
|
531
|
-
assert_equal :both, @driver.method_type('.')
|
|
532
|
-
assert_equal :instance, @driver.method_type('#')
|
|
533
|
-
assert_equal :class, @driver.method_type('::')
|
|
534
|
-
end
|
|
535
|
-
|
|
536
|
-
def test_list_known_classes
|
|
537
|
-
util_store
|
|
538
|
-
|
|
539
|
-
out, = capture_io do
|
|
540
|
-
@driver.list_known_classes
|
|
541
|
-
end
|
|
542
|
-
|
|
543
|
-
assert_equal "Ambiguous\nFoo\nFoo::Bar\nFoo::Baz\nInc\n", out
|
|
544
|
-
end
|
|
545
|
-
|
|
546
|
-
def test_list_methods_matching
|
|
547
|
-
util_store
|
|
548
|
-
|
|
549
|
-
assert_equal %w[Foo::Bar#attr Foo::Bar#blah Foo::Bar#bother Foo::Bar::new],
|
|
550
|
-
@driver.list_methods_matching('Foo::Bar.')
|
|
551
|
-
end
|
|
552
|
-
|
|
553
|
-
def test_load_method
|
|
554
|
-
util_store
|
|
555
|
-
|
|
556
|
-
method = @driver.load_method(@store, :instance_methods, 'Foo', '#',
|
|
557
|
-
'inherit')
|
|
558
|
-
|
|
559
|
-
assert_equal @inherit, method
|
|
560
|
-
end
|
|
561
|
-
|
|
562
|
-
def test_load_method_inherited
|
|
563
|
-
util_multi_store
|
|
564
|
-
|
|
565
|
-
method = @driver.load_method(@store2, :instance_methods, 'Bar', '#',
|
|
566
|
-
'inherit')
|
|
567
|
-
|
|
568
|
-
assert_equal nil, method
|
|
569
|
-
end
|
|
570
|
-
|
|
571
|
-
def test_load_methods_matching
|
|
572
|
-
util_store
|
|
573
|
-
|
|
574
|
-
expected = [[@store, [@inherit]]]
|
|
575
|
-
|
|
576
|
-
assert_equal expected, @driver.load_methods_matching('Foo#inherit')
|
|
577
|
-
|
|
578
|
-
expected = [[@store, [@blah]]]
|
|
579
|
-
|
|
580
|
-
assert_equal expected, @driver.load_methods_matching('.blah')
|
|
581
|
-
|
|
582
|
-
assert_empty @driver.load_methods_matching('.b')
|
|
583
|
-
end
|
|
584
|
-
|
|
585
|
-
def test_load_methods_matching_inherited
|
|
586
|
-
util_multi_store
|
|
587
|
-
|
|
588
|
-
expected = [[@store1, [@inherit]]]
|
|
589
|
-
|
|
590
|
-
assert_equal expected, @driver.load_methods_matching('Bar#inherit')
|
|
591
|
-
end
|
|
592
|
-
|
|
593
|
-
def _test_page # this test doesn't do anything anymore :(
|
|
594
|
-
@driver.use_stdout = false
|
|
595
|
-
|
|
596
|
-
with_dummy_pager do
|
|
597
|
-
@driver.page do |io|
|
|
598
|
-
skip "couldn't find a standard pager" if io == $stdout
|
|
599
|
-
|
|
600
|
-
assert @driver.paging?
|
|
601
|
-
end
|
|
602
|
-
end
|
|
603
|
-
|
|
604
|
-
refute @driver.paging?
|
|
605
|
-
end
|
|
606
|
-
|
|
607
|
-
def test_page_stdout
|
|
608
|
-
@driver.use_stdout = true
|
|
609
|
-
|
|
610
|
-
@driver.page do |io|
|
|
611
|
-
assert_equal $stdout, io
|
|
612
|
-
end
|
|
613
|
-
|
|
614
|
-
refute @driver.paging?
|
|
615
|
-
end
|
|
616
|
-
|
|
617
|
-
def test_parse_name_method
|
|
618
|
-
klass, type, meth = @driver.parse_name 'foo'
|
|
619
|
-
|
|
620
|
-
assert_equal '', klass, 'foo class'
|
|
621
|
-
assert_equal '.', type, 'foo type'
|
|
622
|
-
assert_equal 'foo', meth, 'foo method'
|
|
623
|
-
|
|
624
|
-
klass, type, meth = @driver.parse_name '#foo'
|
|
625
|
-
|
|
626
|
-
assert_equal '', klass, '#foo class'
|
|
627
|
-
assert_equal '#', type, '#foo type'
|
|
628
|
-
assert_equal 'foo', meth, '#foo method'
|
|
629
|
-
|
|
630
|
-
klass, type, meth = @driver.parse_name '::foo'
|
|
631
|
-
|
|
632
|
-
assert_equal '', klass, '::foo class'
|
|
633
|
-
assert_equal '::', type, '::foo type'
|
|
634
|
-
assert_equal 'foo', meth, '::foo method'
|
|
635
|
-
end
|
|
636
|
-
|
|
637
|
-
def test_parse_name_single_class
|
|
638
|
-
klass, type, meth = @driver.parse_name 'Foo'
|
|
639
|
-
|
|
640
|
-
assert_equal 'Foo', klass, 'Foo class'
|
|
641
|
-
assert_equal nil, type, 'Foo type'
|
|
642
|
-
assert_equal nil, meth, 'Foo method'
|
|
643
|
-
|
|
644
|
-
klass, type, meth = @driver.parse_name 'Foo#'
|
|
645
|
-
|
|
646
|
-
assert_equal 'Foo', klass, 'Foo# class'
|
|
647
|
-
assert_equal '#', type, 'Foo# type'
|
|
648
|
-
assert_equal nil, meth, 'Foo# method'
|
|
649
|
-
|
|
650
|
-
klass, type, meth = @driver.parse_name 'Foo::'
|
|
651
|
-
|
|
652
|
-
assert_equal 'Foo', klass, 'Foo:: class'
|
|
653
|
-
assert_equal '::', type, 'Foo:: type'
|
|
654
|
-
assert_equal nil, meth, 'Foo:: method'
|
|
655
|
-
|
|
656
|
-
klass, type, meth = @driver.parse_name 'Foo.'
|
|
657
|
-
|
|
658
|
-
assert_equal 'Foo', klass, 'Foo. class'
|
|
659
|
-
assert_equal '.', type, 'Foo. type'
|
|
660
|
-
assert_equal nil, meth, 'Foo. method'
|
|
661
|
-
|
|
662
|
-
klass, type, meth = @driver.parse_name 'Foo#Bar'
|
|
663
|
-
|
|
664
|
-
assert_equal 'Foo', klass, 'Foo#Bar class'
|
|
665
|
-
assert_equal '#', type, 'Foo#Bar type'
|
|
666
|
-
assert_equal 'Bar', meth, 'Foo#Bar method'
|
|
667
|
-
|
|
668
|
-
klass, type, meth = @driver.parse_name 'Foo.Bar'
|
|
669
|
-
|
|
670
|
-
assert_equal 'Foo', klass, 'Foo.Bar class'
|
|
671
|
-
assert_equal '.', type, 'Foo.Bar type'
|
|
672
|
-
assert_equal 'Bar', meth, 'Foo.Bar method'
|
|
673
|
-
|
|
674
|
-
klass, type, meth = @driver.parse_name 'Foo::bar'
|
|
675
|
-
|
|
676
|
-
assert_equal 'Foo', klass, 'Foo::bar class'
|
|
677
|
-
assert_equal '::', type, 'Foo::bar type'
|
|
678
|
-
assert_equal 'bar', meth, 'Foo::bar method'
|
|
679
|
-
end
|
|
680
|
-
|
|
681
|
-
def test_parse_name_namespace
|
|
682
|
-
klass, type, meth = @driver.parse_name 'Foo::Bar'
|
|
683
|
-
|
|
684
|
-
assert_equal 'Foo::Bar', klass, 'Foo::Bar class'
|
|
685
|
-
assert_equal nil, type, 'Foo::Bar type'
|
|
686
|
-
assert_equal nil, meth, 'Foo::Bar method'
|
|
687
|
-
|
|
688
|
-
klass, type, meth = @driver.parse_name 'Foo::Bar#'
|
|
689
|
-
|
|
690
|
-
assert_equal 'Foo::Bar', klass, 'Foo::Bar# class'
|
|
691
|
-
assert_equal '#', type, 'Foo::Bar# type'
|
|
692
|
-
assert_equal nil, meth, 'Foo::Bar# method'
|
|
693
|
-
|
|
694
|
-
klass, type, meth = @driver.parse_name 'Foo::Bar#baz'
|
|
695
|
-
|
|
696
|
-
assert_equal 'Foo::Bar', klass, 'Foo::Bar#baz class'
|
|
697
|
-
assert_equal '#', type, 'Foo::Bar#baz type'
|
|
698
|
-
assert_equal 'baz', meth, 'Foo::Bar#baz method'
|
|
699
|
-
end
|
|
700
|
-
|
|
701
|
-
def _test_setup_pager # this test doesn't do anything anymore :(
|
|
702
|
-
@driver.use_stdout = false
|
|
703
|
-
|
|
704
|
-
pager = with_dummy_pager do @driver.setup_pager end
|
|
705
|
-
|
|
706
|
-
skip "couldn't find a standard pager" unless pager
|
|
707
|
-
|
|
708
|
-
assert @driver.paging?
|
|
709
|
-
ensure
|
|
710
|
-
pager.close if pager
|
|
711
|
-
end
|
|
712
|
-
|
|
713
|
-
def util_ancestors_store
|
|
714
|
-
store1 = RDoc::RI::Store.new @home_ri
|
|
715
|
-
store1.cache[:ancestors] = {
|
|
716
|
-
'Foo' => %w[Object],
|
|
717
|
-
'Foo::Bar' => %w[Foo],
|
|
718
|
-
}
|
|
719
|
-
store1.cache[:class_methods] = {
|
|
720
|
-
'Foo' => %w[c_method new],
|
|
721
|
-
'Foo::Bar' => %w[new],
|
|
722
|
-
}
|
|
723
|
-
store1.cache[:instance_methods] = {
|
|
724
|
-
'Foo' => %w[i_method],
|
|
725
|
-
}
|
|
726
|
-
store1.cache[:modules] = %w[
|
|
727
|
-
Foo
|
|
728
|
-
Foo::Bar
|
|
729
|
-
]
|
|
730
|
-
|
|
731
|
-
store2 = RDoc::RI::Store.new @home_ri
|
|
732
|
-
store2.cache[:ancestors] = {
|
|
733
|
-
'Foo' => %w[Mixin Object],
|
|
734
|
-
'Mixin' => %w[],
|
|
735
|
-
'Object' => %w[X Object],
|
|
736
|
-
'X' => %w[Object],
|
|
737
|
-
}
|
|
738
|
-
store2.cache[:class_methods] = {
|
|
739
|
-
'Foo' => %w[c_method new],
|
|
740
|
-
'Mixin' => %w[],
|
|
741
|
-
'X' => %w[],
|
|
742
|
-
'Object' => %w[],
|
|
743
|
-
}
|
|
744
|
-
store2.cache[:instance_methods] = {
|
|
745
|
-
'Foo' => %w[i_method],
|
|
746
|
-
'Mixin' => %w[],
|
|
747
|
-
}
|
|
748
|
-
store2.cache[:modules] = %w[
|
|
749
|
-
Foo
|
|
750
|
-
Mixin
|
|
751
|
-
Object
|
|
752
|
-
X
|
|
753
|
-
]
|
|
754
|
-
|
|
755
|
-
@driver.stores = store1, store2
|
|
756
|
-
end
|
|
757
|
-
|
|
758
|
-
def util_multi_store
|
|
759
|
-
util_store
|
|
760
|
-
@store1 = @store
|
|
761
|
-
|
|
762
|
-
@home_ri2 = "#{@home_ri}2"
|
|
763
|
-
@store2 = RDoc::RI::Store.new @home_ri2
|
|
764
|
-
|
|
765
|
-
# as if seen in a namespace like class Ambiguous::Other
|
|
766
|
-
@mAmbiguous = RDoc::NormalModule.new 'Ambiguous'
|
|
767
|
-
|
|
768
|
-
@cFoo = RDoc::NormalClass.new 'Foo'
|
|
769
|
-
@cBar = RDoc::NormalClass.new 'Bar'
|
|
770
|
-
@cBar.superclass = 'Foo'
|
|
771
|
-
@cFoo_Baz = RDoc::NormalClass.new 'Baz'
|
|
772
|
-
@cFoo_Baz.parent = @cFoo
|
|
773
|
-
|
|
774
|
-
@baz = RDoc::AnyMethod.new nil, 'baz'
|
|
775
|
-
@cBar.add_method @baz
|
|
776
|
-
|
|
777
|
-
@store2.save_class @mAmbiguous
|
|
778
|
-
@store2.save_class @cBar
|
|
779
|
-
@store2.save_class @cFoo_Baz
|
|
780
|
-
|
|
781
|
-
@store2.save_method @cBar, @baz
|
|
782
|
-
|
|
783
|
-
@store2.save_cache
|
|
784
|
-
|
|
785
|
-
@driver.stores = [@store1, @store2]
|
|
786
|
-
end
|
|
787
|
-
|
|
788
|
-
def util_store
|
|
789
|
-
@store = RDoc::RI::Store.new @home_ri
|
|
790
|
-
|
|
791
|
-
@cFoo = RDoc::NormalClass.new 'Foo'
|
|
792
|
-
@mInc = RDoc::NormalModule.new 'Inc'
|
|
793
|
-
@cAmbiguous = RDoc::NormalClass.new 'Ambiguous'
|
|
794
|
-
|
|
795
|
-
doc = @RM::Document.new @RM::Paragraph.new('Include thingy')
|
|
796
|
-
|
|
797
|
-
@cFooInc = RDoc::Include.new 'Inc', doc
|
|
798
|
-
@cFoo.add_include @cFooInc
|
|
799
|
-
|
|
800
|
-
@cFoo_Bar = RDoc::NormalClass.new 'Bar'
|
|
801
|
-
@cFoo_Bar.parent = @cFoo
|
|
802
|
-
|
|
803
|
-
@blah = RDoc::AnyMethod.new nil, 'blah'
|
|
804
|
-
@blah.call_seq = "blah(5) => 5\nblah(6) => 6\n"
|
|
805
|
-
|
|
806
|
-
@bother = RDoc::AnyMethod.new nil, 'bother'
|
|
807
|
-
@bother.params = "(things)"
|
|
808
|
-
@bother.block_params = "stuff"
|
|
809
|
-
|
|
810
|
-
@new = RDoc::AnyMethod.new nil, 'new'
|
|
811
|
-
@new.singleton = true
|
|
812
|
-
|
|
813
|
-
@cFoo_Bar.add_method @blah
|
|
814
|
-
@cFoo_Bar.add_method @bother
|
|
815
|
-
@cFoo_Bar.add_method @new
|
|
816
|
-
|
|
817
|
-
@attr = RDoc::Attr.new nil, 'attr', 'RW', ''
|
|
818
|
-
|
|
819
|
-
@cFoo_Bar.add_attribute @attr
|
|
820
|
-
|
|
821
|
-
@cFoo_Baz = RDoc::NormalClass.new 'Baz'
|
|
822
|
-
@cFoo_Baz.parent = @cFoo
|
|
823
|
-
|
|
824
|
-
@inherit = RDoc::AnyMethod.new nil, 'inherit'
|
|
825
|
-
@cFoo.add_method @inherit
|
|
826
|
-
|
|
827
|
-
@store.save_class @cFoo
|
|
828
|
-
@store.save_class @cFoo_Bar
|
|
829
|
-
@store.save_class @cFoo_Baz
|
|
830
|
-
@store.save_class @mInc
|
|
831
|
-
@store.save_class @cAmbiguous
|
|
832
|
-
|
|
833
|
-
@store.save_method @cFoo_Bar, @blah
|
|
834
|
-
@store.save_method @cFoo_Bar, @bother
|
|
835
|
-
@store.save_method @cFoo_Bar, @new
|
|
836
|
-
@store.save_method @cFoo_Bar, @attr
|
|
837
|
-
|
|
838
|
-
@store.save_method @cFoo, @inherit
|
|
839
|
-
|
|
840
|
-
@store.save_cache
|
|
841
|
-
|
|
842
|
-
@driver.stores = [@store]
|
|
843
|
-
end
|
|
844
|
-
|
|
845
|
-
end
|
|
846
|
-
|