rdoc 3.1 → 6.3.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rdoc might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/CONTRIBUTING.rdoc +220 -0
- data/CVE-2013-0256.rdoc +49 -0
- data/ExampleMarkdown.md +37 -0
- data/ExampleRDoc.rdoc +208 -0
- data/Gemfile +12 -0
- data/History.rdoc +1666 -0
- data/LEGAL.rdoc +50 -0
- data/LICENSE.rdoc +57 -0
- data/README.rdoc +129 -0
- data/RI.rdoc +57 -0
- data/Rakefile +84 -81
- data/TODO.rdoc +59 -0
- data/bin/console +7 -0
- data/bin/setup +6 -0
- data/{bin → exe}/rdoc +11 -2
- data/exe/ri +12 -0
- data/lib/rdoc/alias.rb +1 -2
- data/lib/rdoc/anon_class.rb +3 -2
- data/lib/rdoc/any_method.rb +234 -40
- data/lib/rdoc/attr.rb +79 -11
- data/lib/rdoc/class_module.rb +443 -71
- data/lib/rdoc/code_object.rb +216 -20
- data/lib/rdoc/code_objects.rb +4 -21
- data/lib/rdoc/comment.rb +250 -0
- data/lib/rdoc/constant.rb +110 -9
- data/lib/rdoc/context/section.rb +232 -0
- data/lib/rdoc/context.rb +392 -172
- data/lib/rdoc/cross_reference.rb +202 -0
- data/lib/rdoc/encoding.rb +83 -28
- data/lib/rdoc/erb_partial.rb +19 -0
- data/lib/rdoc/erbio.rb +8 -3
- data/lib/rdoc/extend.rb +10 -0
- data/lib/rdoc/generator/darkfish.rb +507 -84
- data/lib/rdoc/generator/json_index.rb +300 -0
- data/lib/rdoc/generator/markup.rb +27 -74
- data/lib/rdoc/generator/pot/message_extractor.rb +68 -0
- data/lib/rdoc/generator/pot/po.rb +84 -0
- data/lib/rdoc/generator/pot/po_entry.rb +141 -0
- data/lib/rdoc/generator/pot.rb +98 -0
- data/lib/rdoc/generator/ri.rb +8 -62
- data/lib/rdoc/generator/template/darkfish/_footer.rhtml +5 -0
- data/lib/rdoc/generator/template/darkfish/_head.rhtml +22 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml +19 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +9 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +15 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml +9 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +15 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +15 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +12 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_navigation.rhtml +11 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +12 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +11 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +14 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +11 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +18 -0
- data/lib/rdoc/generator/template/darkfish/class.rhtml +172 -0
- data/lib/rdoc/generator/template/darkfish/css/fonts.css +167 -0
- data/lib/rdoc/generator/template/darkfish/css/rdoc.css +639 -0
- data/lib/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf +0 -0
- 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/images/add.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/arrow_up.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/delete.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/tag_blue.png +0 -0
- data/lib/rdoc/generator/template/darkfish/images/transparent.png +0 -0
- data/lib/rdoc/generator/template/darkfish/index.rhtml +18 -60
- data/lib/rdoc/generator/template/darkfish/js/darkfish.js +51 -83
- data/lib/rdoc/generator/template/darkfish/js/search.js +110 -0
- data/lib/rdoc/generator/template/darkfish/page.rhtml +18 -0
- data/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +18 -0
- data/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +62 -0
- data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +58 -0
- data/lib/rdoc/generator/template/json_index/.document +1 -0
- data/lib/rdoc/generator/template/json_index/js/navigation.js +105 -0
- data/lib/rdoc/generator/template/json_index/js/searcher.js +229 -0
- data/lib/rdoc/generator.rb +24 -13
- data/lib/rdoc/ghost_method.rb +1 -2
- data/lib/rdoc/i18n/locale.rb +102 -0
- data/lib/rdoc/i18n/text.rb +126 -0
- data/lib/rdoc/i18n.rb +10 -0
- data/lib/rdoc/include.rb +5 -95
- data/lib/rdoc/known_classes.rb +5 -2
- data/lib/rdoc/markdown/entities.rb +2132 -0
- data/lib/rdoc/markdown/literals.kpeg +23 -0
- data/lib/rdoc/markdown/literals.rb +416 -0
- data/lib/rdoc/markdown.kpeg +1237 -0
- data/lib/rdoc/markdown.rb +16684 -0
- data/lib/rdoc/markup/attr_changer.rb +23 -0
- data/lib/rdoc/markup/attr_span.rb +36 -0
- data/lib/rdoc/markup/attribute_manager.rb +135 -62
- data/lib/rdoc/markup/attributes.rb +71 -0
- data/lib/rdoc/markup/blank_line.rb +1 -0
- data/lib/rdoc/markup/block_quote.rb +15 -0
- data/lib/rdoc/markup/document.rb +96 -9
- data/lib/rdoc/markup/formatter.rb +138 -25
- data/lib/rdoc/markup/hard_break.rb +32 -0
- data/lib/rdoc/markup/heading.rb +61 -2
- data/lib/rdoc/markup/include.rb +43 -0
- data/lib/rdoc/markup/indented_paragraph.rb +48 -0
- data/lib/rdoc/markup/list.rb +25 -4
- data/lib/rdoc/markup/list_item.rb +18 -4
- data/lib/rdoc/markup/paragraph.rb +15 -0
- data/lib/rdoc/markup/parser.rb +180 -88
- data/lib/rdoc/markup/pre_process.rb +183 -38
- data/lib/rdoc/markup/raw.rb +6 -5
- data/lib/rdoc/markup/regexp_handling.rb +41 -0
- data/lib/rdoc/markup/rule.rb +1 -0
- data/lib/rdoc/markup/table.rb +47 -0
- data/lib/rdoc/markup/to_ansi.rb +17 -7
- data/lib/rdoc/markup/to_bs.rb +5 -8
- data/lib/rdoc/markup/to_html.rb +238 -137
- data/lib/rdoc/markup/to_html_crossref.rb +125 -152
- data/lib/rdoc/markup/to_html_snippet.rb +285 -0
- data/lib/rdoc/markup/to_joined_paragraph.rb +47 -0
- data/lib/rdoc/markup/to_label.rb +75 -0
- data/lib/rdoc/markup/to_markdown.rb +192 -0
- data/lib/rdoc/markup/to_rdoc.rb +85 -15
- data/lib/rdoc/markup/to_table_of_contents.rb +89 -0
- data/lib/rdoc/markup/to_test.rb +2 -4
- data/lib/rdoc/markup/to_tt_only.rb +121 -0
- data/lib/rdoc/markup/verbatim.rb +39 -0
- data/lib/rdoc/markup.rb +388 -110
- data/lib/rdoc/meta_method.rb +1 -2
- data/lib/rdoc/method_attr.rb +87 -21
- data/lib/rdoc/mixin.rb +121 -0
- data/lib/rdoc/normal_class.rb +39 -10
- data/lib/rdoc/normal_module.rb +22 -7
- data/lib/rdoc/options.rb +613 -73
- data/lib/rdoc/parser/c.rb +621 -287
- data/lib/rdoc/parser/changelog.rb +335 -0
- data/lib/rdoc/parser/markdown.rb +24 -0
- data/lib/rdoc/parser/rd.rb +23 -0
- data/lib/rdoc/parser/ripper_state_lex.rb +590 -0
- data/lib/rdoc/parser/ruby.rb +1368 -762
- data/lib/rdoc/parser/ruby_tools.rb +42 -35
- data/lib/rdoc/parser/simple.rb +23 -11
- data/lib/rdoc/parser/text.rb +12 -0
- data/lib/rdoc/parser.rb +162 -89
- data/lib/rdoc/rd/block_parser.rb +1056 -0
- data/lib/rdoc/rd/block_parser.ry +639 -0
- data/lib/rdoc/rd/inline.rb +72 -0
- data/lib/rdoc/rd/inline_parser.rb +1208 -0
- data/lib/rdoc/rd/inline_parser.ry +593 -0
- data/lib/rdoc/rd.rb +100 -0
- data/lib/rdoc/rdoc.rb +208 -115
- data/lib/rdoc/require.rb +1 -2
- data/lib/rdoc/ri/driver.rb +734 -239
- data/lib/rdoc/ri/formatter.rb +1 -0
- data/lib/rdoc/ri/paths.rb +91 -48
- data/lib/rdoc/ri/store.rb +3 -261
- data/lib/rdoc/ri/task.rb +71 -0
- data/lib/rdoc/ri.rb +5 -2
- data/lib/rdoc/rubygems_hook.rb +246 -0
- data/lib/rdoc/servlet.rb +451 -0
- data/lib/rdoc/single_class.rb +14 -2
- data/lib/rdoc/stats/normal.rb +19 -12
- data/lib/rdoc/stats/quiet.rb +1 -0
- data/lib/rdoc/stats/verbose.rb +1 -0
- data/lib/rdoc/stats.rb +262 -104
- data/lib/rdoc/store.rb +979 -0
- data/lib/rdoc/task.rb +84 -44
- data/lib/rdoc/text.rb +117 -72
- data/lib/rdoc/token_stream.rb +73 -4
- data/lib/rdoc/tom_doc.rb +263 -0
- data/lib/rdoc/top_level.rb +111 -261
- data/lib/rdoc/version.rb +8 -0
- data/lib/rdoc.rb +127 -64
- data/man/ri.1 +247 -0
- data/rdoc.gemspec +249 -0
- metadata +171 -291
- data/.autotest +0 -16
- data/.document +0 -5
- data/History.txt +0 -594
- data/LICENSE.txt +0 -57
- data/Manifest.txt +0 -158
- data/README.txt +0 -45
- data/RI.txt +0 -58
- data/bin/ri +0 -5
- data/lib/rdoc/gauntlet.rb +0 -52
- data/lib/rdoc/generator/template/darkfish/classpage.rhtml +0 -296
- data/lib/rdoc/generator/template/darkfish/filepage.rhtml +0 -124
- data/lib/rdoc/generator/template/darkfish/js/jquery.js +0 -32
- data/lib/rdoc/generator/template/darkfish/js/quicksearch.js +0 -114
- data/lib/rdoc/generator/template/darkfish/js/thickbox-compressed.js +0 -10
- data/lib/rdoc/generator/template/darkfish/rdoc.css +0 -706
- data/lib/rdoc/markup/formatter_test_case.rb +0 -689
- data/lib/rdoc/markup/inline.rb +0 -137
- data/lib/rdoc/markup/text_formatter_test_case.rb +0 -116
- data/lib/rdoc/ruby_lex.rb +0 -1291
- data/lib/rdoc/ruby_token.rb +0 -416
- data/test/README +0 -1
- data/test/binary.dat +0 -0
- data/test/hidden.zip.txt +0 -1
- data/test/test.ja.rdoc +0 -10
- data/test/test.ja.txt +0 -8
- data/test/test.txt +0 -1
- data/test/test_attribute_manager.rb +0 -120
- data/test/test_rdoc_alias.rb +0 -13
- data/test/test_rdoc_any_method.rb +0 -126
- data/test/test_rdoc_attr.rb +0 -61
- data/test/test_rdoc_class_module.rb +0 -233
- data/test/test_rdoc_code_object.rb +0 -165
- data/test/test_rdoc_constant.rb +0 -15
- data/test/test_rdoc_context.rb +0 -370
- data/test/test_rdoc_encoding.rb +0 -166
- data/test/test_rdoc_generator_darkfish.rb +0 -119
- data/test/test_rdoc_generator_ri.rb +0 -76
- data/test/test_rdoc_include.rb +0 -96
- data/test/test_rdoc_markup.rb +0 -37
- data/test/test_rdoc_markup_attribute_manager.rb +0 -240
- data/test/test_rdoc_markup_document.rb +0 -51
- data/test/test_rdoc_markup_paragraph.rb +0 -9
- data/test/test_rdoc_markup_parser.rb +0 -1395
- data/test/test_rdoc_markup_pre_process.rb +0 -185
- data/test/test_rdoc_markup_raw.rb +0 -27
- data/test/test_rdoc_markup_to_ansi.rb +0 -328
- data/test/test_rdoc_markup_to_bs.rb +0 -341
- data/test/test_rdoc_markup_to_html.rb +0 -335
- data/test/test_rdoc_markup_to_html_crossref.rb +0 -169
- data/test/test_rdoc_markup_to_rdoc.rb +0 -327
- data/test/test_rdoc_method_attr.rb +0 -122
- data/test/test_rdoc_normal_class.rb +0 -17
- data/test/test_rdoc_normal_module.rb +0 -31
- data/test/test_rdoc_options.rb +0 -342
- data/test/test_rdoc_parser.rb +0 -83
- data/test/test_rdoc_parser_c.rb +0 -912
- data/test/test_rdoc_parser_ruby.rb +0 -1754
- data/test/test_rdoc_parser_simple.rb +0 -99
- data/test/test_rdoc_rdoc.rb +0 -164
- data/test/test_rdoc_require.rb +0 -25
- data/test/test_rdoc_ri_driver.rb +0 -846
- data/test/test_rdoc_ri_paths.rb +0 -43
- data/test/test_rdoc_ri_store.rb +0 -352
- data/test/test_rdoc_ruby_lex.rb +0 -23
- data/test/test_rdoc_stats.rb +0 -38
- data/test/test_rdoc_task.rb +0 -92
- data/test/test_rdoc_text.rb +0 -251
- data/test/test_rdoc_top_level.rb +0 -120
- data/test/xref_data.rb +0 -62
- data/test/xref_test_case.rb +0 -61
- data.tar.gz.sig +0 -3
- metadata.gz.sig +0 -0
data/lib/rdoc.rb
CHANGED
@@ -1,77 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
$DEBUG_RDOC = nil
|
2
3
|
|
3
|
-
# :main: README.
|
4
|
+
# :main: README.rdoc
|
4
5
|
|
5
6
|
##
|
6
|
-
#
|
7
|
-
#
|
8
|
-
#
|
9
|
-
#
|
10
|
-
#
|
11
|
-
# modules, and methods (along with includes and requires). It associates with
|
12
|
-
# these optional documentation contained in the immediately preceding comment
|
13
|
-
# block, and then renders the result using a pluggable output formatter.
|
14
|
-
# RDoc::Markup is a library that converts plain text into various output
|
15
|
-
# formats. The markup library is used to interpret the comment blocks that
|
16
|
-
# RDoc uses to document methods, classes, and so on.
|
7
|
+
# RDoc produces documentation for Ruby source files by parsing the source and
|
8
|
+
# extracting the definition for classes, modules, methods, includes and
|
9
|
+
# requires. It associates these with optional documentation contained in an
|
10
|
+
# immediately preceding comment block then renders the result using an output
|
11
|
+
# formatter.
|
17
12
|
#
|
18
|
-
#
|
13
|
+
# For a simple introduction to writing or generating documentation using RDoc
|
14
|
+
# see the README.
|
19
15
|
#
|
20
|
-
#
|
21
|
-
# read the summary below, and refer to <tt>rdoc --help</tt> for command line
|
22
|
-
# usage, and RDoc::Markup for a detailed description of RDoc's markup.
|
23
|
-
# * If you want to generate documentation for extensions written in C, see
|
24
|
-
# RDoc::Parser::C
|
25
|
-
# * If you want to drive RDoc programmatically, see RDoc::RDoc.
|
26
|
-
# * If you want to use the library to format text blocks into HTML, look at
|
27
|
-
# RDoc::Markup.
|
28
|
-
# * If you want to make an RDoc plugin such as a generator or directive
|
29
|
-
# handler see RDoc::RDoc.
|
30
|
-
# * If you want to try writing your own output generator see RDoc::Generator.
|
16
|
+
# == Roadmap
|
31
17
|
#
|
32
|
-
#
|
18
|
+
# If you think you found a bug in RDoc see CONTRIBUTING@Bugs
|
33
19
|
#
|
34
|
-
#
|
20
|
+
# If you want to use RDoc to create documentation for your Ruby source files,
|
21
|
+
# see RDoc::Markup and refer to <tt>rdoc --help</tt> for command line usage.
|
35
22
|
#
|
36
|
-
#
|
23
|
+
# If you want to set the default markup format see
|
24
|
+
# RDoc::Markup@Supported+Formats
|
37
25
|
#
|
38
|
-
#
|
26
|
+
# If you want to store rdoc configuration in your gem (such as the default
|
27
|
+
# markup format) see RDoc::Options@Saved+Options
|
39
28
|
#
|
40
|
-
#
|
29
|
+
# If you want to write documentation for Ruby files see RDoc::Parser::Ruby
|
41
30
|
#
|
42
|
-
#
|
43
|
-
#
|
31
|
+
# If you want to write documentation for extensions written in C see
|
32
|
+
# RDoc::Parser::C
|
44
33
|
#
|
45
|
-
#
|
34
|
+
# If you want to generate documentation using <tt>rake</tt> see RDoc::Task.
|
46
35
|
#
|
47
|
-
#
|
48
|
-
# files in and below the current directory. These will be stored in a
|
49
|
-
# documentation tree starting in the subdirectory +doc+.
|
36
|
+
# If you want to drive RDoc programmatically, see RDoc::RDoc.
|
50
37
|
#
|
51
|
-
#
|
52
|
-
#
|
53
|
-
# case, we could type
|
38
|
+
# If you want to use the library to format text blocks into HTML or other
|
39
|
+
# formats, look at RDoc::Markup.
|
54
40
|
#
|
55
|
-
#
|
41
|
+
# If you want to make an RDoc plugin such as a generator or directive handler
|
42
|
+
# see RDoc::RDoc.
|
56
43
|
#
|
57
|
-
#
|
58
|
-
# in comment blocks in the documentation this generates.
|
44
|
+
# If you want to write your own output generator see RDoc::Generator.
|
59
45
|
#
|
60
|
-
#
|
61
|
-
# ending +.rb+ and +.rbw+ are assumed to be Ruby source. Files
|
62
|
-
# ending +.c+ are parsed as C files. All other files are assumed to
|
63
|
-
# contain just Markup-style markup (with or without leading '#' comment
|
64
|
-
# markers). If directory names are passed to RDoc, they are scanned
|
65
|
-
# recursively for C and Ruby source files only.
|
46
|
+
# If you want an overview of how RDoc works see CONTRIBUTING
|
66
47
|
#
|
67
|
-
# ==
|
48
|
+
# == Credits
|
68
49
|
#
|
69
50
|
# RDoc is currently being maintained by Eric Hodel <drbrain@segment7.net>.
|
70
51
|
#
|
71
52
|
# Dave Thomas <dave@pragmaticprogrammer.com> is the original author of RDoc.
|
72
53
|
#
|
73
|
-
# == Credits
|
74
|
-
#
|
75
54
|
# * The Ruby parser in rdoc/parse.rb is based heavily on the outstanding
|
76
55
|
# work of Keiju ISHITSUKA of Nippon Rational Inc, who produced the Ruby
|
77
56
|
# parser for irb and the rtags package.
|
@@ -83,19 +62,7 @@ module RDoc
|
|
83
62
|
|
84
63
|
class Error < RuntimeError; end
|
85
64
|
|
86
|
-
|
87
|
-
if const_name.to_s == 'RDocError' then
|
88
|
-
warn "RDoc::RDocError is deprecated"
|
89
|
-
return Error
|
90
|
-
end
|
91
|
-
|
92
|
-
super
|
93
|
-
end
|
94
|
-
|
95
|
-
##
|
96
|
-
# RDoc version you are using
|
97
|
-
|
98
|
-
VERSION = '3.1'
|
65
|
+
require 'rdoc/version'
|
99
66
|
|
100
67
|
##
|
101
68
|
# Method visibilities
|
@@ -134,5 +101,101 @@ module RDoc
|
|
134
101
|
METHOD_MODIFIERS = GENERAL_MODIFIERS +
|
135
102
|
%w[arg args yield yields notnew not-new not_new doc]
|
136
103
|
|
137
|
-
|
104
|
+
##
|
105
|
+
# Loads the best available YAML library.
|
106
|
+
|
107
|
+
def self.load_yaml
|
108
|
+
begin
|
109
|
+
gem 'psych'
|
110
|
+
rescue NameError => e # --disable-gems
|
111
|
+
raise unless e.name == :gem
|
112
|
+
rescue Gem::LoadError
|
113
|
+
end
|
114
|
+
|
115
|
+
begin
|
116
|
+
require 'psych'
|
117
|
+
rescue ::LoadError
|
118
|
+
ensure
|
119
|
+
require 'yaml'
|
120
|
+
end
|
121
|
+
end
|
138
122
|
|
123
|
+
def self.home
|
124
|
+
rdoc_dir = begin
|
125
|
+
File.expand_path('~/.rdoc')
|
126
|
+
rescue ArgumentError
|
127
|
+
end
|
128
|
+
|
129
|
+
if File.directory?(rdoc_dir)
|
130
|
+
rdoc_dir
|
131
|
+
else
|
132
|
+
begin
|
133
|
+
# XDG
|
134
|
+
xdg_data_home = ENV["XDG_DATA_HOME"] || File.join(File.expand_path("~"), '.local', 'share')
|
135
|
+
unless File.exist?(xdg_data_home)
|
136
|
+
FileUtils.mkdir_p xdg_data_home
|
137
|
+
end
|
138
|
+
File.join xdg_data_home, "rdoc"
|
139
|
+
rescue Errno::EACCES
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
autoload :RDoc, 'rdoc/rdoc'
|
145
|
+
|
146
|
+
autoload :CrossReference, 'rdoc/cross_reference'
|
147
|
+
autoload :ERBIO, 'rdoc/erbio'
|
148
|
+
autoload :ERBPartial, 'rdoc/erb_partial'
|
149
|
+
autoload :Encoding, 'rdoc/encoding'
|
150
|
+
autoload :Generator, 'rdoc/generator'
|
151
|
+
autoload :Options, 'rdoc/options'
|
152
|
+
autoload :Parser, 'rdoc/parser'
|
153
|
+
autoload :Servlet, 'rdoc/servlet'
|
154
|
+
autoload :RI, 'rdoc/ri'
|
155
|
+
autoload :Stats, 'rdoc/stats'
|
156
|
+
autoload :Store, 'rdoc/store'
|
157
|
+
autoload :Task, 'rdoc/task'
|
158
|
+
autoload :Text, 'rdoc/text'
|
159
|
+
|
160
|
+
autoload :Markdown, 'rdoc/markdown'
|
161
|
+
autoload :Markup, 'rdoc/markup'
|
162
|
+
autoload :RD, 'rdoc/rd'
|
163
|
+
autoload :TomDoc, 'rdoc/tom_doc'
|
164
|
+
|
165
|
+
autoload :KNOWN_CLASSES, 'rdoc/known_classes'
|
166
|
+
|
167
|
+
autoload :TokenStream, 'rdoc/token_stream'
|
168
|
+
|
169
|
+
autoload :Comment, 'rdoc/comment'
|
170
|
+
|
171
|
+
require 'rdoc/i18n'
|
172
|
+
|
173
|
+
# code objects
|
174
|
+
#
|
175
|
+
# We represent the various high-level code constructs that appear in Ruby
|
176
|
+
# programs: classes, modules, methods, and so on.
|
177
|
+
autoload :CodeObject, 'rdoc/code_object'
|
178
|
+
|
179
|
+
autoload :Context, 'rdoc/context'
|
180
|
+
autoload :TopLevel, 'rdoc/top_level'
|
181
|
+
|
182
|
+
autoload :AnonClass, 'rdoc/anon_class'
|
183
|
+
autoload :ClassModule, 'rdoc/class_module'
|
184
|
+
autoload :NormalClass, 'rdoc/normal_class'
|
185
|
+
autoload :NormalModule, 'rdoc/normal_module'
|
186
|
+
autoload :SingleClass, 'rdoc/single_class'
|
187
|
+
|
188
|
+
autoload :Alias, 'rdoc/alias'
|
189
|
+
autoload :AnyMethod, 'rdoc/any_method'
|
190
|
+
autoload :MethodAttr, 'rdoc/method_attr'
|
191
|
+
autoload :GhostMethod, 'rdoc/ghost_method'
|
192
|
+
autoload :MetaMethod, 'rdoc/meta_method'
|
193
|
+
autoload :Attr, 'rdoc/attr'
|
194
|
+
|
195
|
+
autoload :Constant, 'rdoc/constant'
|
196
|
+
autoload :Mixin, 'rdoc/mixin'
|
197
|
+
autoload :Include, 'rdoc/include'
|
198
|
+
autoload :Extend, 'rdoc/extend'
|
199
|
+
autoload :Require, 'rdoc/require'
|
200
|
+
|
201
|
+
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 .
|