Ri++ Documentation Tool

Command-line Ruby API documentation lookup — ri, RDoc, and Rimport.

ri is Ruby's built-in command-line documentation tool. It provides quick access to API documentation for Ruby's standard library directly from the terminal. Ri++ refers to enhancements and extensions to the standard ri tool.

Type ri ClassName or ri ClassName#method_name in your terminal to look up documentation.

Related Tools

Tool

RDoc

The essential Ruby documentation tool. Creates documentation in HTML, XML, RDF, and other formats by parsing Ruby source code and embedded comments. The foundation of the ri documentation database.

Tool

Rimport

A tool for importing new data files into ri using RDoc XML output. Allows you to extend ri with documentation for third-party libraries not bundled with Ruby.

RAA

Rimport on RAA

Rimport listing on the Ruby Application Archive (RAA). Allows creation of ri data files from RDoc XML output.

Tool

RUDE4C

Generates documentation from Ruby library extensions written in C. Scans for rb_define_class and similar expressions, outputting plain text, rd-style docs, or HTML.

Using ri

The ri tool ships with Ruby and provides immediate access to standard library documentation:

  • ri String — show documentation for the String class
  • ri String#upcase — show docs for the String#upcase instance method
  • ri Array.new — show docs for the Array.new class method
  • ri Enumerable — show docs for the Enumerable module

ri reads documentation data files generated by RDoc. The Rimport tool extends this by allowing you to import RDoc XML output for any library, making third-party documentation accessible via ri.

For online API documentation, see the Standard Library API on rubyobjc.com.