rdoc 7.2.0 → 8.1.0

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.
Files changed (150) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +4 -7
  3. data/LICENSE.rdoc +4 -0
  4. data/README.md +43 -2
  5. data/RI.md +75 -75
  6. data/doc/markup_reference/markdown.md +104 -3
  7. data/exe/rdoc +2 -2
  8. data/lib/rdoc/code_object/alias.rb +70 -74
  9. data/lib/rdoc/code_object/any_method.rb +305 -298
  10. data/lib/rdoc/code_object/attr.rb +150 -143
  11. data/lib/rdoc/code_object/class_module.rb +801 -765
  12. data/lib/rdoc/code_object/constant.rb +178 -150
  13. data/lib/rdoc/code_object/context/section.rb +133 -160
  14. data/lib/rdoc/code_object/context.rb +925 -952
  15. data/lib/rdoc/code_object/extend.rb +7 -5
  16. data/lib/rdoc/code_object/include.rb +7 -5
  17. data/lib/rdoc/code_object/method_attr.rb +325 -324
  18. data/lib/rdoc/code_object/mixin.rb +97 -95
  19. data/lib/rdoc/code_object/normal_class.rb +77 -78
  20. data/lib/rdoc/code_object/normal_module.rb +61 -59
  21. data/lib/rdoc/code_object/require.rb +23 -39
  22. data/lib/rdoc/code_object/single_class.rb +21 -19
  23. data/lib/rdoc/code_object/top_level.rb +212 -213
  24. data/lib/rdoc/code_object.rb +305 -305
  25. data/lib/rdoc/comment.rb +274 -337
  26. data/lib/rdoc/cross_reference.rb +194 -212
  27. data/lib/rdoc/encoding.rb +105 -103
  28. data/lib/rdoc/erb_partial.rb +13 -11
  29. data/lib/rdoc/erbio.rb +29 -27
  30. data/lib/rdoc/generator/aliki.rb +165 -140
  31. data/lib/rdoc/generator/darkfish.rb +647 -631
  32. data/lib/rdoc/generator/json_index.rb +233 -229
  33. data/lib/rdoc/generator/markup.rb +165 -122
  34. data/lib/rdoc/generator/pot/message_extractor.rb +57 -51
  35. data/lib/rdoc/generator/pot/po.rb +52 -51
  36. data/lib/rdoc/generator/pot/po_entry.rb +138 -132
  37. data/lib/rdoc/generator/pot.rb +85 -81
  38. data/lib/rdoc/generator/ri.rb +23 -19
  39. data/lib/rdoc/generator/template/aliki/DESIGN.md +538 -0
  40. data/lib/rdoc/generator/template/aliki/_aside_toc.rhtml +1 -1
  41. data/lib/rdoc/generator/template/aliki/_footer.rhtml +1 -1
  42. data/lib/rdoc/generator/template/aliki/_head.rhtml +11 -11
  43. data/lib/rdoc/generator/template/aliki/_header.rhtml +29 -44
  44. data/lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml +8 -6
  45. data/lib/rdoc/generator/template/aliki/_sidebar_includes.rhtml +8 -6
  46. data/lib/rdoc/generator/template/aliki/_sidebar_installed.rhtml +1 -1
  47. data/lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml +2 -2
  48. data/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +4 -4
  49. data/lib/rdoc/generator/template/aliki/_sidebar_sections.rhtml +1 -1
  50. data/lib/rdoc/generator/template/aliki/_sidebar_toggle.rhtml +1 -1
  51. data/lib/rdoc/generator/template/aliki/class.rhtml +56 -46
  52. data/lib/rdoc/generator/template/aliki/css/rdoc.css +538 -283
  53. data/lib/rdoc/generator/template/aliki/index.rhtml +1 -1
  54. data/lib/rdoc/generator/template/aliki/js/aliki.js +80 -102
  55. data/lib/rdoc/generator/template/aliki/page.rhtml +1 -1
  56. data/lib/rdoc/generator/template/aliki/servlet_not_found.rhtml +1 -1
  57. data/lib/rdoc/generator/template/aliki/servlet_root.rhtml +2 -2
  58. data/lib/rdoc/generator/template/darkfish/_footer.rhtml +1 -1
  59. data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +8 -6
  60. data/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +8 -6
  61. data/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +1 -1
  62. data/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +1 -1
  63. data/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +1 -1
  64. data/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +5 -5
  65. data/lib/rdoc/generator/template/darkfish/class.rhtml +18 -21
  66. data/lib/rdoc/generator/template/darkfish/css/rdoc.css +0 -1
  67. data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +3 -3
  68. data/lib/rdoc/generator.rb +48 -46
  69. data/lib/rdoc/i18n/locale.rb +99 -95
  70. data/lib/rdoc/i18n/text.rb +109 -105
  71. data/lib/rdoc/i18n.rb +7 -5
  72. data/lib/rdoc/markdown/byte_runtime.rb +80 -0
  73. data/lib/rdoc/markdown.kpeg +30 -21
  74. data/lib/rdoc/markdown.rb +329 -151
  75. data/lib/rdoc/markup/block_quote.rb +12 -8
  76. data/lib/rdoc/markup/document.rb +127 -123
  77. data/lib/rdoc/markup/formatter.rb +215 -221
  78. data/lib/rdoc/markup/heading.rb +1 -4
  79. data/lib/rdoc/markup/include.rb +33 -29
  80. data/lib/rdoc/markup/indented_paragraph.rb +37 -33
  81. data/lib/rdoc/markup/inline_parser.rb +281 -277
  82. data/lib/rdoc/markup/list.rb +80 -88
  83. data/lib/rdoc/markup/list_item.rb +73 -85
  84. data/lib/rdoc/markup/paragraph.rb +23 -19
  85. data/lib/rdoc/markup/parser.rb +501 -497
  86. data/lib/rdoc/markup/pre_process.rb +284 -305
  87. data/lib/rdoc/markup/raw.rb +2 -2
  88. data/lib/rdoc/markup/rule.rb +16 -12
  89. data/lib/rdoc/markup/to_ansi.rb +143 -139
  90. data/lib/rdoc/markup/to_bs.rb +72 -68
  91. data/lib/rdoc/markup/to_html.rb +600 -493
  92. data/lib/rdoc/markup/to_html_crossref.rb +221 -191
  93. data/lib/rdoc/markup/to_html_snippet.rb +232 -227
  94. data/lib/rdoc/markup/to_joined_paragraph.rb +40 -41
  95. data/lib/rdoc/markup/to_label.rb +63 -59
  96. data/lib/rdoc/markup/to_markdown.rb +212 -208
  97. data/lib/rdoc/markup/to_rdoc.rb +336 -332
  98. data/lib/rdoc/markup/to_table_of_contents.rb +66 -62
  99. data/lib/rdoc/markup/to_test.rb +60 -56
  100. data/lib/rdoc/markup/to_tt_only.rb +83 -86
  101. data/lib/rdoc/markup/verbatim.rb +62 -58
  102. data/lib/rdoc/markup.rb +198 -196
  103. data/lib/rdoc/options.rb +1063 -1076
  104. data/lib/rdoc/parser/c.rb +1039 -1036
  105. data/lib/rdoc/parser/changelog.rb +319 -315
  106. data/lib/rdoc/parser/markdown.rb +17 -13
  107. data/lib/rdoc/parser/rbs.rb +279 -0
  108. data/lib/rdoc/parser/rd.rb +17 -13
  109. data/lib/rdoc/parser/ruby.rb +1231 -2222
  110. data/lib/rdoc/parser/ruby_colorizer.rb +303 -0
  111. data/lib/rdoc/parser/simple.rb +31 -27
  112. data/lib/rdoc/parser/text.rb +12 -8
  113. data/lib/rdoc/parser.rb +230 -221
  114. data/lib/rdoc/rbs_helper.rb +186 -0
  115. data/lib/rdoc/rd/inline.rb +57 -53
  116. data/lib/rdoc/rd.rb +90 -88
  117. data/lib/rdoc/rdoc.rb +547 -366
  118. data/lib/rdoc/ri/driver.rb +1141 -1130
  119. data/lib/rdoc/ri/formatter.rb +7 -3
  120. data/lib/rdoc/ri/paths.rb +140 -136
  121. data/lib/rdoc/ri/servlet.rb +456 -0
  122. data/lib/rdoc/ri/store.rb +4 -2
  123. data/lib/rdoc/ri/task.rb +55 -51
  124. data/lib/rdoc/ri.rb +14 -11
  125. data/lib/rdoc/rubygems_hook.rb +194 -192
  126. data/lib/rdoc/server.rb +462 -0
  127. data/lib/rdoc/stats/normal.rb +46 -42
  128. data/lib/rdoc/stats/quiet.rb +39 -35
  129. data/lib/rdoc/stats/verbose.rb +35 -31
  130. data/lib/rdoc/stats.rb +363 -338
  131. data/lib/rdoc/store.rb +919 -725
  132. data/lib/rdoc/task.rb +260 -255
  133. data/lib/rdoc/text.rb +130 -245
  134. data/lib/rdoc/token_stream.rb +101 -115
  135. data/lib/rdoc/tom_doc.rb +203 -201
  136. data/lib/rdoc/version.rb +1 -1
  137. data/lib/rdoc.rb +35 -7
  138. data/lib/rubygems_plugin.rb +2 -11
  139. data/rdoc-logo.svg +43 -0
  140. data/rdoc.gemspec +6 -4
  141. metadata +36 -20
  142. data/lib/rdoc/code_object/anon_class.rb +0 -10
  143. data/lib/rdoc/code_object/ghost_method.rb +0 -6
  144. data/lib/rdoc/code_object/meta_method.rb +0 -6
  145. data/lib/rdoc/markdown/literals.kpeg +0 -21
  146. data/lib/rdoc/markdown/literals.rb +0 -454
  147. data/lib/rdoc/parser/prism_ruby.rb +0 -1112
  148. data/lib/rdoc/parser/ripper_state_lex.rb +0 -302
  149. data/lib/rdoc/parser/ruby_tools.rb +0 -163
  150. data/lib/rdoc/servlet.rb +0 -452
