RI(1)

πŸ“¦ version 3.1.2, in debian bookworm

πŸŽ€ RI(1): Ruby Programmer's Reference Guide πŸŽ€

okay so this is the manual page for RI(1), and it's the Ruby Programmer's Reference Guide πŸ’– bestie this tool is literally your API reference buddy ✨

✨ NAME ✨

ri, the Ruby API reference front end πŸ¦‹

✨ SYNOPSIS ✨

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 ...]

✨ DESCRIPTION ✨

okay so 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 it, no cap.

ri is a part of Ruby 🌸

You can pass in a name that looks like any of these:

Class | Module | Module::Class

Class::method | Class#method | Class.method | method

gem_name: | gem_name:README | gem_name:History

All class names can be abbreviated to their minimum unambiguous form ✨ if a name is ambiguous, all valid options get listed, so you won't miss anything πŸ‘€

A . matches either class or instance methods, while #method matches only instance methods and ::method matches only class methods. main character energy for sure πŸ‘‘

README and other files can be displayed by putting the gem name they live in in front of them. If the gem name is followed by a :, all files in the gem get shown 🧚 The file name extension can be left off wherever it's unambiguous.

Here's what that looks like in practice:

ri Fil
ri File
ri File.new
ri zip
ri rdoc:README
⚠️ heads up: shell quoting or escaping may be required for method names that contain punctuation, so don't get tripped up by this one πŸ™ˆ
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 can also be set in the RI environment variable 🫢

The ri pager can be set with the RI_PAGER environment variable or the PAGER environment variable πŸ’œ

✨ OPTIONS ✨

  • -i, --[no-]interactive β€” interactive mode lets you look up methods over and over with autocomplete πŸ”₯
  • -a, --[no-]all β€” show all the documentation for a class or module πŸ’–
  • -l, --[no-]list β€” list the classes ri knows about πŸ“š
  • --[no-]pager β€” send the output to a pager instead of dumping it straight to stdout 🌈
  • -T β€” synonym for --no-pager πŸ“
  • -w WIDTH, --width=WIDTH β€” set the width of the output ✨
  • --server[=PORT] β€” run the 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-dirs β€” list the directories ri will source documentation from, printed on stdout, and then exit 🧚
  • -d DIRNAME, --doc-dir=DIRNAME β€” a list of directories to source documentation from, on top of the standard ones. This can be repeated πŸŽ€
  • --no-standard-docs β€” don't include documentation from the Ruby standard library, site_lib, installed gems, or ~/.rdoc. Use this with --doc-dir πŸ”₯
  • --[no-]system β€” include documentation from Ruby's standard library. Defaults to true πŸ’œ
  • --[no-]site β€” include documentation from libraries installed in site_lib. Defaults to true 🌈
  • --[no-]gems β€” include documentation from RubyGems. Defaults to true ✨
  • --[no-]home β€” include documentation stored in ~/.rdoc. Defaults to true πŸ¦‹

Debug options:

  • --[no-]profile β€” run with the Ruby profiler πŸ™ˆ
  • --dump=CACHE β€” dump data from an ri cache or data file πŸ’€

✨ ENVIRONMENT ✨

  • RI β€” options to prepend to the ones you type on the command line 🫢
  • RI_PAGER, PAGER β€” the pager program used for displaying output πŸ“–
  • HOME, USERPROFILE, HOMEPATH β€” the path to the user's home directory 🏑

✨ FILES ✨

  • ~/.rdoc β€” where ri keeps its data in the user's home directory πŸ“‚

✨ SEE ALSO ✨

ruby(1), rdoc(1), gem(1) πŸ‘‘

✨ REPORTING BUGS ✨

  • Security vulnerabilities should be reported by email to security@ruby-lang.org. Reported problems will be published after they've been fixed πŸ”’
  • Other bugs and feature requests can be reported through the Ruby Issue Tracking System at https://bugs.ruby-lang.org/. Do not report security vulnerabilities through this system, because it publishes them immediately 🚨

✨ AUTHORS ✨

Written by Dave Thomas <dave@pragmaticprogrammer.com> 🫢


okay that's the whole thing, bestie πŸ’– signing off from UNIX, April 20, 2017, RI(1) πŸ’…βœ¨

πŸ“¦ where this page comes from