From: Ben Bleything Date: 2009-03-25T00:11:27+09:00 Subject: Re: [Q&A]: HOWTO start irb on a different object On Tue, Mar 24, 2009 at 5:21 AM, Jeremy Henty wrote: > I wanted to have irb start its session on an object other than the > toplevel.  I found a solution that I think is nicer than any I could > find elsewhere.  The idea is to hook into IRB::Irb#initialize and > insert the WorkSpace object that you want. Do you find that you often want to start irb in the same object's context? That wouldn't be terribly useful for me, but I'm far from Mr. Every Use Case Ever :) When I want to get into a new object, I usually just use "irb that_object" from inside irb. That allows me to have a clean (and quick to start) irb most of the time, and be able to jump into any object I want, rather than having to alter a config file. Another option that might be cleaner is to hook an environment variable so you can set it as part of the irb invocation. An even better option would be to use an argument for irb, but I haven't looked into how long that would take :) Ben