RI(1)
β¨ NAME β¨
ok so bestie, welcome to ri β the Ruby API reference front end π this is your girl for looking up Ruby docs without ever leaving the terminal. it's part of the Ruby Programmer's Reference Guide, iykyk.
πΈ 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 π¦
ri is literally 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 browser, no vibes ruined, just you and the docs.
ri is a part of Ruby. periodt π
ok so name can be any of these:
Class | Module | Module::Class
Class::method | Class#method | Class.method | method
gem_name: | gem_name:README | gem_name:History
ruby: | ruby:NEWS | ruby:globals
all class names may be abbreviated to their minimum unambiguous form. and if a name is ambiguous?? don't stress β all valid options will be listed for you π«Ά
a . matches either class or instance methods, while #method matches only instance and ::method matches only class methods. so precise. so iconic.
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
not me reminding you that shell quoting or escaping may be required for method names containing punctuation π like:
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. keep that in mind bestie.
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. pick your fighter π
π OPTIONS π
-i,--[no-]interactiveβ in interactive mode you can repeatedly look up methods with autocomplete. it's giving main character energy fr π₯-a,--[no-]allβ show all documentation for a class or module.-l,--[no-]listβ list classesriknows about π--[no-]pagerβ send output to a pager, rather than directly to stdout.-Tβ synonym for--no-pager. yes bestie, it's just a shortcut π«Ά-w WIDTH,--width=WIDTHβ set the width of the output.--server[=PORT]β run RDoc server on the given port. the default port is8214.-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. no thoughts, just help π-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. yes, stack them up π₯--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. (prepend!! like a little pregame for your flags π )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/).
do NOT report security vulnerabilities via this system because it publishes the vulnerabilities immediately π fr fr, this one matters.
π AUTHORS π
written by Dave Thomas <dave@pragmaticprogrammer.com>.
and that's the whole thing bestie π this one's from the UNIX manual, April 20, 2017 edition (that's the RI(1) in the corner π). slay, go read some docs, you've got this π«Άβ¨
π¦ where this page comes from
- centos-stream 10: ruby4.0 4.0.6-37.el10 Β· (Ruby OR BSD-2-Clause) AND (Ruby OR BSD-2-Clause OR GPL-1.0-or-later) AND BSD-3-Clause AND (GPL-3.0-or-later WITH Bison-exception-2.2) AND ISC AND LicenseRef-Fedora-Public-Domain AND MIT AND CC0-1.0 AND zlib AND Unicode-DFS-2015 AND HPND-Markus-Kuhn AND Ruby-pty AND (Ruby OR BSD-2-Clause OR Python-2.0.1) AND BSD-2-Clause AND (Apache-2.0 OR BSL-1.0) AND GPL-2.0-only AND CC-BY-2.5 AND OFL-1.1-RFN AND BSL-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms