RI
Options to prepend to those specified on the command-line.
Ruby api reference front end
ri [-ahilTv] [-d DIRNAME] [-f FORMAT] [-w WIDTH] [--[no-]pager] [--server[=PORT]] [--[no-]list-doc-dirs] [--no-standard-docs] [--[no-]{system|site|gems|home}] [--[no-]profile] [--dump=CACHE] [name ...]
ri is a command-line front end for the Ruby API reference. You can search and read the API reference for classes and methods with ri.
ri is a part of Ruby.
name can be:
All class names may be abbreviated to their minimum unambiguous form. If a name is ambiguous, all valid options will be listed.
A ‘.’ matches either class or instance methods, while #method matches only instance and ::method matches only class methods.
README and other files may be displayed by prefixing them with the gem name they're contained in. If the gem name is followed by a ‘:’ all files in the gem will be shown. The file name extension may be omitted where it is unambiguous.
For example:
ri Fil ri File ri File.new ri zip ri rdoc:README
Note that shell quoting or escaping may be required for method names containing punctuation:
ri 'Array.[]' ri compact\!
To see the default directories ri will search, run:
ri --list-doc-dirs
Specifying the --system, --site, --home, --gems, or --doc-dir options will limit ri to searching only the specified directories.
ri options may be set in the RI environment variable.
The ri pager can be set with the RI_PAGER environment variable or the PAGER environment variable.
-i
--[no-]interactiveIn interactive mode you can repeatedly look up methods with autocomplete.
-a
--[no-]allShow all documentation for a class or module.
-l
--[no-]listList classes ri knows about.
--[no-]pagerSend output to a pager, rather than directly to stdout.
-T
Synonym for --no-pager.
-w WIDTH
--width=WIDTH
Set the width of the output.
--server[=PORT]
Run RDoc server on the given port. The default port is 8214.
-f FORMAT
--format=FORMAT
Use the selected formatter. The default formatter is bs for paged output and ansi otherwise. Valid formatters are: ansi, bs, markdown, rdoc.
-h
--help
Show help and exit.
-v
--version
Output version information and exit.
Data source options:
--[no-]list-doc-dirsList the directories from which ri will source documentation on stdout and exit.
-d DIRNAME
--doc-dir=DIRNAME
List of directories from which to source documentation in addition to the standard directories. May be repeated.
--no-standard-docs
Do not include documentation from the Ruby standard library, site_lib, installed gems, or ~/.rdoc. Use with --doc-dir.
--[no-]systemInclude documentation from Ruby's standard library. Defaults to true.
--[no-]siteInclude documentation from libraries installed in site_lib. Defaults to true.
--[no-]gemsInclude documentation from RubyGems. Defaults to true.
--[no-]homeInclude documentation stored in ~/.rdoc. Defaults to true.
Debug options:
--[no-]profileRun with the Ruby profiler.
--dump=CACHE
Dump data from an ri cache or data file.
RI
Options to prepend to those specified on the command-line.
RI_PAGER
PAGER
Pager program to use for displaying.
HOME
USERPROFILE
HOMEPATH
Path to the user's home directory.
~/.rdoc
Path for ri data in the user's home directory.
12 releases since Debian 3.0 (Woody); the text changed 6 times.
--doc-dir since Debian 3.1 (Sarge);
--dump since Debian 10 (Buster);
--format since Debian 3.1 (Sarge);
--help since Debian 10 (Buster);
--no-standard-docs since Debian 8 (Jessie);
--server since Debian 10 (Buster);
--version since Debian 3.1 (Sarge);
--width since Debian 3.1 (Sarge);
-T since Debian 3.1 (Sarge);
-a since Debian 10 (Buster);
-d since Debian 3.1 (Sarge);
-f since Debian 3.1 (Sarge);
-h since Debian 10 (Buster);
-i since Debian 8 (Jessie);
-l since Debian 10 (Buster);
-v since Debian 10 (Buster);
-w since Debian 3.1 (Sarge).
--classes until Debian 6.0 (Squeeze);
--fmt until Debian 9 (Stretch);
--interactive until Debian 9 (Stretch);
--list-doc-dirs until Debian 9 (Stretch);
--list-names until Debian 6.0 (Squeeze);
--no-pager until Debian 9 (Stretch);
-c until Debian 6.0 (Squeeze).