@@ -1,280 +1,279 @@
1
1
  # frozen_string_literal: true
2
- ##
3
- # A TopLevel context is a representation of the contents of a single file
2
+ module RDoc
3
+ ##
4
+ # A TopLevel context is a representation of the contents of a single file
4
5
 
5
- class RDoc::TopLevel < RDoc::Context
6
+ class TopLevel < Context
6
7
 
7
- MARSHAL_VERSION = 0 # :nodoc:
8
+ MARSHAL_VERSION = 0 # :nodoc:
8
9
 
9
- ##
10
- # Relative name of this file
10
+ ##
11
+ # Relative name of this file
11
12
 
12
- attr_accessor :relative_name
13
+ attr_accessor :relative_name
13
14
 
14
- ##
15
- # Absolute name of this file
15
+ ##
16
+ # Absolute name of this file
16
17
 
17
- attr_accessor :absolute_name
18
+ attr_accessor :absolute_name
18
19
 
19
- ##
20
- # Base name of this file
20
+ ##
21
+ # Base name of this file
21
22
 
22
- attr_reader :base_name
23
+ attr_reader :base_name
23
24
 
24
- ##
25
- # Base name of this file without the extension
25
+ ##
26
+ # Base name of this file without the extension
26
27
 
27
- attr_reader :page_name
28
+ attr_reader :page_name
28
29
 
