In article <200211291258.gATCwKK10547 / moulon.inra.fr>, ts wrote:
>>>>>> "R" == Radek Hnilica <Radek / Hnilica.CZ> writes:
> 
>R> The far goal is to have fully interactive environment where in time of
>R> failure the program doesn't end but fires interactive session.
> 
>  Well, probably you can also look at debug.rb and see if you can modify it
>  to do what you want.

I got a help from NaHi

iowa@moon:~/testing$ vi inwokeirb2.rb ; cat inwokeirb2.rb 
#!/usr/bin/env ruby
require 'irb'
module IRB
        def IRB.start2(bind, ap_path)
                IRB.setup(ap_path)
                irb = Irb.new(WorkSpace.new(bind))
                @CONF[:MAIN_CONTEXT] = irb.context
                trap("SIGINT") do
                        irb.signal_handle
                end
                catch(:IRB_EXIT) do
                        irb.eval_input
                end
        end
end

def main
        a = 5
        #IRB::start $STDIN
        IRB::start2 binding, $STDIN
        puts "After IRB: a=#{a}"
end
main
iowa@moon:~/testing$ ./inwokeirb2.rb 
irb(main):001:0> p a
5
=> nil
irb(main):002:0> a = 2
=> 2
irb(main):003:0> quit
After IRB: a=2


-- 
Radek Hnilica <Radek at Hnilica dot CZ>
=======================================
No matter how far down the wrong road you've gone, turn back.
						Turkish proverb