rdoc 6.12.0 → 6.14.1
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/alias.rb +2 -9
- data/lib/rdoc/code_object/any_method.rb +9 -14
- data/lib/rdoc/code_object/attr.rb +6 -9
- data/lib/rdoc/code_object/class_module.rb +40 -23
- data/lib/rdoc/code_object/constant.rb +5 -5
- data/lib/rdoc/code_object/context/section.rb +8 -7
- data/lib/rdoc/code_object/context.rb +23 -65
- data/lib/rdoc/code_object/method_attr.rb +9 -28
- 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/require.rb +1 -1
- data/lib/rdoc/code_object/single_class.rb +1 -1
- data/lib/rdoc/code_object/top_level.rb +12 -30
- data/lib/rdoc/code_object.rb +6 -37
- data/lib/rdoc/comment.rb +7 -10
- 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 +97 -109
- data/lib/rdoc/generator/json_index.rb +4 -20
- data/lib/rdoc/generator/markup.rb +14 -2
- data/lib/rdoc/generator/pot/message_extractor.rb +6 -6
- 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 -6
- data/lib/rdoc/generator/ri.rb +1 -1
- data/lib/rdoc/generator/template/darkfish/_head.rhtml +5 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +1 -30
- data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +1 -1
- data/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +1 -1
- data/lib/rdoc/generator/template/darkfish/class.rhtml +15 -0
- data/lib/rdoc/generator/template/darkfish/css/rdoc.css +15 -0
- data/lib/rdoc/markdown.kpeg +7 -5
- data/lib/rdoc/markdown.rb +34 -21
- 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 +11 -5
- 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 +25 -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 +6 -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 +20 -23
- data/lib/rdoc/parser/changelog.rb +9 -9
- data/lib/rdoc/parser/prism_ruby.rb +9 -16
- data/lib/rdoc/parser/ruby.rb +50 -53
- 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 +11 -26
- data/lib/rdoc/ri/driver.rb +60 -52
- data/lib/rdoc/ri/paths.rb +2 -2
- data/lib/rdoc/ri/task.rb +1 -1
- data/lib/rdoc/rubygems_hook.rb +14 -17
- data/lib/rdoc/servlet.rb +23 -22
- 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 +14 -14
- data/lib/rdoc/store.rb +39 -43
- data/lib/rdoc/task.rb +2 -2
- data/lib/rdoc/text.rb +13 -13
- 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
- data/rdoc.gemspec +69 -0
- metadata +18 -5
- data/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml +0 -19
- data/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml +0 -9
data/lib/rdoc/text.rb
CHANGED
@@ -52,7 +52,7 @@ module RDoc::Text
|
|
52
52
|
##
|
53
53
|
# Transcodes +character+ to +encoding+ with a +fallback+ character.
|
54
54
|
|
55
|
-
def self.encode_fallback
|
55
|
+
def self.encode_fallback(character, encoding, fallback)
|
56
56
|
character.encode(encoding, :fallback => { character => fallback },
|
57
57
|
:undef => :replace, :replace => fallback)
|
58
58
|
end
|
@@ -60,7 +60,7 @@ module RDoc::Text
|
|
60
60
|
##
|
61
61
|
# Expands tab characters in +text+ to eight spaces
|
62
62
|
|
63
|
-
def expand_tabs
|
63
|
+
def expand_tabs(text)
|
64
64
|
expanded = []
|
65
65
|
|
66
66
|
text.each_line do |line|
|
@@ -79,7 +79,7 @@ module RDoc::Text
|
|
79
79
|
##
|
80
80
|
# Flush +text+ left based on the shortest line
|
81
81
|
|
82
|
-
def flush_left
|
82
|
+
def flush_left(text)
|
83
83
|
indent = 9999
|
84
84
|
|
85
85
|
text.each_line do |line|
|
@@ -98,9 +98,9 @@ module RDoc::Text
|
|
98
98
|
#
|
99
99
|
# Requires the including class to implement #formatter
|
100
100
|
|
101
|
-
def markup
|
102
|
-
if @store.
|
103
|
-
locale = @store.
|
101
|
+
def markup(text)
|
102
|
+
if @store.options
|
103
|
+
locale = @store.options.locale
|
104
104
|
else
|
105
105
|
locale = nil
|
106
106
|
end
|
@@ -114,7 +114,7 @@ module RDoc::Text
|
|
114
114
|
##
|
115
115
|
# Strips hashes, expands tabs then flushes +text+ to the left
|
116
116
|
|
117
|
-
def normalize_comment
|
117
|
+
def normalize_comment(text)
|
118
118
|
return text if text.empty?
|
119
119
|
|
120
120
|
case language
|
@@ -132,7 +132,7 @@ module RDoc::Text
|
|
132
132
|
##
|
133
133
|
# Normalizes +text+ then builds a RDoc::Markup::Document from it
|
134
134
|
|
135
|
-
def parse
|
135
|
+
def parse(text, format = 'rdoc')
|
136
136
|
return text if RDoc::Markup::Document === text
|
137
137
|
return text.parse if RDoc::Comment === text
|
138
138
|
|
@@ -146,7 +146,7 @@ module RDoc::Text
|
|
146
146
|
##
|
147
147
|
# The first +limit+ characters of +text+ as HTML
|
148
148
|
|
149
|
-
def snippet
|
149
|
+
def snippet(text, limit = 100)
|
150
150
|
document = parse text
|
151
151
|
|
152
152
|
RDoc::Markup::ToHtmlSnippet.new(options, limit).convert document
|
@@ -155,7 +155,7 @@ module RDoc::Text
|
|
155
155
|
##
|
156
156
|
# Strips leading # characters from +text+
|
157
157
|
|
158
|
-
def strip_hashes
|
158
|
+
def strip_hashes(text)
|
159
159
|
return text if text =~ /^(?>\s*)[^\#]/
|
160
160
|
|
161
161
|
empty = ''
|
@@ -167,14 +167,14 @@ module RDoc::Text
|
|
167
167
|
##
|
168
168
|
# Strips leading and trailing \n characters from +text+
|
169
169
|
|
170
|
-
def strip_newlines
|
170
|
+
def strip_newlines(text)
|
171
171
|
text.gsub(/\A\n*(.*?)\n*\z/m) do $1 end # block preserves String encoding
|
172
172
|
end
|
173
173
|
|
174
174
|
##
|
175
175
|
# Strips /* */ style comments
|
176
176
|
|
177
|
-
def strip_stars
|
177
|
+
def strip_stars(text)
|
178
178
|
return text unless text =~ %r%/\*.*\*/%m
|
179
179
|
|
180
180
|
encoding = text.encoding
|
@@ -197,7 +197,7 @@ module RDoc::Text
|
|
197
197
|
# Converts ampersand, dashes, ellipsis, quotes, copyright and registered
|
198
198
|
# trademark symbols in +text+ to properly encoded characters.
|
199
199
|
|
200
|
-
def to_html
|
200
|
+
def to_html(text)
|
201
201
|
html = (''.encode text.encoding).dup
|
202
202
|
|
203
203
|
encoded = RDoc::Text::TO_HTML_CHARACTERS[text.encoding]
|
data/lib/rdoc/token_stream.rb
CHANGED
@@ -13,7 +13,7 @@ module RDoc::TokenStream
|
|
13
13
|
# <tt><span></tt> elements. Some tokens types are wrapped in spans
|
14
14
|
# with the given class names. Other token types are not wrapped in spans.
|
15
15
|
|
16
|
-
def self.to_html
|
16
|
+
def self.to_html(token_stream)
|
17
17
|
starting_title = false
|
18
18
|
|
19
19
|
token_stream.map do |t|
|
data/lib/rdoc/tom_doc.rb
CHANGED
@@ -75,7 +75,7 @@ class RDoc::TomDoc < RDoc::Markup::Parser
|
|
75
75
|
#
|
76
76
|
# Returns an RDoc::Markup::Document representing the TomDoc format.
|
77
77
|
|
78
|
-
def self.parse
|
78
|
+
def self.parse(text)
|
79
79
|
parser = new
|
80
80
|
|
81
81
|
parser.tokenize text
|
@@ -91,7 +91,7 @@ class RDoc::TomDoc < RDoc::Markup::Parser
|
|
91
91
|
#
|
92
92
|
# Returns a String containing the signature and nil if not
|
93
93
|
|
94
|
-
def self.signature
|
94
|
+
def self.signature(comment)
|
95
95
|
return unless comment.tomdoc?
|
96
96
|
|
97
97
|
document = comment.parse
|
@@ -134,7 +134,7 @@ class RDoc::TomDoc < RDoc::Markup::Parser
|
|
134
134
|
#
|
135
135
|
# Returns an RDoc::Markup::Heading
|
136
136
|
|
137
|
-
def build_heading
|
137
|
+
def build_heading(level)
|
138
138
|
heading = super
|
139
139
|
|
140
140
|
@section = heading.text
|
@@ -150,7 +150,7 @@ class RDoc::TomDoc < RDoc::Markup::Parser
|
|
150
150
|
#
|
151
151
|
# Returns an RDoc::Markup::Verbatim
|
152
152
|
|
153
|
-
def build_verbatim
|
153
|
+
def build_verbatim(margin)
|
154
154
|
verbatim = super
|
155
155
|
|
156
156
|
verbatim.format = :ruby if @section == 'Examples'
|
@@ -164,7 +164,7 @@ class RDoc::TomDoc < RDoc::Markup::Parser
|
|
164
164
|
#
|
165
165
|
# Returns an RDoc::Markup::Paragraph.
|
166
166
|
|
167
|
-
def build_paragraph
|
167
|
+
def build_paragraph(margin)
|
168
168
|
p :paragraph_start => margin if @debug
|
169
169
|
|
170
170
|
paragraph = RDoc::Markup::Paragraph.new
|
@@ -204,7 +204,7 @@ class RDoc::TomDoc < RDoc::Markup::Parser
|
|
204
204
|
##
|
205
205
|
# Detects a section change to "Returns" and adds a heading
|
206
206
|
|
207
|
-
def parse_text
|
207
|
+
def parse_text(parent, indent) # :nodoc:
|
208
208
|
paragraph = build_paragraph indent
|
209
209
|
|
210
210
|
if false == @seen_returns and 'Returns' == @section then
|
@@ -222,7 +222,7 @@ class RDoc::TomDoc < RDoc::Markup::Parser
|
|
222
222
|
#
|
223
223
|
# Returns self.
|
224
224
|
|
225
|
-
def tokenize
|
225
|
+
def tokenize(text)
|
226
226
|
text = text.sub(/\A(Public|Internal|Deprecated):\s+/, '')
|
227
227
|
|
228
228
|
setup_scanner text
|
data/lib/rdoc/version.rb
CHANGED
data/man/ri.1
CHANGED
@@ -36,6 +36,8 @@ can be:
|
|
36
36
|
.It Class::method | Class#method | Class.method | method
|
37
37
|
.Pp
|
38
38
|
.It gem_name: | gem_name:README | gem_name:History
|
39
|
+
.Pp
|
40
|
+
.It ruby: | ruby:NEWS | ruby:globals
|
39
41
|
.El
|
40
42
|
.Pp
|
41
43
|
All class names may be abbreviated to their minimum unambiguous form.
|
data/rdoc.gemspec
ADDED
@@ -0,0 +1,69 @@
|
|
1
|
+
begin
|
2
|
+
require_relative "lib/rdoc/version"
|
3
|
+
rescue LoadError
|
4
|
+
# for Ruby repository
|
5
|
+
require_relative "version"
|
6
|
+
end
|
7
|
+
|
8
|
+
Gem::Specification.new do |s|
|
9
|
+
s.name = "rdoc"
|
10
|
+
s.version = RDoc::VERSION
|
11
|
+
|
12
|
+
s.authors = [
|
13
|
+
"Eric Hodel",
|
14
|
+
"Dave Thomas",
|
15
|
+
"Phil Hagelberg",
|
16
|
+
"Tony Strauss",
|
17
|
+
"Zachary Scott",
|
18
|
+
"Hiroshi SHIBATA",
|
19
|
+
"ITOYANAGI Sakura"
|
20
|
+
]
|
21
|
+
s.email = ["drbrain@segment7.net", "", "", "", "mail@zzak.io", "hsbt@ruby-lang.org", "aycabta@gmail.com"]
|
22
|
+
|
23
|
+
s.summary = "RDoc produces HTML and command-line documentation for Ruby projects"
|
24
|
+
s.description = <<-DESCRIPTION
|
25
|
+
RDoc produces HTML and command-line documentation for Ruby projects.
|
26
|
+
RDoc includes the +rdoc+ and +ri+ tools for generating and displaying documentation from the command-line.
|
27
|
+
DESCRIPTION
|
28
|
+
s.homepage = "https://ruby.github.io/rdoc"
|
29
|
+
s.licenses = ["Ruby"]
|
30
|
+
|
31
|
+
s.metadata["homepage_uri"] = s.homepage
|
32
|
+
s.metadata["source_code_uri"] = "https://github.com/ruby/rdoc"
|
33
|
+
s.metadata["changelog_uri"] = "#{s.metadata["source_code_uri"]}/releases"
|
34
|
+
|
35
|
+
s.bindir = "exe"
|
36
|
+
s.executables = ["rdoc", "ri"]
|
37
|
+
s.require_paths = ["lib"]
|
38
|
+
# for ruby core repository. It was generated by
|
39
|
+
# `git ls-files -z`.split("\x0").each {|f| puts " #{f.dump}," unless f.start_with?(*%W[test/ spec/ features/ .]) }
|
40
|
+
non_lib_files = [
|
41
|
+
"CONTRIBUTING.rdoc",
|
42
|
+
"CVE-2013-0256.rdoc",
|
43
|
+
"ExampleMarkdown.md",
|
44
|
+
"ExampleRDoc.rdoc",
|
45
|
+
"History.rdoc",
|
46
|
+
"LEGAL.rdoc",
|
47
|
+
"LICENSE.rdoc",
|
48
|
+
"README.rdoc",
|
49
|
+
"RI.md",
|
50
|
+
"TODO.rdoc",
|
51
|
+
"exe/rdoc",
|
52
|
+
"exe/ri",
|
53
|
+
"man/ri.1",
|
54
|
+
"rdoc.gemspec",
|
55
|
+
]
|
56
|
+
template_files = Dir.glob("lib/rdoc/generator/template/**/*")
|
57
|
+
lib_files = Dir.glob("lib/**/*.{rb,kpeg,ry}", base: File.expand_path('..', __FILE__))
|
58
|
+
|
59
|
+
s.files = (non_lib_files + template_files + lib_files).uniq
|
60
|
+
|
61
|
+
s.rdoc_options = ["--main", "README.rdoc"]
|
62
|
+
s.extra_rdoc_files += s.files.grep(%r[\A[^\/]+\.(?:rdoc|md)\z])
|
63
|
+
|
64
|
+
s.required_ruby_version = Gem::Requirement.new(">= 2.6.0")
|
65
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 2.2")
|
66
|
+
|
67
|
+
s.add_dependency 'psych', '>= 4.0.0'
|
68
|
+
s.add_dependency 'erb'
|
69
|
+
end
|
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.14.1
|
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: 2025-
|
16
|
+
date: 2025-06-18 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: psych
|
@@ -29,6 +29,20 @@ dependencies:
|
|
29
29
|
- - ">="
|
30
30
|
- !ruby/object:Gem::Version
|
31
31
|
version: 4.0.0
|
32
|
+
- !ruby/object:Gem::Dependency
|
33
|
+
name: erb
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">="
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
type: :runtime
|
40
|
+
prerelease: false
|
41
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
32
46
|
description: |
|
33
47
|
RDoc produces HTML and command-line documentation for Ruby projects.
|
34
48
|
RDoc includes the +rdoc+ and +ri+ tools for generating and displaying documentation from the command-line.
|
@@ -106,10 +120,8 @@ files:
|
|
106
120
|
- lib/rdoc/generator/ri.rb
|
107
121
|
- lib/rdoc/generator/template/darkfish/_footer.rhtml
|
108
122
|
- lib/rdoc/generator/template/darkfish/_head.rhtml
|
109
|
-
- lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml
|
110
123
|
- lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml
|
111
124
|
- lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml
|
112
|
-
- lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml
|
113
125
|
- lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml
|
114
126
|
- lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml
|
115
127
|
- lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml
|
@@ -246,6 +258,7 @@ files:
|
|
246
258
|
- lib/rdoc/version.rb
|
247
259
|
- lib/rubygems_plugin.rb
|
248
260
|
- man/ri.1
|
261
|
+
- rdoc.gemspec
|
249
262
|
homepage: https://ruby.github.io/rdoc
|
250
263
|
licenses:
|
251
264
|
- Ruby
|
@@ -269,7 +282,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
269
282
|
- !ruby/object:Gem::Version
|
270
283
|
version: '2.2'
|
271
284
|
requirements: []
|
272
|
-
rubygems_version: 3.6.
|
285
|
+
rubygems_version: 3.6.7
|
273
286
|
specification_version: 4
|
274
287
|
summary: RDoc produces HTML and command-line documentation for Ruby projects
|
275
288
|
test_files: []
|
@@ -1,19 +0,0 @@
|
|
1
|
-
<%- if !svninfo.empty? then %>
|
2
|
-
<div id="file-svninfo-section" class="nav-section">
|
3
|
-
<h3>VCS Info</h3>
|
4
|
-
|
5
|
-
<div class="section-body">
|
6
|
-
<dl class="svninfo">
|
7
|
-
<dt>Rev
|
8
|
-
<dd><%= svninfo[:rev] %>
|
9
|
-
|
10
|
-
<dt>Last Checked In
|
11
|
-
<dd><%= svninfo[:commitdate].strftime('%Y-%m-%d %H:%M:%S') %>
|
12
|
-
(<%= svninfo[:commitdelta] %> ago)
|
13
|
-
|
14
|
-
<dt>Checked in by
|
15
|
-
<dd><%= svninfo[:committer] %>
|
16
|
-
</dl>
|
17
|
-
</div>
|
18
|
-
</div>
|
19
|
-
<%- end -%>
|