29
- ##
30
- # All the classes or modules that were declared in
31
- # this file. These are assigned to either +#classes_hash+
32
- # or +#modules_hash+ once we know what they really are.
30
+ ##
31
+ # All the classes or modules that were declared in
32
+ # this file. These are assigned to either +#classes_hash+
33
+ # or +#modules_hash+ once we know what they really are.
33
34
 
34
- attr_reader :classes_or_modules
35
+ attr_reader :classes_or_modules
35
36
 
36
- ##
37
- # The parser class that processed this file
37
+ ##
38
+ # The parser class that processed this file
38
39
 
39
- attr_reader :parser
40
+ attr_accessor :parser
40
41
 
41
- ##
42
- # Creates a new TopLevel for the file at +absolute_name+. If documentation
43
- # is being generated outside the source dir +relative_name+ is relative to
44
- # the source directory.
45
-
46
- def initialize(absolute_name, relative_name = absolute_name)
47
- super()
48
- @name = nil
49
- @absolute_name = absolute_name
50
- @relative_name = relative_name
51
- @parser = nil
52
-
53
- if relative_name
54
- @base_name = File.basename(relative_name)
55
- @page_name = @base_name.sub(/\.(rb|rdoc|txt|md)\z/i, '')
56
- else
57
- @base_name = nil
58
- @page_name = nil
59
- end
42
+ ##
43
+ # Creates a new TopLevel for the file at +absolute_name+. If documentation
44
+ # is being generated outside the source dir +relative_name+ is relative to
45
+ # the source directory.
60
46
 
61
- @classes_or_modules = []
62
- end
47
+ def initialize(absolute_name, relative_name = absolute_name)
48
+ super()
49
+ @name = nil
50
+ @absolute_name = absolute_name
51
+ @relative_name = relative_name
52
+ @parser = nil
63
53
 
64
- ##
65
- # Sets the parser for this toplevel context, also the store.
54
+ if relative_name
55
+ @base_name = File.basename(relative_name)
56
+ @page_name = @base_name.sub(/\.(rb|rdoc|txt|md)\z/i, '')
57
+ else
58
+ @base_name = nil
59
+ @page_name = nil
60
+ end
66
61
 
67
- def parser=(val)
68
- @parser = val
69
- @store.update_parser_of_file(absolute_name, val) if @store
70
- @parser
71
- end
62
+ @classes_or_modules = []
63
+ end
72
64
 
73
- ##
74
- # An RDoc::TopLevel is equal to another with the same relative_name
65
+ ##
66
+ # An RDoc::TopLevel is equal to another with the same relative_name
75
67
 
76
- def ==(other)
77
- self.class === other and @relative_name == other.relative_name
78
- end
68
+ def ==(other)
69
+ self.class === other and @relative_name == other.relative_name
70
+ end
79
71
 
80
- alias eql? ==
72
+ alias eql? ==
81
73
 
82
- ##
83
- # Adds +an_alias+ to +Object+ instead of +self+.
74
+ ##
75
+ # Adds +an_alias+ to +Object+ instead of +self+.
84
76
 
85
- def add_alias(an_alias)
86
- object_class.record_location self
87
- return an_alias unless @document_self
88
- object_class.add_alias an_alias
89
- end
77
+ def add_alias(an_alias)
78
+ object_class.record_location self
79
+ return an_alias unless @document_self
80
+ object_class.add_alias an_alias
81
+ end
90
82
 
91
- ##
92
- # Adds +constant+ to +Object+ instead of +self+.
83
+ ##
84
+ # Adds +constant+ to +Object+ instead of +self+.
93
85
 
94
- def add_constant(constant)
95
- object_class.record_location self
96
- return constant unless @document_self
97
- object_class.add_constant constant
98
- end
86
+ def add_constant(constant)
87
+ object_class.record_location self
88
+ return constant unless @document_self
89
+ object_class.add_constant constant
90
+ end
99
91
 
100
- ##
101
- # Adds +include+ to +Object+ instead of +self+.
92
+ ##
93
+ # Adds +include+ to +Object+ instead of +self+.
102
94
 
103
- def add_include(include)
104
- object_class.record_location self
105
- return include unless @document_self
106
- object_class.add_include include
107
- end
95
+ def add_include(include)
96
+ object_class.record_location self
97
+ return include unless @document_self
98
+ object_class.add_include include
99
+ end
108
100
 
109
- ##
110
- # Adds +method+ to +Object+ instead of +self+.
101
+ ##
102
+ # Adds +method+ to +Object+ instead of +self+.
111
103
 
112
- def add_method(method)
113
- object_class.record_location self
114
- return method unless @document_self
115
- object_class.add_method method
116
- end
104
+ def add_method(method)
105
+ object_class.record_location self
106
+ return method unless @document_self
107
+ object_class.add_method method
108
+ end
117
109
 
118
- ##
119
- # Adds class or module +mod+. Used in the building phase
120
- # by the Ruby parser.
110
+ ##
111
+ # Adds class or module +mod+. Used in the building phase
112
+ # by the Ruby parser.
121
113
 
122
- def add_to_classes_or_modules(mod)
123
- @classes_or_modules << mod
124
- end
114
+ def add_to_classes_or_modules(mod)
115
+ @classes_or_modules << mod
116
+ end
125
117
 
