From: Joel VanderWerf Date: 2007-05-25T04:38:54+09:00 Subject: Re: temporary require ,is it possible? Brian Candler wrote: > On Thu, May 24, 2007 at 06:03:22PM +0900, Gpy Good wrote: >> I have a idea,it is "temporary require" >> [code] >> module Find >> # my define >> end >> >> tmp_require("find"){ >> #do something with "Find.find" method,temporary!! >> } >> >> puts Find # my define,no "Find.find" method >> [/code] >> Is it possible? > > Hmm, I was thinking of > > temp = load("find.rb", true) > temp::Find.find(...) > > but unfortunately load returns true, not the module object :-( There's a way around that. See http://redshift.sourceforge.net/script/ No magic, just module_eval. (I'm not sure it solves the OP's problem, though.) -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407