2008-12-29 15:14:25 +03:00
|
|
|
.\"Ruby is copyrighted by Yukihiro Matsumoto <matz@netlab.jp>.
|
2017-04-20 10:44:54 +03:00
|
|
|
.Dd April 20, 2017
|
|
|
|
.Dt RI \&1 "Ruby Programmer's Reference Guide"
|
2008-12-29 15:14:25 +03:00
|
|
|
.Os UNIX
|
|
|
|
.Sh NAME
|
|
|
|
.Nm ri
|
2009-10-26 09:44:31 +03:00
|
|
|
.Nd Ruby API reference front end
|
2008-12-29 15:14:25 +03:00
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
2017-04-20 10:44:54 +03:00
|
|
|
.Op Fl ahilTv
|
|
|
|
.Op Fl d Ar DIRNAME
|
|
|
|
.Op Fl f Ar FORMAT
|
|
|
|
.Op Fl w Ar WIDTH
|
|
|
|
.Op Fl - Ns Oo Cm no- Oc Ns Cm pager
|
|
|
|
.Op Fl -server Ns Oo = Ns Ar PORT Oc
|
2017-04-20 10:44:01 +03:00
|
|
|
.Op Fl - Ns Oo Cm no- Oc Ns Cm list-doc-dirs
|
2017-04-20 10:44:54 +03:00
|
|
|
.Op Fl -no-standard-docs
|
2009-10-26 09:44:31 +03:00
|
|
|
.Op Fl - Ns Oo Cm no- Oc Ns Bro Cm system Ns | Ns Cm site Ns | Ns Cm gems Ns | Ns Cm home Brc
|
2017-04-20 10:44:54 +03:00
|
|
|
.Op Fl - Ns Oo Cm no- Oc Ns Cm profile
|
|
|
|
.Op Fl -dump Ns = Ns Ar CACHE
|
|
|
|
.Op Ar name ...
|
2008-12-29 15:14:25 +03:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm
|
2017-04-20 10:44:54 +03:00
|
|
|
is a command-line front end for the Ruby API reference.
|
|
|
|
You can search and read the API reference for classes and methods with
|
2008-12-29 15:14:25 +03:00
|
|
|
.Nm .
|
2009-10-26 09:44:31 +03:00
|
|
|
.Pp
|
2008-12-29 15:14:25 +03:00
|
|
|
.Nm
|
|
|
|
is a part of Ruby.
|
2009-10-26 09:44:31 +03:00
|
|
|
.Pp
|
2017-04-20 10:44:54 +03:00
|
|
|
.Ar name
|
|
|
|
can be:
|
2008-12-29 15:14:25 +03:00
|
|
|
.Bl -diag -offset indent
|
2017-04-20 10:44:54 +03:00
|
|
|
.It Class | Module | Module::Class
|
|
|
|
.Pp
|
|
|
|
.It Class::method | Class#method | Class.method | method
|
|
|
|
.Pp
|
|
|
|
.It gem_name: | gem_name:README | gem_name:History
|
2008-12-29 15:14:25 +03:00
|
|
|
.El
|
2009-10-26 09:44:31 +03:00
|
|
|
.Pp
|
2017-04-20 10:44:54 +03:00
|
|
|
All class names may be abbreviated to their minimum unambiguous form.
|
|
|
|
If a name is ambiguous, all valid options will be listed.
|
|
|
|
.Pp
|
|
|
|
A
|
|
|
|
.Ql \&.
|
|
|
|
matches either class or instance methods, while #method
|
|
|
|
matches only instance and ::method matches only class methods.
|
|
|
|
.Pp
|
|
|
|
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
|
|
|
|
.Ql \&:
|
|
|
|
all files in the gem will be shown.
|
|
|
|
The file name extension may be omitted where it is unambiguous.
|
2009-10-26 09:44:31 +03:00
|
|
|
.Pp
|
2008-12-29 15:14:25 +03:00
|
|
|
For example:
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
ri Fil
|
|
|
|
ri File
|
|
|
|
ri File.new
|
|
|
|
ri zip
|
2017-04-20 10:44:54 +03:00
|
|
|
ri rdoc:README
|
2008-12-29 15:14:25 +03:00
|
|
|
.Ed
|
2009-10-26 09:44:31 +03:00
|
|
|
.Pp
|
2017-04-20 10:44:54 +03:00
|
|
|
Note that shell quoting or escaping may be required for method names
|
|
|
|
containing punctuation:
|
2008-12-29 15:14:25 +03:00
|
|
|
.Bd -literal -offset indent
|
|
|
|
ri 'Array.[]'
|
2017-04-20 10:44:54 +03:00
|
|
|
ri compact\e!
|
2008-12-29 15:14:25 +03:00
|
|
|
.Ed
|
2017-04-20 10:44:54 +03:00
|
|
|
.Pp
|
|
|
|
To see the default directories
|
|
|
|
.Nm
|
|
|
|
will search, run:
|
|
|
|
.Bd -literal -offset indent
|
|
|
|
ri --list-doc-dirs
|
|
|
|
.Ed
|
|
|
|
.Pp
|
|
|
|
Specifying the
|
|
|
|
.Fl -system , Fl -site , Fl -home , Fl -gems ,
|
|
|
|
or
|
|
|
|
.Fl -doc-dir
|
|
|
|
options will limit
|
|
|
|
.Nm
|
|
|
|
to searching only the specified directories.
|
|
|
|
.Pp
|
|
|
|
.Nm
|
|
|
|
options may be set in the
|
|
|
|
.Ev RI
|
|
|
|
environment variable.
|
|
|
|
.Pp
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
pager can be set with the
|
|
|
|
.Ev RI_PAGER
|
|
|
|
environment variable or the
|
|
|
|
.Ev PAGER
|
|
|
|
environment variable.
|
|
|
|
.Pp
|
2008-12-29 15:14:25 +03:00
|
|
|
.Sh OPTIONS
|
|
|
|
.Bl -tag -width "1234567890123" -compact
|
|
|
|
.Pp
|
2017-04-20 10:44:54 +03:00
|
|
|
.It Fl i
|
|
|
|
.It Fl - Ns Oo Cm no- Oc Ns Cm interactive
|
|
|
|
In interactive mode you can repeatedly
|
|
|
|
look up methods with autocomplete.
|
2017-04-20 10:44:01 +03:00
|
|
|
.Pp
|
|
|
|
.It Fl a
|
|
|
|
.It Fl - Ns Oo Cm no- Oc Ns Cm all
|
|
|
|
Show all documentation for a class or module.
|
|
|
|
.Pp
|
|
|
|
.It Fl l
|
|
|
|
.It Fl - Ns Oo Cm no- Oc Ns Cm list
|
|
|
|
List classes
|
|
|
|
.Nm
|
|
|
|
knows about.
|
2008-12-29 15:14:25 +03:00
|
|
|
.Pp
|
2017-04-20 10:44:54 +03:00
|
|
|
.It Fl - Ns Oo Cm no- Oc Ns Cm pager
|
|
|
|
Send output to a pager,
|
|
|
|
rather than directly to stdout.
|
|
|
|
.Pp
|
2008-12-29 15:14:25 +03:00
|
|
|
.It Fl T
|
2017-04-20 10:44:54 +03:00
|
|
|
Synonym for
|
|
|
|
.Fl -no-pager .
|
2008-12-29 15:14:25 +03:00
|
|
|
.Pp
|
2017-04-20 10:44:54 +03:00
|
|
|
.It Fl w Ar WIDTH
|
|
|
|
.It Fl -width Ns = Ns Ar WIDTH
|
|
|
|
Set the width of the output.
|
2008-12-29 15:14:25 +03:00
|
|
|
.Pp
|
2017-04-20 10:44:54 +03:00
|
|
|
.It Fl -server Ns Oo = Ns Ar PORT Oc
|
|
|
|
Run RDoc server on the given port.
|
|
|
|
The default port is\~8214.
|
2017-04-20 10:44:01 +03:00
|
|
|
.Pp
|
2008-12-29 15:14:25 +03:00
|
|
|
.It Fl f Ar FORMAT
|
2017-04-20 10:44:54 +03:00
|
|
|
.It Fl -format Ns = Ns Ar FORMAT
|
|
|
|
Use the selected formatter.
|
|
|
|
The default formatter is
|
|
|
|
.Li bs
|
|
|
|
for paged output and
|
|
|
|
.Li ansi
|
|
|
|
otherwise.
|
|
|
|
Valid formatters are:
|
|
|
|
.Li ansi , Li bs , Li markdown , Li rdoc .
|
|
|
|
.Pp
|
|
|
|
.It Fl h
|
|
|
|
.It Fl -help
|
|
|
|
Show help and exit.
|
2008-12-29 15:14:25 +03:00
|
|
|
.Pp
|
2017-04-20 10:44:54 +03:00
|
|
|
.It Fl v
|
|
|
|
.It Fl -version
|
|
|
|
Output version information and exit.
|
|
|
|
.El
|
2008-12-29 15:14:25 +03:00
|
|
|
.Pp
|
2017-04-20 10:44:54 +03:00
|
|
|
Data source options:
|
|
|
|
.Bl -tag -width "1234567890123" -compact
|
2008-12-29 15:14:25 +03:00
|
|
|
.Pp
|
2017-04-20 10:44:54 +03:00
|
|
|
.It Fl - Ns Oo Cm no- Oc Ns Cm list-doc-dirs
|
|
|
|
List the directories from which
|
2008-12-29 15:14:25 +03:00
|
|
|
.Nm
|
2017-04-20 10:44:54 +03:00
|
|
|
will source documentation on stdout and exit.
|
2008-12-29 15:14:25 +03:00
|
|
|
.Pp
|
2017-04-20 10:44:54 +03:00
|
|
|
.It Fl d Ar DIRNAME
|
|
|
|
.It Fl -doc-dir Ns = Ns Ar DIRNAME
|
|
|
|
List of directories from which to source
|
|
|
|
documentation in addition to the standard
|
|
|
|
directories. May be repeated.
|
2008-12-29 15:14:25 +03:00
|
|
|
.Pp
|
|
|
|
.It Fl -no-standard-docs
|
|
|
|
Do not include documentation from the Ruby standard library,
|
|
|
|
.Pa site_lib ,
|
|
|
|
installed gems, or
|
|
|
|
.Pa ~/.rdoc .
|
2017-04-20 10:44:54 +03:00
|
|
|
Use with
|
|
|
|
.Fl -doc-dir .
|
2008-12-29 15:14:25 +03:00
|
|
|
.Pp
|
|
|
|
.It Fl - Ns Oo Cm no- Oc Ns Cm system
|
|
|
|
Include documentation from Ruby's standard library. Defaults to true.
|
|
|
|
.Pp
|
|
|
|
.It Fl - Ns Oo Cm no- Oc Ns Cm site
|
2017-04-20 10:44:54 +03:00
|
|
|
Include documentation from libraries installed in
|
|
|
|
.Pa site_lib .
|
|
|
|
Defaults to true.
|
2008-12-29 15:14:25 +03:00
|
|
|
.Pp
|
|
|
|
.It Fl - Ns Oo Cm no- Oc Ns Cm gems
|
2017-04-20 10:44:54 +03:00
|
|
|
Include documentation from RubyGems. Defaults to true.
|
2008-12-29 15:14:25 +03:00
|
|
|
.Pp
|
|
|
|
.It Fl - Ns Oo Cm no- Oc Ns Cm home
|
2017-04-20 10:44:54 +03:00
|
|
|
Include documentation stored in
|
|
|
|
.Pa ~/.rdoc .
|
|
|
|
Defaults to true.
|
|
|
|
.El
|
2008-12-29 15:14:25 +03:00
|
|
|
.Pp
|
2017-04-20 10:44:54 +03:00
|
|
|
Debug options:
|
|
|
|
.Bl -tag -width "1234567890123" -compact
|
|
|
|
.Pp
|
|
|
|
.It Fl - Ns Oo Cm no- Oc Ns Cm profile
|
|
|
|
Run with the Ruby profiler.
|
2008-12-29 15:14:25 +03:00
|
|
|
.Pp
|
2017-04-20 10:44:54 +03:00
|
|
|
.It Fl -dump Ns = Ns Ar CACHE
|
|
|
|
Dump data from an ri cache or data file.
|
2008-12-29 15:14:25 +03:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
.Sh ENVIRONMENT
|
|
|
|
.Bl -tag -width "USERPROFILE" -compact
|
|
|
|
.Pp
|
|
|
|
.It Ev RI
|
2017-04-20 10:44:54 +03:00
|
|
|
Options to prepend to those specified on the command-line.
|
2008-12-29 15:14:25 +03:00
|
|
|
.Pp
|
2017-04-20 10:44:54 +03:00
|
|
|
.It Ev RI_PAGER
|
2008-12-29 15:14:25 +03:00
|
|
|
.It Ev PAGER
|
2017-04-20 10:44:54 +03:00
|
|
|
Pager program to use for displaying.
|
2008-12-29 15:14:25 +03:00
|
|
|
.Pp
|
|
|
|
.It Ev HOME
|
|
|
|
.It Ev USERPROFILE
|
|
|
|
.It Ev HOMEPATH
|
2017-04-20 10:44:54 +03:00
|
|
|
Path to the user's home directory.
|
2008-12-29 15:14:25 +03:00
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
.Sh FILES
|
|
|
|
.Bl -tag -width "USERPROFILE" -compact
|
|
|
|
.Pp
|
|
|
|
.It Pa ~/.rdoc
|
2017-04-20 10:44:54 +03:00
|
|
|
Path for ri data in the user's home directory.
|
2008-12-29 15:14:25 +03:00
|
|
|
.Pp
|
|
|
|
.El
|
|
|
|
.Pp
|
|
|
|
.Sh SEE ALSO
|
2017-04-20 10:44:54 +03:00
|
|
|
.Xr ruby 1 ,
|
|
|
|
.Xr rdoc 1 ,
|
2008-12-29 15:14:25 +03:00
|
|
|
.Xr gem 1
|
|
|
|
.Pp
|
|
|
|
.Sh REPORTING BUGS
|
|
|
|
.Bl -bullet
|
2017-04-20 10:44:54 +03:00
|
|
|
.It
|
|
|
|
Security vulnerabilities should be reported via an email to
|
|
|
|
.Mt security@ruby-lang.org .
|
2012-11-15 08:22:44 +04:00
|
|
|
Reported problems will be published after being fixed.
|
2008-12-29 15:14:25 +03:00
|
|
|
.Pp
|
2017-04-20 10:44:54 +03:00
|
|
|
.It
|
|
|
|
Other bugs and feature requests can be reported via the
|
2016-09-23 14:21:52 +03:00
|
|
|
Ruby Issue Tracking System
|
|
|
|
.Pq Lk https://bugs.ruby-lang.org/ .
|
2008-12-29 15:14:25 +03:00
|
|
|
Do not report security vulnerabilities
|
2017-04-20 10:44:54 +03:00
|
|
|
via this system because it publishes the vulnerabilities immediately.
|
2008-12-29 15:14:25 +03:00
|
|
|
.El
|
|
|
|
.Sh AUTHORS
|
2017-04-20 10:44:54 +03:00
|
|
|
Written by
|
|
|
|
.An Dave Thomas Aq dave@pragmaticprogrammer.com .
|