From: Robert Klemme Date: 2010-08-29T19:40:28+09:00 Subject: Re: require from a method On 29.08.2010 12:25, Ammar Ali wrote: > Are there any gotchas in requiring files from within a method? It > seems to work, but I have a sinking feeling that I'm missing something > here. Not technically. It might even be more efficient if you require a particular functionality only rarely and include the "require" in the method that needs that functionality. OTOH I find "require" in the middle of the code difficult to spot which makes it harder to keep track of dependencies. Also, errors might surface later (e.g. you copy your app to a different machine, start it and believe it works while in reality you forgot to install a gem or lib which is only used for particular use cases). Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/