Interactive Ruby Shell
Encyclopedia
Interactive Ruby Shell is a shell
Shell (computing)
A shell is a piece of software that provides an interface for users of an operating system which provides access to the services of a kernel. However, the term is also applied very loosely to applications and may include any software that is "built around" a particular component, such as web...

 for programming in the object-oriented
Object-oriented programming
Object-oriented programming is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their interactions – to design applications and computer programs. Programming techniques may include features such as data abstraction,...

 scripting language
Scripting language
A scripting language, script language, or extension language is a programming language that allows control of one or more applications. "Scripts" are distinct from the core code of the application, as they are usually written in a different language and are often created or at least modified by the...

 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
Command History
Command history is a feature in many operating system shells, computer algebra programs, and other software that allows the user to recall, edit and rerun previous commands....

, line editing capabilities, and job control, and is able to communicate directly as a shell script
Shell script
A shell script is a script written for the shell, or command line interpreter, of an operating system. It is often considered a simple domain-specific programming language...

 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

External links

  • "Try Ruby" Online IRB
  • "When Trouble Strikes" chapter from Programming Ruby
    Programming Ruby
    Programming Ruby is a book about the Ruby programming language by Dave Thomas and Andrew Hunt, authors of The Pragmatic Programmer. In the Ruby community, it is commonly known as "The Pickaxe" because of the pickaxe on the cover...

  • "Interactive Ruby Shell" chapter from Programming Ruby
    Programming Ruby
    Programming Ruby is a book about the Ruby programming language by Dave Thomas and Andrew Hunt, authors of The Pragmatic Programmer. In the Ruby community, it is commonly known as "The Pickaxe" because of the pickaxe on the cover...

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK