Jump to content

Interactive Ruby Shell

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Jeffhos (talk | contribs) at 00:08, 20 January 2011 (Fix broken links). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Interactive Ruby Shell
Developer(s)Keiju Ishitsuka
Stable release
0.9.5 / February 13, 2007 (2007-02-13)
Repository
Written inRuby
Operating systemCross-platform
PlatformRuby interpreter
TypeRuby shell
LicenseRuby License
GNU General Public License
Websitehttp://www.ruby-lang.org/en/

Interactive Ruby Shell (IRB) is a shell for programming in the object-oriented scripting language Ruby. The program is launched from a command line and allows the execution of Ruby commands with immediate response, experimenting in real-time. It features command history, line editing capabilities, and job control, and is able to communicate directly as a shell script over the Internet and interact with a live server. It was developed by Keiju Ishitsuka. Program usage:

irb [ options ] [ programfile ] [ argument... ]

Example usage:

irb(main):001:0> n = 5
=> 5
irb(main):002:0> def fact(n)
irb(main):003:1>   if n <= 1
irb(main):004:2>     1
irb(main):005:2>   else
irb(main):006:2*     n * fact(n - 1)
irb(main):007:2>   end
irb(main):008:1> end
=> nil
irb(main):009:0> fact(n)
=> 120

See also