rdoc 6.1.0 → 6.3.0
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 +4 -4
- data/Gemfile +9 -0
- data/README.rdoc +0 -1
- data/Rakefile +12 -4
- data/lib/rdoc.rb +21 -0
- data/lib/rdoc/any_method.rb +52 -7
- data/lib/rdoc/class_module.rb +1 -1
- data/lib/rdoc/comment.rb +12 -1
- data/lib/rdoc/context.rb +10 -2
- data/lib/rdoc/context/section.rb +0 -13
- data/lib/rdoc/cross_reference.rb +4 -4
- data/lib/rdoc/erb_partial.rb +1 -1
- data/lib/rdoc/erbio.rb +2 -2
- data/lib/rdoc/generator/darkfish.rb +9 -9
- data/lib/rdoc/generator/pot.rb +3 -3
- data/lib/rdoc/generator/template/darkfish/_head.rhtml +9 -7
- data/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml +2 -2
- data/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +2 -2
- data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +7 -7
- data/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml +2 -2
- 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 +5 -5
- data/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +5 -5
- data/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +5 -5
- data/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +4 -4
- data/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +4 -4
- data/lib/rdoc/generator/template/darkfish/class.rhtml +44 -44
- data/lib/rdoc/generator/template/darkfish/css/rdoc.css +35 -6
- data/lib/rdoc/generator/template/darkfish/index.rhtml +3 -4
- data/lib/rdoc/generator/template/darkfish/js/darkfish.js +22 -99
- data/lib/rdoc/generator/template/darkfish/js/search.js +32 -31
- data/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +15 -16
- data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +16 -16
- data/lib/rdoc/generator/template/json_index/js/navigation.js +4 -40
- data/lib/rdoc/generator/template/json_index/js/searcher.js +6 -6
- data/lib/rdoc/i18n.rb +1 -1
- data/lib/rdoc/markdown.kpeg +1 -1
- data/lib/rdoc/markdown.rb +16287 -0
- data/lib/rdoc/markdown/literals.rb +417 -0
- data/lib/rdoc/markup.rb +0 -2
- data/lib/rdoc/markup/formatter.rb +1 -1
- data/lib/rdoc/markup/parser.rb +58 -42
- data/lib/rdoc/markup/pre_process.rb +1 -1
- data/lib/rdoc/markup/regexp_handling.rb +41 -0
- data/lib/rdoc/markup/to_html.rb +19 -6
- data/lib/rdoc/markup/to_html_crossref.rb +18 -6
- data/lib/rdoc/options.rb +23 -5
- data/lib/rdoc/parser.rb +7 -7
- data/lib/rdoc/parser/c.rb +139 -183
- data/lib/rdoc/parser/ripper_state_lex.rb +2 -1
- data/lib/rdoc/parser/ruby.rb +18 -8
- data/lib/rdoc/rd/block_parser.rb +1056 -0
- data/lib/rdoc/rd/inline_parser.rb +1208 -0
- data/lib/rdoc/rdoc.rb +26 -20
- data/lib/rdoc/ri/driver.rb +9 -5
- data/lib/rdoc/ri/paths.rb +3 -17
- data/lib/rdoc/ri/task.rb +1 -1
- data/lib/rdoc/rubygems_hook.rb +2 -2
- data/lib/rdoc/servlet.rb +16 -8
- data/lib/rdoc/store.rb +6 -14
- data/lib/rdoc/task.rb +1 -1
- data/lib/rdoc/text.rb +8 -2
- data/lib/rdoc/token_stream.rb +8 -3
- data/lib/rdoc/tom_doc.rb +6 -7
- data/lib/rdoc/version.rb +1 -1
- data/man/ri.1 +247 -0
- data/rdoc.gemspec +194 -10
- metadata +10 -86
- data/.document +0 -5
- data/.gitignore +0 -14
- data/.travis.yml +0 -21
- data/appveyor.yml +0 -36
- data/lib/rdoc/generator/template/darkfish/js/jquery.js +0 -4
- data/lib/rdoc/markup/formatter_test_case.rb +0 -764
- data/lib/rdoc/markup/text_formatter_test_case.rb +0 -115
data/lib/rdoc/rdoc.rb
CHANGED
@@ -24,7 +24,7 @@ require 'time'
|
|
24
24
|
# rdoc.document argv
|
25
25
|
#
|
26
26
|
# Where +argv+ is an array of strings, each corresponding to an argument you'd
|
27
|
-
# give rdoc on the command line. See <tt>rdoc --help
|
27
|
+
# give rdoc on the command line. See <tt>rdoc --help</tt> for details.
|
28
28
|
|
29
29
|
class RDoc::RDoc
|
30
30
|
|
@@ -112,11 +112,17 @@ class RDoc::RDoc
|
|
112
112
|
|
113
113
|
file_list = normalized_file_list files, true, @options.exclude
|
114
114
|
|
115
|
-
file_list = file_list
|
115
|
+
file_list = remove_unparseable(file_list)
|
116
116
|
|
117
|
-
file_list
|
118
|
-
|
119
|
-
|
117
|
+
if file_list.count {|name, mtime|
|
118
|
+
file_list[name] = @last_modified[name] unless mtime
|
119
|
+
mtime
|
120
|
+
} > 0
|
121
|
+
@last_modified.replace file_list
|
122
|
+
file_list.keys.sort
|
123
|
+
else
|
124
|
+
[]
|
125
|
+
end
|
120
126
|
end
|
121
127
|
|
122
128
|
##
|
@@ -254,11 +260,11 @@ option)
|
|
254
260
|
# read and strip comments
|
255
261
|
patterns = File.read(filename).gsub(/#.*/, '')
|
256
262
|
|
257
|
-
result =
|
263
|
+
result = {}
|
258
264
|
|
259
|
-
patterns.split.each do |patt|
|
265
|
+
patterns.split(' ').each do |patt|
|
260
266
|
candidates = Dir.glob(File.join(in_dir, patt))
|
261
|
-
result.
|
267
|
+
result.update normalized_file_list(candidates, false, @options.exclude)
|
262
268
|
end
|
263
269
|
|
264
270
|
result
|
@@ -278,21 +284,21 @@ option)
|
|
278
284
|
|
279
285
|
def normalized_file_list(relative_files, force_doc = false,
|
280
286
|
exclude_pattern = nil)
|
281
|
-
file_list =
|
287
|
+
file_list = {}
|
282
288
|
|
283
289
|
relative_files.each do |rel_file_name|
|
290
|
+
rel_file_name = rel_file_name.sub(/^\.\//, '')
|
284
291
|
next if rel_file_name.end_with? 'created.rid'
|
285
292
|
next if exclude_pattern && exclude_pattern =~ rel_file_name
|
286
293
|
stat = File.stat rel_file_name rescue next
|
287
294
|
|
288
295
|
case type = stat.ftype
|
289
296
|
when "file" then
|
290
|
-
|
291
|
-
|
297
|
+
mtime = (stat.mtime unless (last_modified = @last_modified[rel_file_name] and
|
298
|
+
stat.mtime.to_i <= last_modified.to_i))
|
292
299
|
|
293
300
|
if force_doc or RDoc::Parser.can_parse(rel_file_name) then
|
294
|
-
file_list
|
295
|
-
@last_modified[rel_file_name] = stat.mtime
|
301
|
+
file_list[rel_file_name] = mtime
|
296
302
|
end
|
297
303
|
when "directory" then
|
298
304
|
next if rel_file_name == "CVS" || rel_file_name == ".svn"
|
@@ -303,16 +309,16 @@ option)
|
|
303
309
|
dot_doc = File.join rel_file_name, RDoc::DOT_DOC_FILENAME
|
304
310
|
|
305
311
|
if File.file? dot_doc then
|
306
|
-
file_list
|
312
|
+
file_list.update(parse_dot_doc_file(rel_file_name, dot_doc))
|
307
313
|
else
|
308
|
-
file_list
|
314
|
+
file_list.update(list_files_in_directory(rel_file_name))
|
309
315
|
end
|
310
316
|
else
|
311
317
|
warn "rdoc can't parse the #{type} #{rel_file_name}"
|
312
318
|
end
|
313
319
|
end
|
314
320
|
|
315
|
-
file_list
|
321
|
+
file_list
|
316
322
|
end
|
317
323
|
|
318
324
|
##
|
@@ -427,7 +433,7 @@ The internal error was:
|
|
427
433
|
# files for emacs and vim.
|
428
434
|
|
429
435
|
def remove_unparseable files
|
430
|
-
files.reject do |file
|
436
|
+
files.reject do |file, *|
|
431
437
|
file =~ /\.(?:class|eps|erb|scpt\.txt|svg|ttf|yml)$/i or
|
432
438
|
(file =~ /tags$/i and
|
433
439
|
open(file, 'rb') { |io|
|
@@ -561,6 +567,6 @@ rescue LoadError
|
|
561
567
|
end
|
562
568
|
|
563
569
|
# require built-in generators after discovery in case they've been replaced
|
564
|
-
|
565
|
-
|
566
|
-
|
570
|
+
require_relative 'generator/darkfish'
|
571
|
+
require_relative 'generator/ri'
|
572
|
+
require_relative 'generator/pot'
|
data/lib/rdoc/ri/driver.rb
CHANGED
@@ -17,7 +17,7 @@ require 'rdoc'
|
|
17
17
|
##
|
18
18
|
# For RubyGems backwards compatibility
|
19
19
|
|
20
|
-
|
20
|
+
require_relative 'formatter'
|
21
21
|
|
22
22
|
##
|
23
23
|
# The RI driver implements the command-line ri tool.
|
@@ -356,7 +356,7 @@ or the PAGER environment variable.
|
|
356
356
|
end
|
357
357
|
end
|
358
358
|
|
359
|
-
argv = ENV['RI'].to_s.split.concat argv
|
359
|
+
argv = ENV['RI'].to_s.split(' ').concat argv
|
360
360
|
|
361
361
|
opts.parse! argv
|
362
362
|
|
@@ -1228,7 +1228,7 @@ or the PAGER environment variable.
|
|
1228
1228
|
# +cache+ indicate if it is a class or instance method.
|
1229
1229
|
|
1230
1230
|
def load_method store, cache, klass, type, name
|
1231
|
-
methods = store.
|
1231
|
+
methods = store.public_send(cache)[klass]
|
1232
1232
|
|
1233
1233
|
return unless methods
|
1234
1234
|
|
@@ -1521,7 +1521,7 @@ or the PAGER environment variable.
|
|
1521
1521
|
pagers.compact.uniq.each do |pager|
|
1522
1522
|
next unless pager
|
1523
1523
|
|
1524
|
-
pager_cmd = pager.split.first
|
1524
|
+
pager_cmd = pager.split(' ').first
|
1525
1525
|
|
1526
1526
|
next unless in_path? pager_cmd
|
1527
1527
|
|
@@ -1551,7 +1551,11 @@ or the PAGER environment variable.
|
|
1551
1551
|
# Starts a WEBrick server for ri.
|
1552
1552
|
|
1553
1553
|
def start_server
|
1554
|
-
|
1554
|
+
begin
|
1555
|
+
require 'webrick'
|
1556
|
+
rescue LoadError
|
1557
|
+
abort "webrick is not found. You may need to `gem install webrick` to install webrick."
|
1558
|
+
end
|
1555
1559
|
|
1556
1560
|
server = WEBrick::HTTPServer.new :Port => @server
|
1557
1561
|
|
data/lib/rdoc/ri/paths.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
|
2
|
+
require_relative '../rdoc'
|
3
3
|
|
4
4
|
##
|
5
5
|
# The directories where ri data lives. Paths can be enumerated via ::each, or
|
@@ -12,23 +12,9 @@ module RDoc::RI::Paths
|
|
12
12
|
|
13
13
|
version = RbConfig::CONFIG['ruby_version']
|
14
14
|
|
15
|
-
BASE =
|
16
|
-
File.join RbConfig::CONFIG['ridir'], version
|
17
|
-
else
|
18
|
-
File.join RbConfig::CONFIG['datadir'], 'ri', version
|
19
|
-
end
|
15
|
+
BASE = File.join RbConfig::CONFIG['ridir'], version
|
20
16
|
|
21
|
-
|
22
|
-
File.expand_path('~')
|
23
|
-
rescue ArgumentError
|
24
|
-
end
|
25
|
-
|
26
|
-
homedir ||= ENV['HOME'] ||
|
27
|
-
ENV['USERPROFILE'] || ENV['HOMEPATH'] # for 1.8 compatibility
|
28
|
-
|
29
|
-
HOMEDIR = if homedir then
|
30
|
-
File.join homedir, ".rdoc"
|
31
|
-
end
|
17
|
+
HOMEDIR = RDoc.home
|
32
18
|
#:startdoc:
|
33
19
|
|
34
20
|
##
|
data/lib/rdoc/ri/task.rb
CHANGED
data/lib/rdoc/rubygems_hook.rb
CHANGED
@@ -70,7 +70,7 @@ class RDoc::RubygemsHook
|
|
70
70
|
def self.load_rdoc
|
71
71
|
return if @rdoc_version
|
72
72
|
|
73
|
-
|
73
|
+
require_relative 'rdoc'
|
74
74
|
|
75
75
|
@rdoc_version = Gem::Version.new ::RDoc::VERSION
|
76
76
|
end
|
@@ -158,7 +158,7 @@ class RDoc::RubygemsHook
|
|
158
158
|
|
159
159
|
case config_args = Gem.configuration[:rdoc]
|
160
160
|
when String then
|
161
|
-
args = args.concat config_args.split
|
161
|
+
args = args.concat config_args.split(' ')
|
162
162
|
when Array then
|
163
163
|
args = args.concat config_args
|
164
164
|
end
|
data/lib/rdoc/servlet.rb
CHANGED
@@ -3,7 +3,12 @@ require 'rdoc'
|
|
3
3
|
require 'erb'
|
4
4
|
require 'time'
|
5
5
|
require 'json'
|
6
|
-
|
6
|
+
|
7
|
+
begin
|
8
|
+
require 'webrick'
|
9
|
+
rescue LoadError
|
10
|
+
abort "webrick is not found. You may need to `gem install webrick` to install webrick."
|
11
|
+
end
|
7
12
|
|
8
13
|
##
|
9
14
|
# This is a WEBrick servlet that allows you to browse ri documentation.
|
@@ -102,9 +107,9 @@ class RDoc::Servlet < WEBrick::HTTPServlet::AbstractServlet
|
|
102
107
|
res.body = File.read asset_path
|
103
108
|
|
104
109
|
res.content_type = case req.path
|
105
|
-
when /
|
106
|
-
when /
|
107
|
-
else
|
110
|
+
when /\.css\z/ then 'text/css'
|
111
|
+
when /\.js\z/ then 'application/javascript'
|
112
|
+
else 'application/octet-stream'
|
108
113
|
end
|
109
114
|
end
|
110
115
|
|
@@ -112,7 +117,7 @@ class RDoc::Servlet < WEBrick::HTTPServlet::AbstractServlet
|
|
112
117
|
# GET request entry point. Fills in +res+ for the path, etc. in +req+.
|
113
118
|
|
114
119
|
def do_GET req, res
|
115
|
-
req.path.sub!(
|
120
|
+
req.path.sub!(/\A#{Regexp.escape @mount_path}/, '') if @mount_path
|
116
121
|
|
117
122
|
case req.path
|
118
123
|
when '/' then
|
@@ -145,11 +150,14 @@ class RDoc::Servlet < WEBrick::HTTPServlet::AbstractServlet
|
|
145
150
|
# +generator+ is used to create the page.
|
146
151
|
|
147
152
|
def documentation_page store, generator, path, req, res
|
148
|
-
|
153
|
+
text_name = path.chomp '.html'
|
154
|
+
name = text_name.gsub '/', '::'
|
149
155
|
|
150
156
|
if klass = store.find_class_or_module(name) then
|
151
157
|
res.body = generator.generate_class klass
|
152
|
-
elsif page = store.find_text_page(name.sub(/_([^_]*)
|
158
|
+
elsif page = store.find_text_page(name.sub(/_([^_]*)\z/, '.\1')) then
|
159
|
+
res.body = generator.generate_page page
|
160
|
+
elsif page = store.find_text_page(text_name.sub(/_([^_]*)\z/, '.\1')) then
|
153
161
|
res.body = generator.generate_page page
|
154
162
|
else
|
155
163
|
not_found generator, req, res
|
@@ -416,7 +424,7 @@ version. If you're viewing Ruby's documentation, include the version of ruby.
|
|
416
424
|
RDoc::Store.new RDoc::RI::Paths.system_dir, :system
|
417
425
|
when 'site' then
|
418
426
|
RDoc::Store.new RDoc::RI::Paths.site_dir, :site
|
419
|
-
when
|
427
|
+
when /\Aextra-(\d+)\z/ then
|
420
428
|
index = $1.to_i - 1
|
421
429
|
ri_dir = installed_docs[index][4]
|
422
430
|
RDoc::Store.new ri_dir, :extra
|
data/lib/rdoc/store.rb
CHANGED
@@ -482,7 +482,7 @@ class RDoc::Store
|
|
482
482
|
when :gem then
|
483
483
|
parent = File.expand_path '..', @path
|
484
484
|
"gem #{File.basename parent}"
|
485
|
-
when :home then
|
485
|
+
when :home then RDoc.home
|
486
486
|
when :site then 'ruby site'
|
487
487
|
when :system then 'ruby core'
|
488
488
|
else @path
|
@@ -723,7 +723,7 @@ class RDoc::Store
|
|
723
723
|
|
724
724
|
def page name
|
725
725
|
@text_files_hash.each_value.find do |file|
|
726
|
-
file.page_name == name
|
726
|
+
file.page_name == name or file.base_name == name
|
727
727
|
end
|
728
728
|
end
|
729
729
|
|
@@ -795,10 +795,8 @@ class RDoc::Store
|
|
795
795
|
|
796
796
|
return if @dry_run
|
797
797
|
|
798
|
-
marshal = Marshal.dump @cache
|
799
|
-
|
800
798
|
File.open cache_path, 'wb' do |io|
|
801
|
-
|
799
|
+
Marshal.dump @cache, io
|
802
800
|
end
|
803
801
|
end
|
804
802
|
|
@@ -871,10 +869,8 @@ class RDoc::Store
|
|
871
869
|
|
872
870
|
FileUtils.rm_f to_delete
|
873
871
|
|
874
|
-
marshal = Marshal.dump klass
|
875
|
-
|
876
872
|
File.open path, 'wb' do |io|
|
877
|
-
|
873
|
+
Marshal.dump klass, io
|
878
874
|
end
|
879
875
|
end
|
880
876
|
|
@@ -896,10 +892,8 @@ class RDoc::Store
|
|
896
892
|
|
897
893
|
return if @dry_run
|
898
894
|
|
899
|
-
marshal = Marshal.dump method
|
900
|
-
|
901
895
|
File.open method_file(full_name, method.full_name), 'wb' do |io|
|
902
|
-
|
896
|
+
Marshal.dump method, io
|
903
897
|
end
|
904
898
|
end
|
905
899
|
|
@@ -918,10 +912,8 @@ class RDoc::Store
|
|
918
912
|
|
919
913
|
return if @dry_run
|
920
914
|
|
921
|
-
marshal = Marshal.dump page
|
922
|
-
|
923
915
|
File.open path, 'wb' do |io|
|
924
|
-
|
916
|
+
Marshal.dump page, io
|
925
917
|
end
|
926
918
|
end
|
927
919
|
|
data/lib/rdoc/task.rb
CHANGED
@@ -128,7 +128,7 @@ class RDoc::Task < Rake::TaskLib
|
|
128
128
|
attr_accessor :template
|
129
129
|
|
130
130
|
##
|
131
|
-
# Name of format generator (<tt>--format
|
131
|
+
# Name of format generator (<tt>--format</tt>) used by rdoc. (defaults to
|
132
132
|
# rdoc's default)
|
133
133
|
|
134
134
|
attr_accessor :generator
|
data/lib/rdoc/text.rb
CHANGED
@@ -10,6 +10,8 @@ require 'strscan'
|
|
10
10
|
|
11
11
|
module RDoc::Text
|
12
12
|
|
13
|
+
attr_accessor :language
|
14
|
+
|
13
15
|
##
|
14
16
|
# Maps markup formats to classes that can parse them. If the format is
|
15
17
|
# unknown, "rdoc" format is used.
|
@@ -111,8 +113,12 @@ module RDoc::Text
|
|
111
113
|
def normalize_comment text
|
112
114
|
return text if text.empty?
|
113
115
|
|
114
|
-
|
115
|
-
|
116
|
+
case language
|
117
|
+
when :ruby
|
118
|
+
text = strip_hashes text
|
119
|
+
when :c
|
120
|
+
text = strip_stars text
|
121
|
+
end
|
116
122
|
text = expand_tabs text
|
117
123
|
text = flush_left text
|
118
124
|
text = strip_newlines text
|
data/lib/rdoc/token_stream.rb
CHANGED
@@ -74,11 +74,16 @@ module RDoc::TokenStream
|
|
74
74
|
##
|
75
75
|
# Adds +tokens+ to the collected tokens
|
76
76
|
|
77
|
-
def add_tokens(
|
78
|
-
|
77
|
+
def add_tokens(tokens)
|
78
|
+
@token_stream.concat(tokens)
|
79
79
|
end
|
80
80
|
|
81
|
-
|
81
|
+
##
|
82
|
+
# Adds one +token+ to the collected tokens
|
83
|
+
|
84
|
+
def add_token(token)
|
85
|
+
@token_stream.push(token)
|
86
|
+
end
|
82
87
|
|
83
88
|
##
|
84
89
|
# Starts collecting tokens
|
data/lib/rdoc/tom_doc.rb
CHANGED
@@ -242,19 +242,18 @@ class RDoc::TomDoc < RDoc::Markup::Parser
|
|
242
242
|
|
243
243
|
@tokens << case
|
244
244
|
when @s.scan(/\r?\n/) then
|
245
|
-
token = [:NEWLINE, @s.matched, *
|
246
|
-
@
|
247
|
-
@line += 1
|
245
|
+
token = [:NEWLINE, @s.matched, *pos]
|
246
|
+
@s.newline!
|
248
247
|
token
|
249
248
|
when @s.scan(/(Examples|Signature)$/) then
|
250
|
-
@tokens << [:HEADER, 3, *
|
249
|
+
@tokens << [:HEADER, 3, *pos]
|
251
250
|
|
252
|
-
[:TEXT, @s[1], *
|
251
|
+
[:TEXT, @s[1], *pos]
|
253
252
|
when @s.scan(/([:\w][\w\[\]]*)[ ]+- /) then
|
254
|
-
[:NOTE, @s[1], *
|
253
|
+
[:NOTE, @s[1], *pos]
|
255
254
|
else
|
256
255
|
@s.scan(/.*/)
|
257
|
-
[:TEXT, @s.matched.sub(/\r$/, ''), *
|
256
|
+
[:TEXT, @s.matched.sub(/\r$/, ''), *pos]
|
258
257
|
end
|
259
258
|
end
|
260
259
|
|
data/lib/rdoc/version.rb
CHANGED
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 .
|