From: David Alan Black Date: 2004-05-04T22:24:03+09:00 Subject: Re: Can a program be made to drop into irb? Hi -- Gavin Sinclair writes: > I'd like to be able to write a program that, halfway through > execution, stops what it's doing and opens an irb session with the > current state. This would be an excellent tool for debugging. > > Does anyone know if it's possible? My instinct says it's probably > not. If that's the case, I'd like to if some modification to Ruby > could make it possible, to feed into a potential RCR. $ ruby -e 'require "irb"; print "irb? "; IRB.start if /y/.match(gets)' irb? yes irb(main):001:0> New scope, of course, but still running same program. I don't know that there's any way to get local variables involved, except maybe grabbing the binding directly. David -- David A. Black dblack@wobblini.net