|platform =#REDIRECT [[Ruby (programming language |Ruby interpreter)#Features]] ▼
{{Infobox_Software
|name = Interactive Ruby Shell
{{Rcat shell|
|logo=
{{R to related topic}}
|screenshot =
{{r hist}}
|caption =
|developer = [[Keiju Ishitsuka]] <!--keiju@ishitsuka.com-->
|latest_release_version = 0.9.5
|latest_release_date = [[February 13]], [[2007]]
|operating_system = [[Cross-platform]]
▲|platform = [[Ruby programming language|Ruby interpreter]]
|genre = [[Ruby]] [[shell (computing)|shell]]
|license =
|website = http://www.ruby-lang.org/en/
}}
'''Interactive Ruby Shell''' ('''IRB''') is a [[shell (computing)|shell]] for programming in the [[Object-oriented programming|object-oriented]] [[scripting language]] [[Ruby programming language|Ruby]]. IRB is run from the [[Command line interface|command line]] and allows the programmer to experiment with code in real time. It allows you to enter Ruby commands at the prompt and have the interpreter respond immediately. It features [[command history]], line editing capabilities, and [[job control (Unix)|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:
<source lang="ruby">
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
</source>
==See also==
* [[Comparison of computer shells]]
==External links==
*[http://www.rubycentral.com/pickaxe/trouble.html "When Trouble Strikes"] chapter from ''[[Programming Ruby]]''
*[http://www.rubycentral.com/pickaxe/irb.html "Interactive Ruby Shell"] chapter from ''[[Programming Ruby]]''
*[http://tryruby.hobix.com/ Try Ruby!]—An interactive tutorial and Ruby shell within your browser.
*[http://showmedo.com/videos/video?name=rubyLakeIrbCompletion Enabling Tab Completion in IRB]
{{Ruby programming language}}
{{Compu-lang-stub}}
[[fr:Interactive Ruby]]
|