RI(1)
πΈ 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::ClassClass::method|Class#method|Class.method|methodgem_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 classesriknows 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 is8214. slay.-f FORMAT,--format=FORMATβ use the selected formatter. the default formatter isbsfor paged output andansiotherwise. 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 whichriwill 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 totrue.--[no-]siteβ include documentation from libraries installed insite_lib. defaults totrue.--[no-]gemsβ include documentation from RubyGems. defaults totrue.--[no-]homeβ include documentation stored in~/.rdoc. defaults totrue.
π§ Debug options π§
--[no-]profileβ run with the Ruby profiler.--dump=CACHEβ dump data from anricache 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 forridata in the user's home directory.
π SEE ALSO π
π 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
- opensuse-leap 16.0: ruby3.4 3.4.10-160000.1.1 Β· BSD-2-Clause OR Ruby
- opensuse-leap 16.0: ruby3.4 3.4.10-160000.1.1 Β· BSD-2-Clause OR Ruby
- opensuse-leap 16.0: ruby3.4 3.4.10-160000.1.1 Β· BSD-2-Clause OR Ruby
- opensuse-leap 16.0: ruby3.4 3.4.10-160000.1.1 Β· BSD-2-Clause OR Ruby
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms