Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: 2_4_2
Fetching contributors…


Cannot retrieve contributors at this time

file 59 lines (46 sloc) 1.895 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
= RI
== Background
+ri+ is a tool that allows Ruby documentation to be viewed on the command-line.
It is part of RDoc and is expected to work on any platform supported by Ruby.

+ri+ will be a bit slow the first time that it runs (or any time that the
underlying documentation changes) because it builds a cache in the +.ri+
directory within the user's home directory in order to make future accesses

== Usage
To see information for a class, do:
  ri class_name

For example, for the +Array+ class, do
  ri Array

To see information for an instance method, do:
  ri class_name#method_name

For example, for Array's +join+ method, do:
  ri Array#join

To see information for a class method, do:
  ri class_name.method_name

For example, for Module's +private+ method, do:
  ri Module.private

To search for all methods containing +read+, do:
  ri read

To search for all methods starting with +read+, do:
  ri '^read'

To search for all +read+ methods, do:
  ri '^read$'

== Options
+ri+ supports a variety of options, all of which can be viewed via +--help+.
Of particular interest, are:
[-d directory]
  List of directories from which to source documentation in addition to
  the standard directories. May be repeated. This can be used to specify
  the location of site-specific documentation (which can be generated with
  This makes +ri+ go into interactive mode. When +ri+ is in interactive mode,
  it will allow the user to disambiguate lists of methods in case multiple
  methods match against a method search string. It also will allow the user
  to enter in a method name (with auto-completion, if readline is supported)
  when viewing a class.
  Send output to stdout, rather than to a pager.

All options also can be specified through the +RI+ environment variable.
Command-line options always override those specified in the +RI+ environment
Something went wrong with that request. Please try again.