RI(1)
π 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 classesriknows 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 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 π-v,--versionβ output version information and exit πΈ
Data source options:
--[no-]list-doc-dirsβ list the directoriesriwill 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 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 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β whererikeeps its data in the user's home directory π
β¨ SEE ALSO β¨
β¨ 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
- debian bookworm: ruby3.1 3.1.2-7+deb12u1 Β· BSD-2-Clause OR Ruby
- π girlified by anthropic/claude-haiku-5.5 on : a language model's rewrite of the original, under its terms