126
- alias name base_name
118
+ alias name base_name
127
119
 
128
- ##
129
- # See RDoc::TopLevel::find_class_or_module
130
- #--
131
- # TODO Why do we search through all classes/modules found, not just the
132
- # ones of this instance?
120
+ ##
121
+ # See RDoc::TopLevel::find_class_or_module
122
+ #--
123
+ # TODO Why do we search through all classes/modules found, not just the
124
+ # ones of this instance?
133
125
 
134
- def find_class_or_module(name)
135
- @store.find_class_or_module name
136
- end
126
+ def find_class_or_module(name)
127
+ @store.find_class_or_module name
128
+ end
137
129
 
138
- ##
139
- # Finds a class or module named +symbol+
130
+ ##
131
+ # Finds a class or module named +symbol+
140
132
 
141
- def find_local_symbol(symbol)
142
- find_class_or_module(symbol) || super
143
- end
133
+ def find_local_symbol(symbol)
134
+ find_class_or_module(symbol) || super
135
+ end
144
136
 
145
- ##
146
- # Finds a module or class with +name+
137
+ ##
138
+ # Finds a module or class with +name+
147
139
 
148
- def find_module_named(name)
149
- find_class_or_module(name)
150
- end
140
+ def find_module_named(name)
141
+ find_class_or_module(name)
142
+ end
151
143
 
152
- alias get_module_named find_module_named
144
+ alias get_module_named find_module_named
153
145
 
154
- ##
155
- # Returns the relative name of this file
146
+ ##
147
+ # Returns the relative name of this file
156
148
 
157
- def full_name
158
- @relative_name
159
- end
149
+ def full_name
150
+ @relative_name
151
+ end
160
152
 
161
- ##
162
- # An RDoc::TopLevel has the same hash as another with the same
163
- # relative_name
153
+ ##
154
+ # An RDoc::TopLevel has the same hash as another with the same
155
+ # relative_name
164
156
 
165
- def hash
166
- @relative_name.hash
167
- end
157
+ def hash
158
+ @relative_name.hash
159
+ end
168
160
 
169
- ##
170
- # URL for this with a +prefix+
161
+ ##
162
+ # URL for this with a +prefix+
171
163
 
172
- def http_url
173
- @relative_name.tr('.', '_') + '.html'
174
- end
164
+ def http_url
165
+ @relative_name.tr('.', '_') + '.html'
166
+ end
175
167
 
176
- def inspect # :nodoc:
177
- "#<%s:0x%x %p modules: %p classes: %p>" % [
178
- self.class, object_id,
179
- base_name,
180
- @modules.map { |n, m| m },
181
- @classes.map { |n, c| c }
182
- ]
183
- end
168
+ def inspect # :nodoc:
169
+ "#<%s:0x%x %p modules: %p classes: %p>" % [
170
+ self.class, object_id,
171
+ base_name,
172
+ @modules.map { |n, m| m },
173
+ @classes.map { |n, c| c }
174
+ ]
175
+ end
184
176
 
185
- ##
186
- # Dumps this TopLevel for use by ri. See also #marshal_load
187
-
188
- def marshal_dump
189
- [
190
- MARSHAL_VERSION,
191
- @relative_name,
192
- @parser,
193
- parse(@comment),
194
- ]
195
- end
177
+ ##
178
+ # Dumps this TopLevel for use by ri. See also #marshal_load
196
179
 
197
- ##
198
- # Loads this TopLevel from +array+.
180
+ def marshal_dump
181
+ [
182
+ MARSHAL_VERSION,
183
+ @relative_name,
184
+ @parser,
185
+ parse(@comment),
186
+ ]
187
+ end
199
188
 
200
- def marshal_load(array) # :nodoc:
201
- initialize array[1]
189
+ ##
190
+ # Loads this TopLevel from +array+.
202
191
 
203
- @parser = array[2]
204
- @comment = RDoc::Comment.from_document array[3]
205
- end
192
+ def marshal_load(array) # :nodoc:
193
+ initialize array[1]
206
194
 
