From: Gavin Sinclair Date: 2004-05-05T00:08:19+09:00 Subject: Re: Can a program be made to drop into irb? On Wednesday, May 5, 2004, 12:03:56 AM, Ara.T.Howard wrote: ~ >> cat a.rb > require 'irb' > a, b = 4, 2 > begin > c = 42 > syntax_error rescue Exception =>> e > IRB.setup nil > IRB::Irb.new(IRB::WorkSpace.new(binding),nil).eval_input > end ~ >> ruby a.rb irb(main):001:0>> p a,b,c > 4 > 2 > 42 =>> nil > i confess i have no idea how this works, but it seems to... you need to type > ctrl-D to get out (end STDIN), i'm not sure how to get back into the program... > perhaps someone else could figure it out... > a shorthand for this would be immensely useful - something like > ret = IRB.debug Well, that's a good start. Getting back to the program would be handy. Then calling IRB.debug is like using a debugger, except the breakpoints are in the code, which I think is a good thing to be able to do. Gavin