rdoc 6.13.0 → 6.14.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.
- checksums.yaml +4 -4
- data/README.rdoc +3 -1
- data/lib/rdoc/code_object/any_method.rb +4 -4
- data/lib/rdoc/code_object/attr.rb +3 -3
- data/lib/rdoc/code_object/class_module.rb +18 -16
- data/lib/rdoc/code_object/constant.rb +5 -5
- data/lib/rdoc/code_object/context/section.rb +7 -7
- data/lib/rdoc/code_object/context.rb +19 -19
- data/lib/rdoc/code_object/method_attr.rb +6 -6
- data/lib/rdoc/code_object/mixin.rb +3 -3
- data/lib/rdoc/code_object/normal_class.rb +1 -1
- data/lib/rdoc/code_object/normal_module.rb +1 -1
- data/lib/rdoc/code_object/single_class.rb +1 -1
- data/lib/rdoc/code_object/top_level.rb +10 -8
- data/lib/rdoc/code_object.rb +3 -3
- data/lib/rdoc/comment.rb +6 -6
- data/lib/rdoc/cross_reference.rb +3 -3
- data/lib/rdoc/encoding.rb +4 -4
- data/lib/rdoc/erb_partial.rb +1 -1
- data/lib/rdoc/erbio.rb +2 -2
- data/lib/rdoc/generator/darkfish.rb +15 -15
- data/lib/rdoc/generator/json_index.rb +3 -3
- data/lib/rdoc/generator/markup.rb +12 -0
- data/lib/rdoc/generator/pot/message_extractor.rb +4 -4
- data/lib/rdoc/generator/pot/po.rb +1 -1
- data/lib/rdoc/generator/pot/po_entry.rb +7 -7
- data/lib/rdoc/generator/pot.rb +1 -1
- data/lib/rdoc/generator/ri.rb +1 -1
- data/lib/rdoc/generator/template/darkfish/_head.rhtml +5 -0
- data/lib/rdoc/generator/template/darkfish/css/rdoc.css +2 -0
- data/lib/rdoc/markup/attribute_manager.rb +5 -5
- data/lib/rdoc/markup/attributes.rb +3 -3
- data/lib/rdoc/markup/blank_line.rb +2 -2
- data/lib/rdoc/markup/block_quote.rb +1 -1
- data/lib/rdoc/markup/document.rb +8 -8
- data/lib/rdoc/markup/formatter.rb +12 -12
- data/lib/rdoc/markup/hard_break.rb +3 -3
- data/lib/rdoc/markup/heading.rb +4 -4
- data/lib/rdoc/markup/include.rb +3 -3
- data/lib/rdoc/markup/indented_paragraph.rb +3 -3
- data/lib/rdoc/markup/list.rb +4 -4
- data/lib/rdoc/markup/list_item.rb +4 -4
- data/lib/rdoc/markup/paragraph.rb +2 -2
- data/lib/rdoc/markup/parser.rb +11 -11
- data/lib/rdoc/markup/pre_process.rb +6 -6
- data/lib/rdoc/markup/raw.rb +5 -5
- data/lib/rdoc/markup/rule.rb +2 -2
- data/lib/rdoc/markup/table.rb +4 -4
- data/lib/rdoc/markup/to_ansi.rb +3 -3
- data/lib/rdoc/markup/to_bs.rb +6 -6
- data/lib/rdoc/markup/to_html.rb +21 -16
- data/lib/rdoc/markup/to_html_crossref.rb +5 -5
- data/lib/rdoc/markup/to_html_snippet.rb +17 -17
- data/lib/rdoc/markup/to_joined_paragraph.rb +1 -1
- data/lib/rdoc/markup/to_label.rb +5 -5
- data/lib/rdoc/markup/to_markdown.rb +12 -12
- data/lib/rdoc/markup/to_rdoc.rb +29 -28
- data/lib/rdoc/markup/to_table_of_contents.rb +3 -3
- data/lib/rdoc/markup/to_test.rb +1 -1
- data/lib/rdoc/markup/to_tt_only.rb +8 -8
- data/lib/rdoc/markup/verbatim.rb +3 -3
- data/lib/rdoc/markup.rb +3 -3
- data/lib/rdoc/options.rb +31 -12
- data/lib/rdoc/parser/c.rb +16 -16
- data/lib/rdoc/parser/changelog.rb +9 -9
- data/lib/rdoc/parser/prism_ruby.rb +1 -1
- data/lib/rdoc/parser/ruby.rb +43 -43
- data/lib/rdoc/parser/simple.rb +2 -2
- data/lib/rdoc/parser.rb +8 -8
- data/lib/rdoc/rd/inline.rb +4 -4
- data/lib/rdoc/rd.rb +1 -1
- data/lib/rdoc/rdoc.rb +8 -8
- data/lib/rdoc/ri/driver.rb +49 -49
- data/lib/rdoc/ri/paths.rb +2 -2
- data/lib/rdoc/ri/task.rb +1 -1
- data/lib/rdoc/rubygems_hook.rb +14 -11
- data/lib/rdoc/servlet.rb +15 -15
- data/lib/rdoc/stats/normal.rb +1 -1
- data/lib/rdoc/stats/quiet.rb +1 -1
- data/lib/rdoc/stats/verbose.rb +3 -3
- data/lib/rdoc/stats.rb +12 -12
- data/lib/rdoc/store.rb +30 -30
- data/lib/rdoc/task.rb +2 -2
- data/lib/rdoc/text.rb +11 -11
- data/lib/rdoc/token_stream.rb +1 -1
- data/lib/rdoc/tom_doc.rb +7 -7
- data/lib/rdoc/version.rb +1 -1
- data/man/ri.1 +2 -0
- metadata +17 -3
@@ -33,7 +33,7 @@ class RDoc::Markup::ToTableOfContents < RDoc::Markup::Formatter
|
|
33
33
|
##
|
34
34
|
# Adds +document+ to the output, using its heading cutoff if present
|
35
35
|
|
36
|
-
def accept_document
|
36
|
+
def accept_document(document)
|
37
37
|
@omit_headings_below = document.omit_headings_below
|
38
38
|
|
39
39
|
super
|
@@ -42,7 +42,7 @@ class RDoc::Markup::ToTableOfContents < RDoc::Markup::Formatter
|
|
42
42
|
##
|
43
43
|
# Adds +heading+ to the table of contents
|
44
44
|
|
45
|
-
def accept_heading
|
45
|
+
def accept_heading(heading)
|
46
46
|
@res << heading unless suppressed? heading
|
47
47
|
end
|
48
48
|
|
@@ -64,7 +64,7 @@ class RDoc::Markup::ToTableOfContents < RDoc::Markup::Formatter
|
|
64
64
|
##
|
65
65
|
# Returns true if +heading+ is below the display threshold
|
66
66
|
|
67
|
-
def suppressed?
|
67
|
+
def suppressed?(heading)
|
68
68
|
return false unless @omit_headings_below
|
69
69
|
|
70
70
|
heading.level > @omit_headings_below
|
data/lib/rdoc/markup/to_test.rb
CHANGED
@@ -18,7 +18,7 @@ class RDoc::Markup::ToTtOnly < RDoc::Markup::Formatter
|
|
18
18
|
##
|
19
19
|
# Creates a new tt-only formatter.
|
20
20
|
|
21
|
-
def initialize
|
21
|
+
def initialize(markup = nil)
|
22
22
|
super nil, markup
|
23
23
|
|
24
24
|
add_tag :TT, nil, nil
|
@@ -27,28 +27,28 @@ class RDoc::Markup::ToTtOnly < RDoc::Markup::Formatter
|
|
27
27
|
##
|
28
28
|
# Adds tts from +block_quote+ to the output
|
29
29
|
|
30
|
-
def accept_block_quote
|
30
|
+
def accept_block_quote(block_quote)
|
31
31
|
tt_sections block_quote.text
|
32
32
|
end
|
33
33
|
|
34
34
|
##
|
35
35
|
# Pops the list type for +list+ from #list_type
|
36
36
|
|
37
|
-
def accept_list_end
|
37
|
+
def accept_list_end(list)
|
38
38
|
@list_type.pop
|
39
39
|
end
|
40
40
|
|
41
41
|
##
|
42
42
|
# Pushes the list type for +list+ onto #list_type
|
43
43
|
|
44
|
-
def accept_list_start
|
44
|
+
def accept_list_start(list)
|
45
45
|
@list_type << list.type
|
46
46
|
end
|
47
47
|
|
48
48
|
##
|
49
49
|
# Prepares the visitor for consuming +list_item+
|
50
50
|
|
51
|
-
def accept_list_item_start
|
51
|
+
def accept_list_item_start(list_item)
|
52
52
|
case @list_type.last
|
53
53
|
when :NOTE, :LABEL then
|
54
54
|
Array(list_item.label).map do |label|
|
@@ -60,7 +60,7 @@ class RDoc::Markup::ToTtOnly < RDoc::Markup::Formatter
|
|
60
60
|
##
|
61
61
|
# Adds +paragraph+ to the output
|
62
62
|
|
63
|
-
def accept_paragraph
|
63
|
+
def accept_paragraph(paragraph)
|
64
64
|
tt_sections(paragraph.text)
|
65
65
|
end
|
66
66
|
|
@@ -68,7 +68,7 @@ class RDoc::Markup::ToTtOnly < RDoc::Markup::Formatter
|
|
68
68
|
# Does nothing to +markup_item+ because it doesn't have any user-built
|
69
69
|
# content
|
70
70
|
|
71
|
-
def do_nothing
|
71
|
+
def do_nothing(markup_item)
|
72
72
|
end
|
73
73
|
|
74
74
|
alias accept_blank_line do_nothing # :nodoc:
|
@@ -81,7 +81,7 @@ class RDoc::Markup::ToTtOnly < RDoc::Markup::Formatter
|
|
81
81
|
##
|
82
82
|
# Extracts tt sections from +text+
|
83
83
|
|
84
|
-
def tt_sections
|
84
|
+
def tt_sections(text)
|
85
85
|
flow = @am.flow text.dup
|
86
86
|
|
87
87
|
flow.each do |item|
|
data/lib/rdoc/markup/verbatim.rb
CHANGED
@@ -15,14 +15,14 @@ class RDoc::Markup::Verbatim < RDoc::Markup::Raw
|
|
15
15
|
@format = nil
|
16
16
|
end
|
17
17
|
|
18
|
-
def ==
|
18
|
+
def ==(other) # :nodoc:
|
19
19
|
super and @format == other.format
|
20
20
|
end
|
21
21
|
|
22
22
|
##
|
23
23
|
# Calls #accept_verbatim on +visitor+
|
24
24
|
|
25
|
-
def accept
|
25
|
+
def accept(visitor)
|
26
26
|
visitor.accept_verbatim self
|
27
27
|
end
|
28
28
|
|
@@ -50,7 +50,7 @@ class RDoc::Markup::Verbatim < RDoc::Markup::Raw
|
|
50
50
|
@parts = parts
|
51
51
|
end
|
52
52
|
|
53
|
-
def pretty_print
|
53
|
+
def pretty_print(q) # :nodoc:
|
54
54
|
self.class.name =~ /.*::(\w{1,4})/i
|
55
55
|
|
56
56
|
q.group 2, "[#{$1.downcase}: ", ']' do
|
data/lib/rdoc/markup.rb
CHANGED
@@ -118,7 +118,7 @@ class RDoc::Markup
|
|
118
118
|
##
|
119
119
|
# Parses +str+ into an RDoc::Markup::Document.
|
120
120
|
|
121
|
-
def self.parse
|
121
|
+
def self.parse(str)
|
122
122
|
RDoc::Markup::Parser.parse str
|
123
123
|
rescue RDoc::Markup::Parser::Error => e
|
124
124
|
$stderr.puts <<-EOF
|
@@ -148,7 +148,7 @@ https://github.com/ruby/rdoc/issues
|
|
148
148
|
# structure (paragraphs, lists, and so on). Invoke an event handler as we
|
149
149
|
# identify significant chunks.
|
150
150
|
|
151
|
-
def initialize
|
151
|
+
def initialize(attribute_manager = nil)
|
152
152
|
@attribute_manager = attribute_manager || RDoc::Markup::AttributeManager.new
|
153
153
|
@output = nil
|
154
154
|
end
|
@@ -185,7 +185,7 @@ https://github.com/ruby/rdoc/issues
|
|
185
185
|
# We take +input+, parse it if necessary, then invoke the output +formatter+
|
186
186
|
# using a Visitor to render the result.
|
187
187
|
|
188
|
-
def convert
|
188
|
+
def convert(input, formatter)
|
189
189
|
document = case input
|
190
190
|
when RDoc::Markup::Document then
|
191
191
|
input
|
data/lib/rdoc/options.rb
CHANGED
@@ -363,7 +363,22 @@ class RDoc::Options
|
|
363
363
|
# Words to be ignored in autolink cross-references
|
364
364
|
attr_accessor :autolink_excluded_words
|
365
365
|
|
366
|
-
|
366
|
+
##
|
367
|
+
# The prefix to use for class and module page paths
|
368
|
+
|
369
|
+
attr_accessor :class_module_path_prefix
|
370
|
+
|
371
|
+
##
|
372
|
+
# The prefix to use for file page paths
|
373
|
+
|
374
|
+
attr_accessor :file_path_prefix
|
375
|
+
|
376
|
+
##
|
377
|
+
# The preferred root URL for the documentation
|
378
|
+
|
379
|
+
attr_accessor :canonical_root
|
380
|
+
|
381
|
+
def initialize(loaded_options = nil) # :nodoc:
|
367
382
|
init_ivars
|
368
383
|
override loaded_options if loaded_options
|
369
384
|
end
|
@@ -417,9 +432,12 @@ class RDoc::Options
|
|
417
432
|
@charset = @encoding.name
|
418
433
|
@skip_tests = true
|
419
434
|
@apply_default_exclude = true
|
435
|
+
@class_module_path_prefix = nil
|
436
|
+
@file_path_prefix = nil
|
437
|
+
@canonical_root = nil
|
420
438
|
end
|
421
439
|
|
422
|
-
def init_with
|
440
|
+
def init_with(map) # :nodoc:
|
423
441
|
init_ivars
|
424
442
|
|
425
443
|
encoding = map['encoding']
|
@@ -450,11 +468,11 @@ class RDoc::Options
|
|
450
468
|
@static_path = sanitize_path map['static_path']
|
451
469
|
end
|
452
470
|
|
453
|
-
def yaml_initialize
|
471
|
+
def yaml_initialize(tag, map) # :nodoc:
|
454
472
|
init_with map
|
455
473
|
end
|
456
474
|
|
457
|
-
def override
|
475
|
+
def override(map) # :nodoc:
|
458
476
|
if map.has_key?('encoding')
|
459
477
|
encoding = map['encoding']
|
460
478
|
@encoding = encoding ? Encoding.find(encoding) : encoding
|
@@ -480,6 +498,7 @@ class RDoc::Options
|
|
480
498
|
@webcvs = map['webcvs'] if map.has_key?('webcvs')
|
481
499
|
@autolink_excluded_words = map['autolink_excluded_words'] if map.has_key?('autolink_excluded_words')
|
482
500
|
@apply_default_exclude = map['apply_default_exclude'] if map.has_key?('apply_default_exclude')
|
501
|
+
@canonical_root = map['canonical_root'] if map.has_key?('canonical_root')
|
483
502
|
|
484
503
|
@warn_missing_rdoc_ref = map['warn_missing_rdoc_ref'] if map.has_key?('warn_missing_rdoc_ref')
|
485
504
|
|
@@ -491,7 +510,7 @@ class RDoc::Options
|
|
491
510
|
end
|
492
511
|
end
|
493
512
|
|
494
|
-
def ==
|
513
|
+
def ==(other) # :nodoc:
|
495
514
|
self.class === other and
|
496
515
|
@encoding == other.encoding and
|
497
516
|
@embed_mixins == other.embed_mixins and
|
@@ -683,7 +702,7 @@ class RDoc::Options
|
|
683
702
|
##
|
684
703
|
# Parses command line options.
|
685
704
|
|
686
|
-
def parse
|
705
|
+
def parse(argv)
|
687
706
|
ignore_invalid = true
|
688
707
|
|
689
708
|
argv.insert(0, *ENV['RDOCOPT'].split) if ENV['RDOCOPT']
|
@@ -1262,14 +1281,14 @@ Usage: #{opt.program_name} [options] [names...]
|
|
1262
1281
|
##
|
1263
1282
|
# Set quietness to +bool+
|
1264
1283
|
|
1265
|
-
def quiet=
|
1284
|
+
def quiet=(bool)
|
1266
1285
|
@verbosity = bool ? 0 : 1
|
1267
1286
|
end
|
1268
1287
|
|
1269
1288
|
##
|
1270
1289
|
# Removes directories from +path+ that are outside the current directory
|
1271
1290
|
|
1272
|
-
def sanitize_path
|
1291
|
+
def sanitize_path(path)
|
1273
1292
|
require 'pathname'
|
1274
1293
|
dot = Pathname.new('.').expand_path
|
1275
1294
|
|
@@ -1296,7 +1315,7 @@ Usage: #{opt.program_name} [options] [names...]
|
|
1296
1315
|
# the options instance. This allows generators to add custom options or set
|
1297
1316
|
# default options.
|
1298
1317
|
|
1299
|
-
def setup_generator
|
1318
|
+
def setup_generator(generator_name = @generator_name)
|
1300
1319
|
@generator = @generators[generator_name]
|
1301
1320
|
|
1302
1321
|
unless @generator then
|
@@ -1318,7 +1337,7 @@ Usage: #{opt.program_name} [options] [names...]
|
|
1318
1337
|
##
|
1319
1338
|
# Finds the template dir for +template+
|
1320
1339
|
|
1321
|
-
def template_dir_for
|
1340
|
+
def template_dir_for(template)
|
1322
1341
|
template_path = File.join 'rdoc', 'generator', 'template', template
|
1323
1342
|
|
1324
1343
|
$LOAD_PATH.map do |path|
|
@@ -1335,7 +1354,7 @@ Usage: #{opt.program_name} [options] [names...]
|
|
1335
1354
|
# When +:all+ is passed, visibility is set to +:private+, similarly to
|
1336
1355
|
# RDOCOPT="--all", see #visibility for more information.
|
1337
1356
|
|
1338
|
-
def visibility=
|
1357
|
+
def visibility=(visibility)
|
1339
1358
|
case visibility
|
1340
1359
|
when :all
|
1341
1360
|
@visibility = :private
|
@@ -1347,7 +1366,7 @@ Usage: #{opt.program_name} [options] [names...]
|
|
1347
1366
|
##
|
1348
1367
|
# Displays a warning using Kernel#warn if we're being verbose
|
1349
1368
|
|
1350
|
-
def warn
|
1369
|
+
def warn(message)
|
1351
1370
|
super message if @verbosity > 1
|
1352
1371
|
end
|
1353
1372
|
|
data/lib/rdoc/parser/c.rb
CHANGED
@@ -168,7 +168,7 @@ class RDoc::Parser::C < RDoc::Parser
|
|
168
168
|
# Prepares for parsing a C file. See RDoc::Parser#initialize for details on
|
169
169
|
# the arguments.
|
170
170
|
|
171
|
-
def initialize
|
171
|
+
def initialize(top_level, content, options, stats)
|
172
172
|
super
|
173
173
|
|
174
174
|
@known_classes = RDoc::KNOWN_CLASSES.dup
|
@@ -193,7 +193,7 @@ class RDoc::Parser::C < RDoc::Parser
|
|
193
193
|
|
194
194
|
@enclosure_dependencies.extend TSort
|
195
195
|
|
196
|
-
def @enclosure_dependencies.tsort_each_node
|
196
|
+
def @enclosure_dependencies.tsort_each_node(&block)
|
197
197
|
each_key(&block)
|
198
198
|
rescue TSort::Cyclic => e
|
199
199
|
cycle_vars = e.message.scan(/"(.*?)"/).flatten
|
@@ -211,7 +211,7 @@ class RDoc::Parser::C < RDoc::Parser
|
|
211
211
|
retry
|
212
212
|
end
|
213
213
|
|
214
|
-
def @enclosure_dependencies.tsort_each_child
|
214
|
+
def @enclosure_dependencies.tsort_each_child(node, &block)
|
215
215
|
fetch(node, []).each(&block)
|
216
216
|
end
|
217
217
|
end
|
@@ -519,7 +519,7 @@ class RDoc::Parser::C < RDoc::Parser
|
|
519
519
|
# Finds the comment for an alias on +class_name+ from +new_name+ to
|
520
520
|
# +old_name+
|
521
521
|
|
522
|
-
def find_alias_comment
|
522
|
+
def find_alias_comment(class_name, new_name, old_name)
|
523
523
|
content =~ %r%((?>/\*.*?\*/\s+))
|
524
524
|
rb_define_alias\(\s*#{Regexp.escape class_name}\s*,
|
525
525
|
\s*"#{Regexp.escape new_name}"\s*,
|
@@ -537,7 +537,7 @@ class RDoc::Parser::C < RDoc::Parser
|
|
537
537
|
# +read+ and +write+ are the read/write flags ('1' or '0'). Either both or
|
538
538
|
# neither must be provided.
|
539
539
|
|
540
|
-
def find_attr_comment
|
540
|
+
def find_attr_comment(var_name, attr_name, read = nil, write = nil)
|
541
541
|
attr_name = Regexp.escape attr_name
|
542
542
|
|
543
543
|
rw = if read and write then
|
@@ -570,7 +570,7 @@ class RDoc::Parser::C < RDoc::Parser
|
|
570
570
|
##
|
571
571
|
# Generate a Ruby-method table
|
572
572
|
|
573
|
-
def gen_body_table
|
573
|
+
def gen_body_table(file_content)
|
574
574
|
table = {}
|
575
575
|
file_content.scan(%r{
|
576
576
|
((?>/\*.*?\*/\s*)?)
|
@@ -594,7 +594,7 @@ class RDoc::Parser::C < RDoc::Parser
|
|
594
594
|
##
|
595
595
|
# Find the C code corresponding to a Ruby method
|
596
596
|
|
597
|
-
def find_body
|
597
|
+
def find_body(class_name, meth_name, meth_obj, file_content, quiet = false)
|
598
598
|
if file_content
|
599
599
|
@body_table ||= {}
|
600
600
|
@body_table[file_content] ||= gen_body_table file_content
|
@@ -719,7 +719,7 @@ class RDoc::Parser::C < RDoc::Parser
|
|
719
719
|
# */
|
720
720
|
# VALUE cFoo = rb_define_class("Foo", rb_cObject);
|
721
721
|
|
722
|
-
def find_class_comment
|
722
|
+
def find_class_comment(class_name, class_mod)
|
723
723
|
comment = nil
|
724
724
|
|
725
725
|
if @content =~ %r%
|
@@ -752,7 +752,7 @@ class RDoc::Parser::C < RDoc::Parser
|
|
752
752
|
##
|
753
753
|
# Generate a const table
|
754
754
|
|
755
|
-
def gen_const_table
|
755
|
+
def gen_const_table(file_content)
|
756
756
|
table = {}
|
757
757
|
@content.scan(%r{
|
758
758
|
(?<doc>(?>^\s*/\*.*?\*/\s+))
|
@@ -806,7 +806,7 @@ class RDoc::Parser::C < RDoc::Parser
|
|
806
806
|
##
|
807
807
|
# Handles modifiers in +comment+ and updates +meth_obj+ as appropriate.
|
808
808
|
|
809
|
-
def find_modifiers
|
809
|
+
def find_modifiers(comment, meth_obj)
|
810
810
|
comment.normalize
|
811
811
|
meth_obj.call_seq = comment.extract_call_seq
|
812
812
|
|
@@ -816,7 +816,7 @@ class RDoc::Parser::C < RDoc::Parser
|
|
816
816
|
##
|
817
817
|
# Finds a <tt>Document-method</tt> override for +meth_obj+ on +class_name+
|
818
818
|
|
819
|
-
def find_override_comment
|
819
|
+
def find_override_comment(class_name, meth_obj)
|
820
820
|
name = Regexp.escape meth_obj.name
|
821
821
|
prefix = Regexp.escape meth_obj.name_prefix
|
822
822
|
|
@@ -1060,7 +1060,7 @@ class RDoc::Parser::C < RDoc::Parser
|
|
1060
1060
|
##
|
1061
1061
|
# Registers a singleton class +sclass_var+ as a singleton of +class_var+
|
1062
1062
|
|
1063
|
-
def handle_singleton
|
1063
|
+
def handle_singleton(sclass_var, class_var)
|
1064
1064
|
class_name = @known_classes[class_var]
|
1065
1065
|
|
1066
1066
|
@known_classes[sclass_var] = class_name
|
@@ -1071,7 +1071,7 @@ class RDoc::Parser::C < RDoc::Parser
|
|
1071
1071
|
# Loads the variable map with the given +name+ from the RDoc::Store, if
|
1072
1072
|
# present.
|
1073
1073
|
|
1074
|
-
def load_variable_map
|
1074
|
+
def load_variable_map(map_name)
|
1075
1075
|
return {} unless files = @store.cache[map_name]
|
1076
1076
|
return {} unless name_map = files[@file_name]
|
1077
1077
|
|
@@ -1101,7 +1101,7 @@ class RDoc::Parser::C < RDoc::Parser
|
|
1101
1101
|
# This method modifies the +comment+
|
1102
1102
|
# Both :main: and :title: directives are deprecated and will be removed in RDoc 7.
|
1103
1103
|
|
1104
|
-
def look_for_directives_in
|
1104
|
+
def look_for_directives_in(context, comment)
|
1105
1105
|
@preprocess.handle comment, context do |directive, param|
|
1106
1106
|
case directive
|
1107
1107
|
when 'main' then
|
@@ -1138,7 +1138,7 @@ class RDoc::Parser::C < RDoc::Parser
|
|
1138
1138
|
# Extracts parameters from the +method_body+ and returns a method
|
1139
1139
|
# parameter string. Follows 1.9.3dev's scan-arg-spec, see README.EXT
|
1140
1140
|
|
1141
|
-
def rb_scan_args
|
1141
|
+
def rb_scan_args(method_body)
|
1142
1142
|
method_body =~ /rb_scan_args\((.*?)\)/m
|
1143
1143
|
return '(*args)' unless $1
|
1144
1144
|
|
@@ -1249,7 +1249,7 @@ class RDoc::Parser::C < RDoc::Parser
|
|
1249
1249
|
##
|
1250
1250
|
# Creates a RDoc::Comment instance.
|
1251
1251
|
|
1252
|
-
def new_comment
|
1252
|
+
def new_comment(text = nil, location = nil, language = nil)
|
1253
1253
|
RDoc::Comment.new(text, location, language).tap do |comment|
|
1254
1254
|
comment.format = @markup
|
1255
1255
|
end
|
@@ -23,7 +23,7 @@ class RDoc::Parser::ChangeLog < RDoc::Parser
|
|
23
23
|
# Continued function listings are joined together as a single entry.
|
24
24
|
# Continued descriptions are joined to make a single paragraph.
|
25
25
|
|
26
|
-
def continue_entry_body
|
26
|
+
def continue_entry_body(entry_body, continuation)
|
27
27
|
return unless last = entry_body.last
|
28
28
|
|
29
29
|
if last =~ /\)\s*\z/ and continuation =~ /\A\(/ then
|
@@ -41,7 +41,7 @@ class RDoc::Parser::ChangeLog < RDoc::Parser
|
|
41
41
|
##
|
42
42
|
# Creates an RDoc::Markup::Document given the +groups+ of ChangeLog entries.
|
43
43
|
|
44
|
-
def create_document
|
44
|
+
def create_document(groups)
|
45
45
|
doc = RDoc::Markup::Document.new
|
46
46
|
doc.omit_headings_below = 2
|
47
47
|
doc.file = @top_level
|
@@ -63,7 +63,7 @@ class RDoc::Parser::ChangeLog < RDoc::Parser
|
|
63
63
|
# Returns a list of ChangeLog entries an RDoc::Markup nodes for the given
|
64
64
|
# +entries+.
|
65
65
|
|
66
|
-
def create_entries
|
66
|
+
def create_entries(entries)
|
67
67
|
out = []
|
68
68
|
|
69
69
|
entries.each do |entry, items|
|
@@ -80,7 +80,7 @@ class RDoc::Parser::ChangeLog < RDoc::Parser
|
|
80
80
|
# Returns an RDoc::Markup::List containing the given +items+ in the
|
81
81
|
# ChangeLog
|
82
82
|
|
83
|
-
def create_items
|
83
|
+
def create_items(items)
|
84
84
|
list = RDoc::Markup::List.new :NOTE
|
85
85
|
|
86
86
|
items.each do |item|
|
@@ -100,7 +100,7 @@ class RDoc::Parser::ChangeLog < RDoc::Parser
|
|
100
100
|
##
|
101
101
|
# Groups +entries+ by date.
|
102
102
|
|
103
|
-
def group_entries
|
103
|
+
def group_entries(entries)
|
104
104
|
@time_cache ||= {}
|
105
105
|
entries.group_by do |title, _|
|
106
106
|
begin
|
@@ -260,7 +260,7 @@ class RDoc::Parser::ChangeLog < RDoc::Parser
|
|
260
260
|
# RDoc::Parser::ChangeLog::Git::LogEntry list for the given
|
261
261
|
# +entries+.
|
262
262
|
|
263
|
-
def create_entries
|
263
|
+
def create_entries(entries)
|
264
264
|
# git log entries have no strictly itemized style like the old
|
265
265
|
# style, just assume Markdown.
|
266
266
|
entries.map do |commit, entry|
|
@@ -296,7 +296,7 @@ class RDoc::Parser::ChangeLog < RDoc::Parser
|
|
296
296
|
"label-#{commit}"
|
297
297
|
end
|
298
298
|
|
299
|
-
def label
|
299
|
+
def label(context = nil)
|
300
300
|
aref
|
301
301
|
end
|
302
302
|
|
@@ -311,7 +311,7 @@ class RDoc::Parser::ChangeLog < RDoc::Parser
|
|
311
311
|
end + " {#{author}}[mailto:#{email}]"
|
312
312
|
end
|
313
313
|
|
314
|
-
def accept
|
314
|
+
def accept(visitor)
|
315
315
|
visitor.accept_heading self
|
316
316
|
begin
|
317
317
|
if visitor.respond_to?(:code_object=)
|
@@ -328,7 +328,7 @@ class RDoc::Parser::ChangeLog < RDoc::Parser
|
|
328
328
|
end
|
329
329
|
end
|
330
330
|
|
331
|
-
def pretty_print
|
331
|
+
def pretty_print(q) # :nodoc:
|
332
332
|
q.group(2, '[log_entry: ', ']') do
|
333
333
|
q.text commit
|
334
334
|
q.text ','
|
@@ -77,7 +77,7 @@ class RDoc::Parser::PrismRuby < RDoc::Parser
|
|
77
77
|
# Records the location of this +container+ in the file for this parser and
|
78
78
|
# adds it to the list of classes and modules in the file.
|
79
79
|
|
80
|
-
def record_location
|
80
|
+
def record_location(container) # :nodoc:
|
81
81
|
case container
|
82
82
|
when RDoc::ClassModule then
|
83
83
|
@top_level.add_to_classes_or_modules container
|