From: Jeremy Henty Date: 2009-03-25T01:26:59+09:00 Subject: Re: : HOWTO start irb on a different object On 2009-03-24, Brian Candler wrote: > Jeremy Henty wrote: >> I wanted to have irb start its session on an object other than the >> toplevel. > > This is what I have been using: > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/244139 Yes, that's what I found too. AFAICT that solution copies the irb method that doesn't quite do what you want and modifies the copy so that it does do what you want. I prefer my solution for being shorter and simpler. OTOH my solution monkey-patches the original irb method, which is a point against it. > I'm not interested in setting up a different default object in > .irbrb, but rather being able to bolt irb onto an application object > as an interactive CLI for testing/debugging. That's what I want too! With my solution I can put an .irbrc in my application directory that makes irb start up in the context of an application object. Which is useful. Regards, Jeremy Henty