Interactive Ruby Shell: Difference between revisions

Content deleted Content added
expanation of "IRB" as abbreviation for "Interactive Ruby Shell"
+rcat
 
(31 intermediate revisions by 28 users not shown)
Line 1:
{{#REDIRECT [[Ruby (programming language}})#Features]]
{{Infobox Software
 
| name = Interactive Ruby Shell
{{Rcat shell|
| logo =
{{R to related topic}}
| screenshot = [[Image:Interactive Ruby Shell.png|300px|]]
{{r hist}}
| caption = The screenshot session as same as the article example
| collapsible = yes
| developer = [[Keiju Ishitsuka]] <!--keiju@ishitsuka.com-->
| latest release version = 0.9.6
| latest release date = {{release date|2009|06|30}}
| operating system = [[Cross-platform]]
| platform = [[Ruby (programming language)|Ruby interpreter]]
| programming language = [[Ruby (programming language)|Ruby]]
| genre = [[Ruby (programming language)|Ruby]] [[shell (computing)|shell]]
| license = [http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/COPYING?view=markup Ruby License]<br />[[BSD licenses|BSD License]]
| website = http://www.ruby-lang.org/en/
}}
 
'''Interactive Ruby Shell''' ('''IRB''' or '''irb''') is a [[shell (computing)|shell]] for programming in the [[Object-oriented programming|object-oriented]] [[scripting language]] [[Ruby (programming language)|Ruby]]. The abbreviation irb comes from the fact that the [[filename extension]] for Ruby is ".rb", although interactive Ruby files do not have an extension of ".irb". The program is launched from a [[Command line interface|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 (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==
{{Portal|Free software}}
* [[Comparison of computer shells]]
 
==External links==
*[http://tryruby.org/ "Try Ruby"] Online IRB
*[http://ruby-doc.org/docs/ProgrammingRuby/html/trouble.html "When Trouble Strikes"] chapter from ''[[Programming Ruby]]''
*[http://ruby-doc.org/docs/ProgrammingRuby/html/irb.html "Interactive Ruby Shell"] chapter from ''[[Programming Ruby]]''
 
{{Ruby programming language}}
 
{{Compu-lang-stub}}
 
[[Category:Ruby programming language]]