rdoc 6.6.3.1 → 6.7.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/CONTRIBUTING.rdoc +1 -1
- data/lib/rdoc/context.rb +1 -1
- data/lib/rdoc/markdown.kpeg +2 -2
- data/lib/rdoc/markdown.rb +4 -4
- data/lib/rdoc/markup/to_bs.rb +25 -0
- data/lib/rdoc/markup/to_html_crossref.rb +12 -13
- data/lib/rdoc/markup/to_markdown.rb +4 -4
- data/lib/rdoc/markup/to_rdoc.rb +11 -3
- data/lib/rdoc/options.rb +1 -0
- data/lib/rdoc/parser/c.rb +18 -8
- data/lib/rdoc/parser/ruby.rb +11 -2
- data/lib/rdoc/parser.rb +4 -2
- data/lib/rdoc/rd/block_parser.rb +2 -6
- data/lib/rdoc/rd/inline_parser.rb +2 -6
- data/lib/rdoc/ri/driver.rb +1 -1
- data/lib/rdoc/version.rb +1 -1
- data/lib/rdoc.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b5120e82f653957d49d069e88f361f338a2db7f40bdc0756ffcea7d3bd3c4f2
|
4
|
+
data.tar.gz: a0f09a9246684a22992f2deff120c238b24fbe59a20dfdfa87b340fecc9ce297
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0391b650362cb28f505eaf1d258b259debc4d828ad98643e3a27c1a16811d2bf126b40dd3f9872f4d50536e6875a4691e52c4e6d3732850150710866baf0f69
|
7
|
+
data.tar.gz: c8a40bfeedd964ce6b42781c1ee6c93dda1917a3333b79ebe8b886cd26a8fe49b32522a156c39c99811134fa8bd60612aface400f06641bea155d07a9de6ec2a
|
data/CONTRIBUTING.rdoc
CHANGED
@@ -40,7 +40,7 @@ If the tests don't pass on the first run check the {GitHub Actions page}[https:/
|
|
40
40
|
You can now use `rake` and `autotest` to run the tests.
|
41
41
|
|
42
42
|
Note: the `rake` command must be used first before running any tests, because
|
43
|
-
|
43
|
+
it's used to generate various parsers implemented in RDoc. Also `rake clean` is
|
44
44
|
helpful to delete these generated files.
|
45
45
|
|
46
46
|
== Glossary
|
data/lib/rdoc/context.rb
CHANGED
data/lib/rdoc/markdown.kpeg
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
# RDoc::Markdown as described by the [markdown syntax][syntax].
|
10
10
|
#
|
11
11
|
# To choose Markdown as your only default format see
|
12
|
-
# RDoc::Options@Saved+Options for instructions on setting up a `.
|
12
|
+
# RDoc::Options@Saved+Options for instructions on setting up a `.rdoc_options`
|
13
13
|
# file to store your project default.
|
14
14
|
#
|
15
15
|
# ## Usage
|
@@ -1237,7 +1237,7 @@ DefinitionListItem = ( DefinitionListLabel+ ):label
|
|
1237
1237
|
list_items
|
1238
1238
|
}
|
1239
1239
|
|
1240
|
-
DefinitionListLabel =
|
1240
|
+
DefinitionListLabel = Inline:label @Sp @Newline
|
1241
1241
|
{ label }
|
1242
1242
|
|
1243
1243
|
DefinitionListDefinition = @NonindentSpace ":" @Space Inlines:a @BlankLine+
|
data/lib/rdoc/markdown.rb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
# RDoc::Markdown as described by the [markdown syntax][syntax].
|
7
7
|
#
|
8
8
|
# To choose Markdown as your only default format see
|
9
|
-
# RDoc::Options@Saved+Options for instructions on setting up a `.
|
9
|
+
# RDoc::Options@Saved+Options for instructions on setting up a `.rdoc_options`
|
10
10
|
# file to store your project default.
|
11
11
|
#
|
12
12
|
# ## Usage
|
@@ -16445,12 +16445,12 @@ class RDoc::Markdown
|
|
16445
16445
|
return _tmp
|
16446
16446
|
end
|
16447
16447
|
|
16448
|
-
# DefinitionListLabel =
|
16448
|
+
# DefinitionListLabel = Inline:label @Sp @Newline { label }
|
16449
16449
|
def _DefinitionListLabel
|
16450
16450
|
|
16451
16451
|
_save = self.pos
|
16452
16452
|
while true # sequence
|
16453
|
-
_tmp = apply(:
|
16453
|
+
_tmp = apply(:_Inline)
|
16454
16454
|
label = @result
|
16455
16455
|
unless _tmp
|
16456
16456
|
self.pos = _save
|
@@ -16777,7 +16777,7 @@ class RDoc::Markdown
|
|
16777
16777
|
Rules[:_TableAlign] = rule_info("TableAlign", "< /:?-+:?/ > @Sp { text.start_with?(\":\") ? (text.end_with?(\":\") ? :center : :left) : (text.end_with?(\":\") ? :right : nil) }")
|
16778
16778
|
Rules[:_DefinitionList] = rule_info("DefinitionList", "&{ definition_lists? } DefinitionListItem+:list { RDoc::Markup::List.new :NOTE, *list.flatten }")
|
16779
16779
|
Rules[:_DefinitionListItem] = rule_info("DefinitionListItem", "DefinitionListLabel+:label DefinitionListDefinition+:defns { list_items = [] list_items << RDoc::Markup::ListItem.new(label, defns.shift) list_items.concat defns.map { |defn| RDoc::Markup::ListItem.new nil, defn } unless list_items.empty? list_items }")
|
16780
|
-
Rules[:_DefinitionListLabel] = rule_info("DefinitionListLabel", "
|
16780
|
+
Rules[:_DefinitionListLabel] = rule_info("DefinitionListLabel", "Inline:label @Sp @Newline { label }")
|
16781
16781
|
Rules[:_DefinitionListDefinition] = rule_info("DefinitionListDefinition", "@NonindentSpace \":\" @Space Inlines:a @BlankLine+ { paragraph a }")
|
16782
16782
|
# :startdoc:
|
16783
16783
|
end
|
data/lib/rdoc/markup/to_bs.rb
CHANGED
@@ -40,6 +40,31 @@ class RDoc::Markup::ToBs < RDoc::Markup::ToRdoc
|
|
40
40
|
@res << "\n"
|
41
41
|
end
|
42
42
|
|
43
|
+
##
|
44
|
+
# Prepares the visitor for consuming +list_item+
|
45
|
+
|
46
|
+
def accept_list_item_start list_item
|
47
|
+
type = @list_type.last
|
48
|
+
|
49
|
+
case type
|
50
|
+
when :NOTE, :LABEL then
|
51
|
+
bullets = Array(list_item.label).map do |label|
|
52
|
+
attributes(label).strip
|
53
|
+
end.join "\n"
|
54
|
+
|
55
|
+
bullets << ":\n" unless bullets.empty?
|
56
|
+
|
57
|
+
@prefix = ' ' * @indent
|
58
|
+
@indent += 2
|
59
|
+
@prefix << bullets + (' ' * @indent)
|
60
|
+
else
|
61
|
+
bullet = type == :BULLET ? '*' : @list_index.last.to_s + '.'
|
62
|
+
@prefix = (' ' * @indent) + bullet.ljust(bullet.length + 1)
|
63
|
+
width = bullet.length + 1
|
64
|
+
@indent += width
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
43
68
|
##
|
44
69
|
# Turns on or off regexp handling for +convert_string+
|
45
70
|
|
@@ -63,8 +63,8 @@ class RDoc::Markup::ToHtmlCrossref < RDoc::Markup::ToHtml
|
|
63
63
|
|
64
64
|
name = name[1..-1] unless @show_hash if name[0, 1] == '#'
|
65
65
|
|
66
|
-
if !(name.end_with?('+@', '-@')) and name =~ /(.*[^#:])
|
67
|
-
text ||=
|
66
|
+
if !(name.end_with?('+@', '-@')) and name =~ /(.*[^#:])?@/
|
67
|
+
text ||= [CGI.unescape($'), (" at <code>#{$1}</code>" if $~.begin(1))].join("")
|
68
68
|
code = false
|
69
69
|
else
|
70
70
|
text ||= name
|
@@ -139,35 +139,34 @@ class RDoc::Markup::ToHtmlCrossref < RDoc::Markup::ToHtml
|
|
139
139
|
# Creates an HTML link to +name+ with the given +text+.
|
140
140
|
|
141
141
|
def link name, text, code = true
|
142
|
-
if !(name.end_with?('+@', '-@')) and name =~ /(.*[^#:])
|
142
|
+
if !(name.end_with?('+@', '-@')) and name =~ /(.*[^#:])?@/
|
143
143
|
name = $1
|
144
144
|
label = $'
|
145
145
|
end
|
146
146
|
|
147
|
-
ref = @cross_reference.resolve name, text
|
147
|
+
ref = @cross_reference.resolve name, text if name
|
148
148
|
|
149
149
|
case ref
|
150
150
|
when String then
|
151
151
|
ref
|
152
152
|
else
|
153
|
-
path = ref.as_href
|
153
|
+
path = ref ? ref.as_href(@from_path) : +""
|
154
154
|
|
155
155
|
if code and RDoc::CodeObject === ref and !(RDoc::TopLevel === ref)
|
156
156
|
text = "<code>#{CGI.escapeHTML text}</code>"
|
157
157
|
end
|
158
158
|
|
159
|
-
if
|
160
|
-
path
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
if ref.respond_to?(:aref)
|
159
|
+
if label
|
160
|
+
if path =~ /#/
|
161
|
+
path << "-label-#{label}"
|
162
|
+
elsif ref&.sections&.any? { |section| label == section.title }
|
163
|
+
path << "##{label}"
|
164
|
+
elsif ref.respond_to?(:aref)
|
166
165
|
path << "##{ref.aref}-label-#{label}"
|
167
166
|
else
|
168
167
|
path << "#label-#{label}"
|
169
168
|
end
|
170
|
-
end
|
169
|
+
end
|
171
170
|
|
172
171
|
"<a href=\"#{path}\">#{text}</a>"
|
173
172
|
end
|
@@ -45,8 +45,6 @@ class RDoc::Markup::ToMarkdown < RDoc::Markup::ToRdoc
|
|
45
45
|
# Finishes consumption of `list`
|
46
46
|
|
47
47
|
def accept_list_end list
|
48
|
-
@res << "\n"
|
49
|
-
|
50
48
|
super
|
51
49
|
end
|
52
50
|
|
@@ -60,6 +58,8 @@ class RDoc::Markup::ToMarkdown < RDoc::Markup::ToRdoc
|
|
60
58
|
when :NOTE, :LABEL then
|
61
59
|
use_prefix
|
62
60
|
|
61
|
+
@res << "\n"
|
62
|
+
|
63
63
|
4
|
64
64
|
else
|
65
65
|
@list_index[-1] = @list_index.last.succ
|
@@ -81,11 +81,11 @@ class RDoc::Markup::ToMarkdown < RDoc::Markup::ToRdoc
|
|
81
81
|
attributes(label).strip
|
82
82
|
end.join "\n"
|
83
83
|
|
84
|
-
bullets << "\n
|
84
|
+
bullets << "\n" unless bullets.empty?
|
85
85
|
|
86
86
|
@prefix = ' ' * @indent
|
87
87
|
@indent += 4
|
88
|
-
@prefix << bullets
|
88
|
+
@prefix << bullets << ":" << (' ' * (@indent - 1))
|
89
89
|
else
|
90
90
|
bullet = type == :BULLET ? '*' : @list_index.last.to_s + '.'
|
91
91
|
@prefix = (' ' * @indent) + bullet.ljust(4)
|
data/lib/rdoc/markup/to_rdoc.rb
CHANGED
@@ -145,11 +145,19 @@ class RDoc::Markup::ToRdoc < RDoc::Markup::Formatter
|
|
145
145
|
|
146
146
|
case type
|
147
147
|
when :NOTE, :LABEL then
|
148
|
-
|
148
|
+
stripped_labels = Array(list_item.label).map do |label|
|
149
149
|
attributes(label).strip
|
150
|
-
end
|
150
|
+
end
|
151
|
+
|
152
|
+
bullets = case type
|
153
|
+
when :NOTE
|
154
|
+
stripped_labels.map { |b| "#{b}::" }
|
155
|
+
when :LABEL
|
156
|
+
stripped_labels.map { |b| "[#{b}]" }
|
157
|
+
end
|
151
158
|
|
152
|
-
bullets
|
159
|
+
bullets = bullets.join("\n")
|
160
|
+
bullets << "\n" unless stripped_labels.empty?
|
153
161
|
|
154
162
|
@prefix = ' ' * @indent
|
155
163
|
@indent += 2
|
data/lib/rdoc/options.rb
CHANGED
data/lib/rdoc/parser/c.rb
CHANGED
@@ -756,17 +756,27 @@ class RDoc::Parser::C < RDoc::Parser
|
|
756
756
|
def gen_const_table file_content
|
757
757
|
table = {}
|
758
758
|
@content.scan(%r{
|
759
|
-
((?>^\s*/\*.*?\*/\s+))
|
760
|
-
rb_define_(
|
761
|
-
"(
|
759
|
+
(?<doc>(?>^\s*/\*.*?\*/\s+))
|
760
|
+
rb_define_(?<type>\w+)\(\s*(?:\w+),\s*
|
761
|
+
"(?<name>\w+)"\s*,
|
762
762
|
.*?\)\s*;
|
763
|
+
| (?<doc>(?>^\s*/\*.*?\*/\s+))
|
764
|
+
rb_file_(?<type>const)\(\s*
|
765
|
+
"(?<name>\w+)"\s*,
|
766
|
+
.*?\)\s*;
|
767
|
+
| (?<doc>(?>^\s*/\*.*?\*/\s+))
|
768
|
+
rb_curses_define_(?<type>const)\(\s*
|
769
|
+
(?<name>\w+)
|
770
|
+
\s*\)\s*;
|
763
771
|
| Document-(?:const|global|variable):\s
|
764
|
-
((?:\w+::)*\w+)
|
765
|
-
\s*?\n((?>.*?\*/))
|
772
|
+
(?<name>(?:\w+::)*\w+)
|
773
|
+
\s*?\n(?<doc>(?>.*?\*/))
|
766
774
|
}mxi) do
|
767
|
-
|
768
|
-
|
769
|
-
|
775
|
+
name, doc, type = $~.values_at(:name, :doc, :type)
|
776
|
+
if type
|
777
|
+
table[[type, name]] = doc
|
778
|
+
else
|
779
|
+
table[name] = "/*\n" + doc
|
770
780
|
end
|
771
781
|
end
|
772
782
|
table
|
data/lib/rdoc/parser/ruby.rb
CHANGED
@@ -789,8 +789,10 @@ class RDoc::Parser::Ruby < RDoc::Parser
|
|
789
789
|
al.line = line_no
|
790
790
|
|
791
791
|
read_documentation_modifiers al, RDoc::ATTR_MODIFIERS
|
792
|
-
|
793
|
-
|
792
|
+
if al.document_self or not @track_visibility
|
793
|
+
context.add_alias al
|
794
|
+
@stats.add_alias al
|
795
|
+
end
|
794
796
|
|
795
797
|
al
|
796
798
|
end
|
@@ -1453,6 +1455,12 @@ class RDoc::Parser::Ruby < RDoc::Parser
|
|
1453
1455
|
meth = RDoc::AnyMethod.new get_tkread, name
|
1454
1456
|
look_for_directives_in meth, comment
|
1455
1457
|
meth.singleton = single == SINGLE ? true : singleton
|
1458
|
+
if singleton
|
1459
|
+
# `current_line_visibility' is useless because it works against
|
1460
|
+
# the normal method named as same as the singleton method, after
|
1461
|
+
# the latter was defined. Of course these are different things.
|
1462
|
+
container.current_line_visibility = :public
|
1463
|
+
end
|
1456
1464
|
|
1457
1465
|
record_location meth
|
1458
1466
|
meth.line = line_no
|
@@ -1776,6 +1784,7 @@ class RDoc::Parser::Ruby < RDoc::Parser
|
|
1776
1784
|
|
1777
1785
|
nest = 1
|
1778
1786
|
save_visibility = container.visibility
|
1787
|
+
container.visibility = :public unless current_method
|
1779
1788
|
|
1780
1789
|
non_comment_seen = true
|
1781
1790
|
|
data/lib/rdoc/parser.rb
CHANGED
@@ -125,9 +125,11 @@ class RDoc::Parser
|
|
125
125
|
return parser if ext_name.empty?
|
126
126
|
|
127
127
|
if parser == RDoc::Parser::Simple and ext_name !~ /txt|rdoc/ then
|
128
|
-
case check_modeline
|
128
|
+
case mode = check_modeline(file_name)
|
129
129
|
when nil, 'rdoc' then # continue
|
130
|
-
else
|
130
|
+
else
|
131
|
+
RDoc::Parser.parsers.find { |_, p| return p if mode.casecmp?(p.name[/\w+\z/]) }
|
132
|
+
return nil
|
131
133
|
end
|
132
134
|
end
|
133
135
|
|
data/lib/rdoc/rd/block_parser.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
#
|
3
3
|
# DO NOT MODIFY!!!!
|
4
|
-
# This file is automatically generated by Racc 1.
|
4
|
+
# This file is automatically generated by Racc 1.8.0
|
5
5
|
# from Racc grammar file "block_parser.ry".
|
6
6
|
#
|
7
7
|
|
@@ -23,7 +23,7 @@ unless $".find {|p| p.end_with?('/racc/info.rb')}
|
|
23
23
|
$".push "#{__dir__}/racc/info.rb"
|
24
24
|
|
25
25
|
module Racc
|
26
|
-
VERSION = '1.
|
26
|
+
VERSION = '1.8.0'
|
27
27
|
Version = VERSION
|
28
28
|
Copyright = 'Copyright (c) 1999-2006 Minero Aoki'
|
29
29
|
end
|
@@ -31,10 +31,6 @@ end
|
|
31
31
|
end
|
32
32
|
|
33
33
|
|
34
|
-
unless defined?(NotImplementedError)
|
35
|
-
NotImplementedError = NotImplementError # :nodoc:
|
36
|
-
end
|
37
|
-
|
38
34
|
module Racc
|
39
35
|
class ParseError < StandardError; end
|
40
36
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
#
|
3
3
|
# DO NOT MODIFY!!!!
|
4
|
-
# This file is automatically generated by Racc 1.
|
4
|
+
# This file is automatically generated by Racc 1.8.0
|
5
5
|
# from Racc grammar file "inline_parser.ry".
|
6
6
|
#
|
7
7
|
|
@@ -23,7 +23,7 @@ unless $".find {|p| p.end_with?('/racc/info.rb')}
|
|
23
23
|
$".push "#{__dir__}/racc/info.rb"
|
24
24
|
|
25
25
|
module Racc
|
26
|
-
VERSION = '1.
|
26
|
+
VERSION = '1.8.0'
|
27
27
|
Version = VERSION
|
28
28
|
Copyright = 'Copyright (c) 1999-2006 Minero Aoki'
|
29
29
|
end
|
@@ -31,10 +31,6 @@ end
|
|
31
31
|
end
|
32
32
|
|
33
33
|
|
34
|
-
unless defined?(NotImplementedError)
|
35
|
-
NotImplementedError = NotImplementError # :nodoc:
|
36
|
-
end
|
37
|
-
|
38
34
|
module Racc
|
39
35
|
class ParseError < StandardError; end
|
40
36
|
end
|
data/lib/rdoc/ri/driver.rb
CHANGED
data/lib/rdoc/version.rb
CHANGED
data/lib/rdoc.rb
CHANGED
@@ -121,7 +121,7 @@ module RDoc
|
|
121
121
|
end
|
122
122
|
|
123
123
|
##
|
124
|
-
#
|
124
|
+
# Searches and returns the directory for settings.
|
125
125
|
#
|
126
126
|
# 1. <tt>$HOME/.rdoc</tt> directory, if it exists.
|
127
127
|
# 2. The +rdoc+ directory under the path specified by the
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eric Hodel
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
- ITOYANAGI Sakura
|
14
14
|
bindir: exe
|
15
15
|
cert_chain: []
|
16
|
-
date: 2024-
|
16
|
+
date: 2024-05-23 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: psych
|