From: Jeremy Henty Date: 2009-03-26T07:16:51+09:00 Subject: Re: : HOWTO start irb on a different object On 2009-03-24, Robert Klemme wrote: > On 24.03.2009 17:25, Jeremy Henty wrote: >> ... I can put an .irbrc in my application directory that makes irb >> start up in the context of an application object. > > But wouldn't you have to start irb then with either > > HOME=. irb > > or with other options in order to make it read the local .irbrc? No, because irb automatically looks for a .irbrc in the current working directory as well as in $HOME. > Btw, if you can make IRB read a "local" .irbrc already, then you can > as well place code in there like > > application = whatever_initialization() > irb application > exit That doesn't work: "load error: /tmp/user/jeremy/.irbrc NoMethodError: undefined method `irb' for main:Object". Commands like "irb application" only work after irb starts its read-eval-print loop, and it does that *after* it loads the config file. (I agree that this trick would make my hack redundant if it did work.) Regards, Jeremy Henty