LinuxCommandLibrary

ri

TLDR

View class documentation

$ ri [Array]
copy
View method documentation
$ ri [Array#map]
copy
View instance method
$ ri [String#split]
copy
View class method
$ ri [File.open]
copy
List all classes
$ ri -l
copy

SYNOPSIS

ri [options] [name...]

DESCRIPTION

ri (Ruby Information) displays Ruby documentation from the command line. It reads documentation generated by RDoc and provides quick access to class and method information.

PARAMETERS

-l, --list

List classes.
-f, --format name
Output format.
-i, --interactive
Interactive mode.
-T, --no-pager
Don't use pager.
--doc-dir dir
Documentation directory.

EXAMPLES

$ # Class documentation
ri Array
ri String

# Instance method (use #)
ri Array#each
ri String#gsub

# Class method (use .)
ri File.read
ri Dir.glob

# Search for method
ri -l | grep map

# Interactive mode
ri -i
copy

NOTATION

$ Class          - ri Array
Class#method   - Instance method (ri Array#map)
Class.method   - Class method (ri File.open)
Class::Const   - Constant (ri File::SEPARATOR)
copy

CAVEATS

Documentation must be installed. Use gem rdoc --all to generate gem docs. Part of Ruby standard library.

HISTORY

ri is part of Ruby's RDoc system, providing command-line documentation access since early Ruby versions.

SEE ALSO

rdoc(1), ruby(1), irb(1)

Copied to clipboard