Interactive Ruby Shell: Difference between revisions

Content deleted Content added
French link
+rcat
 
(72 intermediate revisions by 58 users not shown)
Line 1:
#REDIRECT [[Category:Ruby (programming language)#Features]]
'''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 features command-line 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.
 
{{Rcat shell|
irb (Interactive Ruby) was developed by Keiju Ishitsuka. It allows you to enter the commands at the prompt and have the interpreter respond as if you were executing a program. irb is a useful way to explore Ruby.
{{R to related topic}}
 
{{r hist}}
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
 
 
==External links==
*[http://www.rubycentral.com/book/trouble.html "When Trouble Strikes"] chapter from ''[[Programming Ruby]]''
*[http://www.rubycentral.com/book/irb.html "Interactive Ruby Shell"] chapter from ''[[Programming Ruby]]''
*[http://tryruby.hobix.com/ Try Ruby!]&mdash;An interactive tutorial and Ruby shell within your browser.
 
{{Compu-lang-stub}}
[[Category:Scripting languages]]
[[Category:Ruby programming language]]
 
[[fr:Interactive Ruby]]