RI(1)

πŸ“¦ version 3.4.10, in opensuse-leap 16.0

🌸 RI(1) β€” your Ruby API reference bestie 🌸

okay so real talk: this is the UNIX manual page for ri, and honestly? she's iconic. it's the Ruby API reference front end and she's here to make your life easier. let's get into it πŸ’…


✨ NAME ✨

ri β€” Ruby API reference front end. that's it. that's the vibe. πŸŽ€


πŸ¦‹ 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
...]

like, yes, it's a lot of brackets. breathe. we'll get through it together 🫢


πŸ’– DESCRIPTION πŸ’–

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 β€” literally that's her whole job and she ate πŸ’…

ri is a part of Ruby. no cap.

so name can be, like, a few different things:

  • Class | Module | Module::Class
  • Class::method | Class#method | Class.method | method
  • gem_name: | gem_name:README | gem_name:History

all class names may be abbreviated to their minimum unambiguous form β€” so yes, you can be lazy, she supports it ✨. but if a name is ambiguous, all valid options will be listed. she's not gonna guess for you, bestie.

a . matches either class or instance methods, while #method matches only instance methods and ::method matches only class methods. iykyk πŸ”₯

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 : all files in the gem will be shown. the file name extension may be omitted where it is unambiguous.

for example:

ri Fil
ri File
ri File.new
ri zip
ri rdoc:README
note that shell quoting or escaping may be required for method names containing punctuation πŸ™ˆ like seriously, the shell will fight you:
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. like, she'll stay in her lane. respectfully. πŸ‘‘

ri options may 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 β€” in interactive mode you can repeatedly look up methods with autocomplete. it's giving main character energy, honestly ⭐
  • -a, --[no-]all β€” show all documentation for a class or module. all of it. no crumbs left behind πŸ’€
  • -l, --[no-]list β€” list classes ri knows about. she knows a lot of people πŸ‘‘
  • --[no-]pager β€” send output to a pager, rather than directly to stdout.
  • -T β€” synonym for --no-pager.
  • -w WIDTH, --width=WIDTH β€” set the width of the output. make her skinny, make her wide, your call πŸŽ€
  • --server[=PORT] β€” run RDoc server on the given port. the default port is 8214. slay.
  • -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 from which ri will source documentation on stdout and exit.
  • -d DIRNAME, --doc-dir=DIRNAME β€” list of directories from which to source documentation in addition to the standard directories. may be repeated, so go off, collect them all πŸ’œ
  • --no-standard-docs β€” do not include documentation from the Ruby standard library, site_lib, installed gems, or ~/.rdoc. use 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 those specified on the command-line.
  • RI_PAGER, PAGER β€” pager program to use for displaying.
  • HOME, USERPROFILE, HOMEPATH β€” path to the user's home directory.

πŸ“ FILES πŸ“

  • ~/.rdoc β€” path for ri data in the user's home directory.

πŸ”— SEE ALSO πŸ”—

ruby(1), rdoc(1), gem(1)


πŸ’€ REPORTING BUGS πŸ’€

  • security vulnerabilities should be reported via an email to security@ruby-lang.org. reported problems will be published after being fixed.
  • other bugs and feature requests can be reported via the Ruby Issue Tracking System (https://bugs.ruby-lang.org/).
bestie, do not report security vulnerabilities via this system, because it publishes the vulnerabilities immediately. like, instantly. no chill. please don't 😭

πŸ‘‘ AUTHORS πŸ‘‘

written by Dave Thomas <dave@pragmaticprogrammer.com>.


that's the whole page, you're welcome, go read some docs πŸ’–

sign-off szn: this was the Ruby Programmer's Reference Guide edition, dated April 20, 2017, for RI(1) on UNIX. mwah, stan her, bye πŸ¦‹πŸŒΈπŸ’…

πŸ“¦ where this page comes from