207
- ##
208
- # Returns the NormalClass "Object", creating it if not found.
209
- #
210
- # Records +self+ as a location in "Object".
211
-
212
- def object_class
213
- @object_class ||= begin
214
- oc = @store.find_class_named('Object') || add_class(RDoc::NormalClass, 'Object')
215
- oc.record_location self
216
- oc
195
+ @parser = array[2]
196
+ @comment = Comment.from_document array[3]
217
197
  end
218
- end
219
198
 
220
- ##
221
- # Path to this file for use with HTML generator output.
199
+ ##
200
+ # Returns the NormalClass "Object", creating it if not found.
201
+ #
202
+ # Records +self+ as a location in "Object".
203
+
204
+ def object_class
205
+ @object_class ||= begin
206
+ oc = @store.find_class_named('Object') || add_class(NormalClass, 'Object')
207
+ oc.record_location self
208
+ oc
209
+ end
210
+ end
222
211
 
223
- def path
224
- prefix = options.file_path_prefix
225
- return http_url unless prefix
226
- File.join(prefix, http_url)
227
- end
212
+ ##
213
+ # Path to this file for use with HTML generator output.
228
214
 
229
- def pretty_print(q) # :nodoc:
230
- q.group 2, "[#{self.class}: ", "]" do
231
- q.text "base name: #{base_name.inspect}"
232
- q.breakable
215
+ def path
216
+ base = if options.main_page == full_name
217
+ 'index.html'
218
+ else
219
+ http_url
220
+ end
233
221
 
234
- items = @modules.map { |n, m| m }
235
- items.concat @modules.map { |n, c| c }
236
- q.seplist items do |mod| q.pp mod end
222
+ prefix = options.file_path_prefix
223
+ return base unless prefix
224
+ File.join(prefix, base)
237
225
  end
238
- end
239
226
 
240
- ##
241
- # Search record used by RDoc::Generator::JsonIndex
242
- #
243
- # TODO: Remove this method after dropping the darkfish theme and JsonIndex generator.
244
- # Use #search_snippet instead for getting documentation snippets.
245
-
246
- def search_record
247
- return unless @parser < RDoc::Parser::Text
248
-
249
- [
250
- page_name,
251
- '',
252
- page_name,
253
- '',
254
- path,
255
- '',
256
- search_snippet,
257
- ]
258
- end
227
+ def pretty_print(q) # :nodoc:
228
+ q.group 2, "[#{self.class}: ", "]" do
229
+ q.text "base name: #{base_name.inspect}"
230
+ q.breakable
259
231
 
260
- ##
261
- # Returns an HTML snippet of the comment for search results.
232
+ items = @modules.map { |n, m| m }
233
+ items.concat @modules.map { |n, c| c }
234
+ q.seplist items do |mod| q.pp mod end
235
+ end
236
+ end
262
237
 
263
- def search_snippet
264
- return '' if @comment.empty?
238
+ ##
239
+ # Search record used by RDoc::Generator::JsonIndex
240
+ #
241
+ # TODO: Remove this method after dropping the darkfish theme and JsonIndex generator.
242
+ # Use #search_snippet instead for getting documentation snippets.
243
+
244
+ def search_record
245
+ return unless @parser < Parser::Text
246
+
247
+ [
248
+ page_name,
249
+ '',
250
+ page_name,
251
+ '',
252
+ path,
253
+ '',
254
+ search_snippet,
255
+ ]
256
+ end
265
257
 
266
- snippet(@comment)
267
- end
258
+ ##
259
+ # Returns an HTML snippet of the comment for search results.
268
260
 
269
- ##
270
- # Is this TopLevel from a text file instead of a source code file?
261
+ def search_snippet
262
+ return '' if @comment.empty?
271
263
 
272
- def text?
273
- @parser and @parser.include? RDoc::Parser::Text
274
- end
264
+ snippet(@comment)
265
+ end
275
266
 
276
- def to_s # :nodoc:
277
- "file #{full_name}"
278
- end
267
+ ##
268
+ # Is this TopLevel from a text file instead of a source code file?
279
269
 
270
+ def text?
271
+ @parser and @parser.include? Parser::Text
272
+ end
273
+
274
+ def to_s # :nodoc:
275
+ "file #{full_name}"
276
+ end
277
+
278
+ end
280
279
  end