"Joe Van Dyk" <joevandyk / gmail.com> schrieb im Newsbeitrag 
news:c715e64050425102137d986e0 / mail.gmail.com...
> Hi,
>
> I'd like to be able to run a ruby program that would initialize a few
> objects, require a few libraries, and then dump me into an irb shell
> (that has access to those objects).  How would I do that?

If it's not a problem to use global variables you can do this:

$ irb -r i.rb
irb(main):001:0> $foo
=> "bar"
irb(main):002:0> exit

Robert@Babelfish2 /c/TEMP
$ cat i.rb

$foo = "bar"

Robert@Babelfish2 /c/TEMP
$

You can also invoke IRB from a program:

Robert@Babelfish2 /c/TEMP
$ ruby i2.rb
irb(main):001:0> $foo
=> "bar"
irb(main):002:0> exit

Robert@Babelfish2 /c/TEMP
$ cat i2.rb

require 'irb'

$foo = "bar"
IRB.start



Kind regards

    robert