rdoc 5.1.0 → 6.13.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 +5 -5
- data/CONTRIBUTING.rdoc +5 -6
- data/ExampleMarkdown.md +2 -0
- data/ExampleRDoc.rdoc +2 -0
- data/History.rdoc +68 -66
- data/LEGAL.rdoc +1 -1
- data/LICENSE.rdoc +2 -0
- data/README.rdoc +18 -6
- data/RI.md +842 -0
- data/TODO.rdoc +8 -7
- data/exe/rdoc +0 -1
- data/lib/rdoc/{alias.rb → code_object/alias.rb} +4 -12
- data/lib/rdoc/{anon_class.rb → code_object/anon_class.rb} +1 -2
- data/lib/rdoc/{any_method.rb → code_object/any_method.rb} +83 -26
- data/lib/rdoc/{attr.rb → code_object/attr.rb} +5 -9
- data/lib/rdoc/{class_module.rb → code_object/class_module.rb} +112 -24
- data/lib/rdoc/{constant.rb → code_object/constant.rb} +4 -5
- data/lib/rdoc/{context → code_object/context}/section.rb +13 -83
- data/lib/rdoc/{context.rb → code_object/context.rb} +69 -70
- data/lib/rdoc/{extend.rb → code_object/extend.rb} +1 -2
- data/lib/rdoc/{ghost_method.rb → code_object/ghost_method.rb} +1 -2
- data/lib/rdoc/{include.rb → code_object/include.rb} +1 -2
- data/lib/rdoc/{meta_method.rb → code_object/meta_method.rb} +1 -2
- data/lib/rdoc/{method_attr.rb → code_object/method_attr.rb} +22 -31
- data/lib/rdoc/{mixin.rb → code_object/mixin.rb} +1 -2
- data/lib/rdoc/{normal_class.rb → code_object/normal_class.rb} +4 -5
- data/lib/rdoc/{normal_module.rb → code_object/normal_module.rb} +2 -3
- data/lib/rdoc/{require.rb → code_object/require.rb} +2 -3
- data/lib/rdoc/{single_class.rb → code_object/single_class.rb} +6 -2
- data/lib/rdoc/{top_level.rb → code_object/top_level.rb} +22 -32
- data/lib/rdoc/code_object.rb +8 -41
- data/lib/rdoc/code_objects.rb +2 -3
- data/lib/rdoc/comment.rb +48 -41
- data/lib/rdoc/cross_reference.rb +77 -33
- data/lib/rdoc/encoding.rb +50 -38
- data/lib/rdoc/erb_partial.rb +2 -3
- data/lib/rdoc/erbio.rb +4 -5
- data/lib/rdoc/generator/darkfish.rb +178 -125
- data/lib/rdoc/generator/json_index.rb +9 -22
- data/lib/rdoc/generator/markup.rb +6 -17
- data/lib/rdoc/generator/pot/message_extractor.rb +4 -4
- data/lib/rdoc/generator/pot/po.rb +3 -3
- data/lib/rdoc/generator/pot/po_entry.rb +12 -12
- data/lib/rdoc/generator/pot.rb +4 -8
- data/lib/rdoc/generator/ri.rb +1 -2
- data/lib/rdoc/generator/template/darkfish/_footer.rhtml +2 -2
- data/lib/rdoc/generator/template/darkfish/_head.rhtml +35 -12
- data/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +1 -5
- data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +7 -7
- data/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +7 -7
- data/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +6 -6
- data/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +19 -10
- data/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +26 -6
- data/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +4 -9
- data/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +1 -1
- data/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +4 -4
- data/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +27 -6
- data/lib/rdoc/generator/template/darkfish/_sidebar_toggle.rhtml +3 -0
- data/lib/rdoc/generator/template/darkfish/class.rhtml +125 -78
- data/lib/rdoc/generator/template/darkfish/css/rdoc.css +430 -339
- 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/index.rhtml +13 -13
- data/lib/rdoc/generator/template/darkfish/js/darkfish.js +51 -92
- data/lib/rdoc/generator/template/darkfish/js/search.js +35 -34
- data/lib/rdoc/generator/template/darkfish/page.rhtml +5 -5
- data/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +10 -8
- data/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +20 -18
- data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +32 -20
- data/lib/rdoc/generator/template/json_index/js/navigation.js +12 -49
- data/lib/rdoc/generator/template/json_index/js/searcher.js +6 -6
- data/lib/rdoc/generator.rb +6 -6
- data/lib/rdoc/i18n/locale.rb +1 -1
- data/lib/rdoc/i18n/text.rb +5 -5
- data/lib/rdoc/i18n.rb +4 -4
- data/lib/rdoc/known_classes.rb +6 -5
- data/lib/rdoc/markdown/entities.rb +1 -2
- data/lib/rdoc/markdown/literals.kpeg +1 -2
- data/lib/rdoc/markdown/literals.rb +99 -50
- data/lib/rdoc/markdown.kpeg +115 -58
- data/lib/rdoc/markdown.rb +1584 -902
- data/lib/rdoc/markup/attr_changer.rb +1 -2
- data/lib/rdoc/markup/attr_span.rb +9 -4
- data/lib/rdoc/markup/attribute_manager.rb +118 -57
- data/lib/rdoc/markup/attributes.rb +7 -8
- data/lib/rdoc/markup/blank_line.rb +1 -2
- data/lib/rdoc/markup/block_quote.rb +1 -2
- data/lib/rdoc/markup/document.rb +1 -2
- data/lib/rdoc/markup/formatter.rb +44 -37
- data/lib/rdoc/markup/hard_break.rb +1 -2
- data/lib/rdoc/markup/heading.rb +11 -6
- data/lib/rdoc/markup/include.rb +1 -2
- data/lib/rdoc/markup/indented_paragraph.rb +1 -2
- data/lib/rdoc/markup/list.rb +1 -2
- data/lib/rdoc/markup/list_item.rb +1 -2
- data/lib/rdoc/markup/paragraph.rb +1 -2
- data/lib/rdoc/markup/parser.rb +90 -48
- data/lib/rdoc/markup/pre_process.rb +38 -11
- data/lib/rdoc/markup/raw.rb +1 -2
- data/lib/rdoc/markup/regexp_handling.rb +40 -0
- data/lib/rdoc/markup/rule.rb +1 -2
- data/lib/rdoc/markup/table.rb +56 -0
- data/lib/rdoc/markup/to_ansi.rb +1 -2
- data/lib/rdoc/markup/to_bs.rb +30 -5
- data/lib/rdoc/markup/to_html.rb +95 -40
- data/lib/rdoc/markup/to_html_crossref.rb +108 -43
- data/lib/rdoc/markup/to_html_snippet.rb +13 -11
- data/lib/rdoc/markup/to_joined_paragraph.rb +6 -32
- data/lib/rdoc/markup/to_label.rb +11 -12
- data/lib/rdoc/markup/to_markdown.rb +13 -14
- data/lib/rdoc/markup/to_rdoc.rb +49 -31
- data/lib/rdoc/markup/to_table_of_contents.rb +2 -2
- data/lib/rdoc/markup/to_test.rb +1 -2
- data/lib/rdoc/markup/to_tt_only.rb +3 -4
- data/lib/rdoc/markup/verbatim.rb +1 -2
- data/lib/rdoc/markup.rb +64 -694
- data/lib/rdoc/options.rb +226 -44
- data/lib/rdoc/parser/c.rb +231 -246
- data/lib/rdoc/parser/changelog.rb +169 -23
- data/lib/rdoc/parser/markdown.rb +1 -3
- data/lib/rdoc/parser/prism_ruby.rb +1092 -0
- data/lib/rdoc/parser/rd.rb +1 -2
- data/lib/rdoc/parser/ripper_state_lex.rb +302 -0
- data/lib/rdoc/parser/ruby.rb +695 -478
- data/lib/rdoc/parser/ruby_tools.rb +33 -36
- data/lib/rdoc/parser/simple.rb +4 -4
- data/lib/rdoc/parser/text.rb +1 -2
- data/lib/rdoc/parser.rb +37 -42
- data/lib/rdoc/rd/block_parser.rb +708 -57
- data/lib/rdoc/rd/block_parser.ry +15 -11
- data/lib/rdoc/rd/inline.rb +5 -6
- data/lib/rdoc/rd/inline_parser.rb +787 -140
- data/lib/rdoc/rd/inline_parser.ry +1 -1
- data/lib/rdoc/rd.rb +4 -5
- data/lib/rdoc/rdoc.rb +72 -87
- data/lib/rdoc/ri/driver.rb +236 -152
- data/lib/rdoc/ri/formatter.rb +1 -1
- data/lib/rdoc/ri/paths.rb +4 -18
- data/lib/rdoc/ri/store.rb +1 -2
- data/lib/rdoc/ri/task.rb +2 -2
- data/lib/rdoc/ri.rb +5 -6
- data/lib/rdoc/rubygems_hook.rb +98 -20
- data/lib/rdoc/servlet.rb +30 -20
- data/lib/rdoc/stats/normal.rb +24 -18
- data/lib/rdoc/stats/quiet.rb +1 -2
- data/lib/rdoc/stats/verbose.rb +1 -3
- data/lib/rdoc/stats.rb +6 -7
- data/lib/rdoc/store.rb +84 -55
- data/lib/rdoc/task.rb +35 -10
- data/lib/rdoc/text.rb +40 -27
- data/lib/rdoc/token_stream.rb +56 -34
- data/lib/rdoc/tom_doc.rb +18 -19
- data/lib/rdoc/version.rb +10 -0
- data/lib/rdoc.rb +80 -56
- data/lib/rubygems_plugin.rb +23 -0
- data/man/ri.1 +247 -0
- metadata +45 -99
- data/.document +0 -5
- data/.gitignore +0 -13
- data/.travis.yml +0 -24
- data/Gemfile +0 -3
- data/RI.rdoc +0 -57
- data/Rakefile +0 -133
- data/bin/console +0 -7
- data/bin/setup +0 -6
- data/lib/gauntlet_rdoc.rb +0 -82
- data/lib/rdoc/generator/template/darkfish/.document +0 -0
- 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/generator/template/darkfish/js/jquery.js +0 -4
- data/lib/rdoc/generator/template/json_index/.document +0 -1
- data/lib/rdoc/markup/formatter_test_case.rb +0 -764
- data/lib/rdoc/markup/inline.rb +0 -2
- data/lib/rdoc/markup/special.rb +0 -41
- data/lib/rdoc/markup/text_formatter_test_case.rb +0 -115
- data/lib/rdoc/ruby_lex.rb +0 -1367
- data/lib/rdoc/ruby_token.rb +0 -461
- data/lib/rdoc/test_case.rb +0 -204
- data/rdoc.gemspec +0 -57
data/lib/rdoc/tom_doc.rb
CHANGED
@@ -1,15 +1,9 @@
|
|
1
|
-
# frozen_string_literal:
|
1
|
+
# frozen_string_literal: true
|
2
2
|
# :markup: tomdoc
|
3
3
|
|
4
4
|
# A parser for TomDoc based on TomDoc 1.0.0-rc1 (02adef9b5a)
|
5
5
|
#
|
6
|
-
# The TomDoc specification can be found at
|
7
|
-
#
|
8
|
-
# http://tomdoc.org
|
9
|
-
#
|
10
|
-
# The latest version of the TomDoc specification can be found at:
|
11
|
-
#
|
12
|
-
# https://github.com/mojombo/tomdoc/blob/master/tomdoc.md
|
6
|
+
# The TomDoc specification can be found at http://tomdoc.org.
|
13
7
|
#
|
14
8
|
# To choose TomDoc as your only default format see RDoc::Options@Saved+Options
|
15
9
|
# for instructions on setting up a <code>.rdoc_options</code> file to store
|
@@ -180,12 +174,19 @@ class RDoc::TomDoc < RDoc::Markup::Parser
|
|
180
174
|
|
181
175
|
case type
|
182
176
|
when :TEXT then
|
183
|
-
@section = 'Returns' if data =~ /\
|
177
|
+
@section = 'Returns' if data =~ /\A(Returns|Raises)/
|
184
178
|
|
185
179
|
paragraph << data
|
186
180
|
when :NEWLINE then
|
187
181
|
if :TEXT == peek_token[0] then
|
188
|
-
|
182
|
+
# Lines beginning with 'Raises' in the Returns section should not be
|
183
|
+
# treated as multiline text
|
184
|
+
if 'Returns' == @section and
|
185
|
+
peek_token[1].start_with?('Raises') then
|
186
|
+
break
|
187
|
+
else
|
188
|
+
paragraph << ' '
|
189
|
+
end
|
189
190
|
else
|
190
191
|
break
|
191
192
|
end
|
@@ -222,7 +223,7 @@ class RDoc::TomDoc < RDoc::Markup::Parser
|
|
222
223
|
# Returns self.
|
223
224
|
|
224
225
|
def tokenize text
|
225
|
-
text.sub
|
226
|
+
text = text.sub(/\A(Public|Internal|Deprecated):\s+/, '')
|
226
227
|
|
227
228
|
setup_scanner text
|
228
229
|
|
@@ -235,19 +236,18 @@ class RDoc::TomDoc < RDoc::Markup::Parser
|
|
235
236
|
|
236
237
|
@tokens << case
|
237
238
|
when @s.scan(/\r?\n/) then
|
238
|
-
token = [:NEWLINE, @s.matched, *
|
239
|
-
@
|
240
|
-
@line += 1
|
239
|
+
token = [:NEWLINE, @s.matched, *pos]
|
240
|
+
@s.newline!
|
241
241
|
token
|
242
242
|
when @s.scan(/(Examples|Signature)$/) then
|
243
|
-
@tokens << [:HEADER, 3, *
|
243
|
+
@tokens << [:HEADER, 3, *pos]
|
244
244
|
|
245
|
-
[:TEXT, @s[1], *
|
245
|
+
[:TEXT, @s[1], *pos]
|
246
246
|
when @s.scan(/([:\w][\w\[\]]*)[ ]+- /) then
|
247
|
-
[:NOTE, @s[1], *
|
247
|
+
[:NOTE, @s[1], *pos]
|
248
248
|
else
|
249
249
|
@s.scan(/.*/)
|
250
|
-
[:TEXT, @s.matched.sub(/\r$/, ''), *
|
250
|
+
[:TEXT, @s.matched.sub(/\r$/, ''), *pos]
|
251
251
|
end
|
252
252
|
end
|
253
253
|
|
@@ -255,4 +255,3 @@ class RDoc::TomDoc < RDoc::Markup::Parser
|
|
255
255
|
end
|
256
256
|
|
257
257
|
end
|
258
|
-
|
data/lib/rdoc/version.rb
ADDED
data/lib/rdoc.rb
CHANGED
@@ -1,8 +1,6 @@
|
|
1
|
-
# frozen_string_literal:
|
1
|
+
# frozen_string_literal: true
|
2
2
|
$DEBUG_RDOC = nil
|
3
3
|
|
4
|
-
# :main: README.rdoc
|
5
|
-
|
6
4
|
##
|
7
5
|
# RDoc produces documentation for Ruby source files by parsing the source and
|
8
6
|
# extracting the definition for classes, modules, methods, includes and
|
@@ -21,7 +19,7 @@ $DEBUG_RDOC = nil
|
|
21
19
|
# see RDoc::Markup and refer to <tt>rdoc --help</tt> for command line usage.
|
22
20
|
#
|
23
21
|
# If you want to set the default markup format see
|
24
|
-
# RDoc::Markup@
|
22
|
+
# RDoc::Markup@Markup+Formats
|
25
23
|
#
|
26
24
|
# If you want to store rdoc configuration in your gem (such as the default
|
27
25
|
# markup format) see RDoc::Options@Saved+Options
|
@@ -62,10 +60,7 @@ module RDoc
|
|
62
60
|
|
63
61
|
class Error < RuntimeError; end
|
64
62
|
|
65
|
-
|
66
|
-
# RDoc version you are using
|
67
|
-
|
68
|
-
VERSION = '5.1.0'
|
63
|
+
require_relative 'rdoc/version'
|
69
64
|
|
70
65
|
##
|
71
66
|
# Method visibilities
|
@@ -123,65 +118,94 @@ module RDoc
|
|
123
118
|
end
|
124
119
|
end
|
125
120
|
|
126
|
-
|
121
|
+
##
|
122
|
+
# Searches and returns the directory for settings.
|
123
|
+
#
|
124
|
+
# 1. <tt>$HOME/.rdoc</tt> directory, if it exists.
|
125
|
+
# 2. The +rdoc+ directory under the path specified by the
|
126
|
+
# +XDG_DATA_HOME+ environment variable, if it is set.
|
127
|
+
# 3. <tt>$HOME/.local/share/rdoc</tt> directory.
|
128
|
+
#
|
129
|
+
# Other than the home directory, the containing directory will be
|
130
|
+
# created automatically.
|
131
|
+
|
132
|
+
def self.home
|
133
|
+
rdoc_dir = begin
|
134
|
+
File.expand_path('~/.rdoc')
|
135
|
+
rescue ArgumentError
|
136
|
+
end
|
137
|
+
|
138
|
+
if File.directory?(rdoc_dir)
|
139
|
+
rdoc_dir
|
140
|
+
else
|
141
|
+
require 'fileutils'
|
142
|
+
begin
|
143
|
+
# XDG
|
144
|
+
xdg_data_home = ENV["XDG_DATA_HOME"] || File.join(File.expand_path("~"), '.local', 'share')
|
145
|
+
unless File.exist?(xdg_data_home)
|
146
|
+
FileUtils.mkdir_p xdg_data_home
|
147
|
+
end
|
148
|
+
File.join xdg_data_home, "rdoc"
|
149
|
+
rescue Errno::EACCES
|
150
|
+
end
|
151
|
+
end
|
152
|
+
end
|
127
153
|
|
128
|
-
autoload :
|
154
|
+
autoload :RDoc, "#{__dir__}/rdoc/rdoc"
|
129
155
|
|
130
|
-
autoload :CrossReference,
|
131
|
-
autoload :ERBIO,
|
132
|
-
autoload :ERBPartial,
|
133
|
-
autoload :Encoding,
|
134
|
-
autoload :Generator,
|
135
|
-
autoload :Options,
|
136
|
-
autoload :Parser,
|
137
|
-
autoload :Servlet,
|
138
|
-
autoload :RI,
|
139
|
-
autoload :Stats,
|
140
|
-
autoload :Store,
|
141
|
-
autoload :Task,
|
142
|
-
autoload :Text,
|
156
|
+
autoload :CrossReference, "#{__dir__}/rdoc/cross_reference"
|
157
|
+
autoload :ERBIO, "#{__dir__}/rdoc/erbio"
|
158
|
+
autoload :ERBPartial, "#{__dir__}/rdoc/erb_partial"
|
159
|
+
autoload :Encoding, "#{__dir__}/rdoc/encoding"
|
160
|
+
autoload :Generator, "#{__dir__}/rdoc/generator"
|
161
|
+
autoload :Options, "#{__dir__}/rdoc/options"
|
162
|
+
autoload :Parser, "#{__dir__}/rdoc/parser"
|
163
|
+
autoload :Servlet, "#{__dir__}/rdoc/servlet"
|
164
|
+
autoload :RI, "#{__dir__}/rdoc/ri"
|
165
|
+
autoload :Stats, "#{__dir__}/rdoc/stats"
|
166
|
+
autoload :Store, "#{__dir__}/rdoc/store"
|
167
|
+
autoload :Task, "#{__dir__}/rdoc/task"
|
168
|
+
autoload :Text, "#{__dir__}/rdoc/text"
|
143
169
|
|
144
|
-
autoload :Markdown,
|
145
|
-
autoload :Markup,
|
146
|
-
autoload :RD,
|
147
|
-
autoload :TomDoc,
|
170
|
+
autoload :Markdown, "#{__dir__}/rdoc/markdown"
|
171
|
+
autoload :Markup, "#{__dir__}/rdoc/markup"
|
172
|
+
autoload :RD, "#{__dir__}/rdoc/rd"
|
173
|
+
autoload :TomDoc, "#{__dir__}/rdoc/tom_doc"
|
148
174
|
|
149
|
-
autoload :KNOWN_CLASSES,
|
175
|
+
autoload :KNOWN_CLASSES, "#{__dir__}/rdoc/known_classes"
|
150
176
|
|
151
|
-
autoload :
|
152
|
-
autoload :RubyToken, 'rdoc/ruby_token'
|
153
|
-
autoload :TokenStream, 'rdoc/token_stream'
|
177
|
+
autoload :TokenStream, "#{__dir__}/rdoc/token_stream"
|
154
178
|
|
155
|
-
autoload :Comment,
|
179
|
+
autoload :Comment, "#{__dir__}/rdoc/comment"
|
156
180
|
|
157
|
-
|
181
|
+
require_relative 'rdoc/i18n'
|
158
182
|
|
159
183
|
# code objects
|
160
184
|
#
|
161
185
|
# We represent the various high-level code constructs that appear in Ruby
|
162
186
|
# programs: classes, modules, methods, and so on.
|
163
|
-
autoload :CodeObject,
|
164
|
-
|
165
|
-
autoload :Context,
|
166
|
-
autoload :TopLevel,
|
167
|
-
|
168
|
-
autoload :AnonClass,
|
169
|
-
autoload :ClassModule,
|
170
|
-
autoload :NormalClass,
|
171
|
-
autoload :NormalModule,
|
172
|
-
autoload :SingleClass,
|
173
|
-
|
174
|
-
autoload :Alias,
|
175
|
-
autoload :AnyMethod,
|
176
|
-
autoload :MethodAttr,
|
177
|
-
autoload :GhostMethod,
|
178
|
-
autoload :MetaMethod,
|
179
|
-
autoload :Attr,
|
180
|
-
|
181
|
-
autoload :Constant,
|
182
|
-
autoload :Mixin,
|
183
|
-
autoload :Include,
|
184
|
-
autoload :Extend,
|
185
|
-
autoload :Require,
|
187
|
+
autoload :CodeObject, "#{__dir__}/rdoc/code_object"
|
188
|
+
|
189
|
+
autoload :Context, "#{__dir__}/rdoc/code_object/context"
|
190
|
+
autoload :TopLevel, "#{__dir__}/rdoc/code_object/top_level"
|
191
|
+
|
192
|
+
autoload :AnonClass, "#{__dir__}/rdoc/code_object/anon_class"
|
193
|
+
autoload :ClassModule, "#{__dir__}/rdoc/code_object/class_module"
|
194
|
+
autoload :NormalClass, "#{__dir__}/rdoc/code_object/normal_class"
|
195
|
+
autoload :NormalModule, "#{__dir__}/rdoc/code_object/normal_module"
|
196
|
+
autoload :SingleClass, "#{__dir__}/rdoc/code_object/single_class"
|
197
|
+
|
198
|
+
autoload :Alias, "#{__dir__}/rdoc/code_object/alias"
|
199
|
+
autoload :AnyMethod, "#{__dir__}/rdoc/code_object/any_method"
|
200
|
+
autoload :MethodAttr, "#{__dir__}/rdoc/code_object/method_attr"
|
201
|
+
autoload :GhostMethod, "#{__dir__}/rdoc/code_object/ghost_method"
|
202
|
+
autoload :MetaMethod, "#{__dir__}/rdoc/code_object/meta_method"
|
203
|
+
autoload :Attr, "#{__dir__}/rdoc/code_object/attr"
|
204
|
+
|
205
|
+
autoload :Constant, "#{__dir__}/rdoc/code_object/constant"
|
206
|
+
autoload :Mixin, "#{__dir__}/rdoc/code_object/mixin"
|
207
|
+
autoload :Include, "#{__dir__}/rdoc/code_object/include"
|
208
|
+
autoload :Extend, "#{__dir__}/rdoc/code_object/extend"
|
209
|
+
autoload :Require, "#{__dir__}/rdoc/code_object/require"
|
186
210
|
|
187
211
|
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# If this file is exist, RDoc generates and removes documents by rubygems plugins.
|
4
|
+
#
|
5
|
+
# In follwing cases,
|
6
|
+
# RubyGems directly exectute RDoc::RubygemsHook.generation_hook and RDoc::RubygemsHook#remove to generate and remove documents.
|
7
|
+
#
|
8
|
+
# - RDoc is used as a default gem.
|
9
|
+
# - RDoc is a old version that doesn't have rubygems_plugin.rb.
|
10
|
+
|
11
|
+
require_relative 'rdoc/rubygems_hook'
|
12
|
+
|
13
|
+
# To install dependency libraries of RDoc, you need to run bundle install.
|
14
|
+
# At that time, rdoc/markdown is not generated.
|
15
|
+
# If generate and remove are executed at that time, an error will occur.
|
16
|
+
# So, we can't register generate and remove to Gem at that time.
|
17
|
+
begin
|
18
|
+
require_relative 'rdoc/markdown'
|
19
|
+
rescue LoadError
|
20
|
+
else
|
21
|
+
Gem.done_installing(&RDoc::RubyGemsHook.method(:generate))
|
22
|
+
Gem.pre_uninstall(&RDoc::RubyGemsHook.method(:remove))
|
23
|
+
end
|
data/man/ri.1
ADDED
@@ -0,0 +1,247 @@
|
|
1
|
+
.\"Ruby is copyrighted by Yukihiro Matsumoto <matz@netlab.jp>.
|
2
|
+
.Dd April 20, 2017
|
3
|
+
.Dt RI \&1 "Ruby Programmer's Reference Guide"
|
4
|
+
.Os UNIX
|
5
|
+
.Sh NAME
|
6
|
+
.Nm ri
|
7
|
+
.Nd Ruby API reference front end
|
8
|
+
.Sh SYNOPSIS
|
9
|
+
.Nm
|
10
|
+
.Op Fl ahilTv
|
11
|
+
.Op Fl d Ar DIRNAME
|
12
|
+
.Op Fl f Ar FORMAT
|
13
|
+
.Op Fl w Ar WIDTH
|
14
|
+
.Op Fl - Ns Oo Cm no- Oc Ns Cm pager
|
15
|
+
.Op Fl -server Ns Oo = Ns Ar PORT Oc
|
16
|
+
.Op Fl - Ns Oo Cm no- Oc Ns Cm list-doc-dirs
|
17
|
+
.Op Fl -no-standard-docs
|
18
|
+
.Op Fl - Ns Oo Cm no- Oc Ns Bro Cm system Ns | Ns Cm site Ns | Ns Cm gems Ns | Ns Cm home Brc
|
19
|
+
.Op Fl - Ns Oo Cm no- Oc Ns Cm profile
|
20
|
+
.Op Fl -dump Ns = Ns Ar CACHE
|
21
|
+
.Op Ar name ...
|
22
|
+
.Sh DESCRIPTION
|
23
|
+
.Nm
|
24
|
+
is a command-line front end for the Ruby API reference.
|
25
|
+
You can search and read the API reference for classes and methods with
|
26
|
+
.Nm .
|
27
|
+
.Pp
|
28
|
+
.Nm
|
29
|
+
is a part of Ruby.
|
30
|
+
.Pp
|
31
|
+
.Ar name
|
32
|
+
can be:
|
33
|
+
.Bl -diag -offset indent
|
34
|
+
.It Class | Module | Module::Class
|
35
|
+
.Pp
|
36
|
+
.It Class::method | Class#method | Class.method | method
|
37
|
+
.Pp
|
38
|
+
.It gem_name: | gem_name:README | gem_name:History
|
39
|
+
.El
|
40
|
+
.Pp
|
41
|
+
All class names may be abbreviated to their minimum unambiguous form.
|
42
|
+
If a name is ambiguous, all valid options will be listed.
|
43
|
+
.Pp
|
44
|
+
A
|
45
|
+
.Ql \&.
|
46
|
+
matches either class or instance methods, while #method
|
47
|
+
matches only instance and ::method matches only class methods.
|
48
|
+
.Pp
|
49
|
+
README and other files may be displayed by prefixing them with the gem name
|
50
|
+
they're contained in. If the gem name is followed by a
|
51
|
+
.Ql \&:
|
52
|
+
all files in the gem will be shown.
|
53
|
+
The file name extension may be omitted where it is unambiguous.
|
54
|
+
.Pp
|
55
|
+
For example:
|
56
|
+
.Bd -literal -offset indent
|
57
|
+
ri Fil
|
58
|
+
ri File
|
59
|
+
ri File.new
|
60
|
+
ri zip
|
61
|
+
ri rdoc:README
|
62
|
+
.Ed
|
63
|
+
.Pp
|
64
|
+
Note that shell quoting or escaping may be required for method names
|
65
|
+
containing punctuation:
|
66
|
+
.Bd -literal -offset indent
|
67
|
+
ri 'Array.[]'
|
68
|
+
ri compact\e!
|
69
|
+
.Ed
|
70
|
+
.Pp
|
71
|
+
To see the default directories
|
72
|
+
.Nm
|
73
|
+
will search, run:
|
74
|
+
.Bd -literal -offset indent
|
75
|
+
ri --list-doc-dirs
|
76
|
+
.Ed
|
77
|
+
.Pp
|
78
|
+
Specifying the
|
79
|
+
.Fl -system , Fl -site , Fl -home , Fl -gems ,
|
80
|
+
or
|
81
|
+
.Fl -doc-dir
|
82
|
+
options will limit
|
83
|
+
.Nm
|
84
|
+
to searching only the specified directories.
|
85
|
+
.Pp
|
86
|
+
.Nm
|
87
|
+
options may be set in the
|
88
|
+
.Ev RI
|
89
|
+
environment variable.
|
90
|
+
.Pp
|
91
|
+
The
|
92
|
+
.Nm
|
93
|
+
pager can be set with the
|
94
|
+
.Ev RI_PAGER
|
95
|
+
environment variable or the
|
96
|
+
.Ev PAGER
|
97
|
+
environment variable.
|
98
|
+
.Pp
|
99
|
+
.Sh OPTIONS
|
100
|
+
.Bl -tag -width "1234567890123" -compact
|
101
|
+
.Pp
|
102
|
+
.It Fl i
|
103
|
+
.It Fl - Ns Oo Cm no- Oc Ns Cm interactive
|
104
|
+
In interactive mode you can repeatedly
|
105
|
+
look up methods with autocomplete.
|
106
|
+
.Pp
|
107
|
+
.It Fl a
|
108
|
+
.It Fl - Ns Oo Cm no- Oc Ns Cm all
|
109
|
+
Show all documentation for a class or module.
|
110
|
+
.Pp
|
111
|
+
.It Fl l
|
112
|
+
.It Fl - Ns Oo Cm no- Oc Ns Cm list
|
113
|
+
List classes
|
114
|
+
.Nm
|
115
|
+
knows about.
|
116
|
+
.Pp
|
117
|
+
.It Fl - Ns Oo Cm no- Oc Ns Cm pager
|
118
|
+
Send output to a pager,
|
119
|
+
rather than directly to stdout.
|
120
|
+
.Pp
|
121
|
+
.It Fl T
|
122
|
+
Synonym for
|
123
|
+
.Fl -no-pager .
|
124
|
+
.Pp
|
125
|
+
.It Fl w Ar WIDTH
|
126
|
+
.It Fl -width Ns = Ns Ar WIDTH
|
127
|
+
Set the width of the output.
|
128
|
+
.Pp
|
129
|
+
.It Fl -server Ns Oo = Ns Ar PORT Oc
|
130
|
+
Run RDoc server on the given port.
|
131
|
+
The default port is\~8214.
|
132
|
+
.Pp
|
133
|
+
.It Fl f Ar FORMAT
|
134
|
+
.It Fl -format Ns = Ns Ar FORMAT
|
135
|
+
Use the selected formatter.
|
136
|
+
The default formatter is
|
137
|
+
.Li bs
|
138
|
+
for paged output and
|
139
|
+
.Li ansi
|
140
|
+
otherwise.
|
141
|
+
Valid formatters are:
|
142
|
+
.Li ansi , Li bs , Li markdown , Li rdoc .
|
143
|
+
.Pp
|
144
|
+
.It Fl h
|
145
|
+
.It Fl -help
|
146
|
+
Show help and exit.
|
147
|
+
.Pp
|
148
|
+
.It Fl v
|
149
|
+
.It Fl -version
|
150
|
+
Output version information and exit.
|
151
|
+
.El
|
152
|
+
.Pp
|
153
|
+
Data source options:
|
154
|
+
.Bl -tag -width "1234567890123" -compact
|
155
|
+
.Pp
|
156
|
+
.It Fl - Ns Oo Cm no- Oc Ns Cm list-doc-dirs
|
157
|
+
List the directories from which
|
158
|
+
.Nm
|
159
|
+
will source documentation on stdout and exit.
|
160
|
+
.Pp
|
161
|
+
.It Fl d Ar DIRNAME
|
162
|
+
.It Fl -doc-dir Ns = Ns Ar DIRNAME
|
163
|
+
List of directories from which to source
|
164
|
+
documentation in addition to the standard
|
165
|
+
directories. May be repeated.
|
166
|
+
.Pp
|
167
|
+
.It Fl -no-standard-docs
|
168
|
+
Do not include documentation from the Ruby standard library,
|
169
|
+
.Pa site_lib ,
|
170
|
+
installed gems, or
|
171
|
+
.Pa ~/.rdoc .
|
172
|
+
Use with
|
173
|
+
.Fl -doc-dir .
|
174
|
+
.Pp
|
175
|
+
.It Fl - Ns Oo Cm no- Oc Ns Cm system
|
176
|
+
Include documentation from Ruby's standard library. Defaults to true.
|
177
|
+
.Pp
|
178
|
+
.It Fl - Ns Oo Cm no- Oc Ns Cm site
|
179
|
+
Include documentation from libraries installed in
|
180
|
+
.Pa site_lib .
|
181
|
+
Defaults to true.
|
182
|
+
.Pp
|
183
|
+
.It Fl - Ns Oo Cm no- Oc Ns Cm gems
|
184
|
+
Include documentation from RubyGems. Defaults to true.
|
185
|
+
.Pp
|
186
|
+
.It Fl - Ns Oo Cm no- Oc Ns Cm home
|
187
|
+
Include documentation stored in
|
188
|
+
.Pa ~/.rdoc .
|
189
|
+
Defaults to true.
|
190
|
+
.El
|
191
|
+
.Pp
|
192
|
+
Debug options:
|
193
|
+
.Bl -tag -width "1234567890123" -compact
|
194
|
+
.Pp
|
195
|
+
.It Fl - Ns Oo Cm no- Oc Ns Cm profile
|
196
|
+
Run with the Ruby profiler.
|
197
|
+
.Pp
|
198
|
+
.It Fl -dump Ns = Ns Ar CACHE
|
199
|
+
Dump data from an ri cache or data file.
|
200
|
+
.El
|
201
|
+
.Pp
|
202
|
+
.Sh ENVIRONMENT
|
203
|
+
.Bl -tag -width "USERPROFILE" -compact
|
204
|
+
.Pp
|
205
|
+
.It Ev RI
|
206
|
+
Options to prepend to those specified on the command-line.
|
207
|
+
.Pp
|
208
|
+
.It Ev RI_PAGER
|
209
|
+
.It Ev PAGER
|
210
|
+
Pager program to use for displaying.
|
211
|
+
.Pp
|
212
|
+
.It Ev HOME
|
213
|
+
.It Ev USERPROFILE
|
214
|
+
.It Ev HOMEPATH
|
215
|
+
Path to the user's home directory.
|
216
|
+
.El
|
217
|
+
.Pp
|
218
|
+
.Sh FILES
|
219
|
+
.Bl -tag -width "USERPROFILE" -compact
|
220
|
+
.Pp
|
221
|
+
.It Pa ~/.rdoc
|
222
|
+
Path for ri data in the user's home directory.
|
223
|
+
.Pp
|
224
|
+
.El
|
225
|
+
.Pp
|
226
|
+
.Sh SEE ALSO
|
227
|
+
.Xr ruby 1 ,
|
228
|
+
.Xr rdoc 1 ,
|
229
|
+
.Xr gem 1
|
230
|
+
.Pp
|
231
|
+
.Sh REPORTING BUGS
|
232
|
+
.Bl -bullet
|
233
|
+
.It
|
234
|
+
Security vulnerabilities should be reported via an email to
|
235
|
+
.Mt security@ruby-lang.org .
|
236
|
+
Reported problems will be published after being fixed.
|
237
|
+
.Pp
|
238
|
+
.It
|
239
|
+
Other bugs and feature requests can be reported via the
|
240
|
+
Ruby Issue Tracking System
|
241
|
+
.Pq Lk https://bugs.ruby-lang.org/ .
|
242
|
+
Do not report security vulnerabilities
|
243
|
+
via this system because it publishes the vulnerabilities immediately.
|
244
|
+
.El
|
245
|
+
.Sh AUTHORS
|
246
|
+
Written by
|
247
|
+
.An Dave Thomas Aq dave@pragmaticprogrammer.com .
|