Zum Inhalt springen

Interactive Ruby Shell

aus Wikipedia, der freien Enzyklopädie
Dies ist eine alte Version dieser Seite, zuletzt bearbeitet am 12. August 2008 um 16:59 Uhr durch 77.30.16.113 (Diskussion). Sie kann sich erheblich von der aktuellen Version unterscheiden.
Interactive Ruby Shell
Basisdaten

Aktuelle Version 1.15.2[1]
(3. April 2025)
Programmier­sprache Ruby
Lizenz 2-Klausel-BSD-Lizenz[2]
github.com/ruby/irb

Interactive Ruby Shell (IRB) is a shell for programming in the object-oriented scripting language Ruby. IRB is run from the 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, 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

Vorlage:Ruby programming language

Vorlage:Compu-lang-stub

  1. Release 1.15.2. 3. April 2025 (abgerufen am 24. April 2025).
  2. rubygems.org. (abgerufen am 6. Juli 2020).