From: Ezra Zygmuntowicz Date: 2007-03-08T11:09:46+09:00 Subject: Re: Making "require" just work with some dynamic load path manipulation On Mar 7, 2007, at 6:00 PM, Greg Hurrell wrote: > On 7 mar, 22:01, "Trans" wrote: >> Is there a reason you are not using setup.rb and/or gems? >> >> T. > > Neither of those is really appropriate because the files "a.rb" and > "b.rb" are dynamically generated and probably not very long lived (the > typical cycle will be: generate, use, throw away) and definitely not > worth installing permanently. The thing that generates those files is > actually distributed as a gem so there are no problems at that level; > I just want the generated files to be as easy to use for end users as > possible. > > Cheers, > Greg IF you want to garauntee to require b in the same dir as a you can do this: # a.rb puts "in a.rb" require File.join(FIle.dirname(__FILE__), 'b') # b.rb puts "in b.rb" Cheers- -- Ezra Zygmuntowicz -- Lead Rails Evangelist -- ez@engineyard.com -- Engine Yard, Serious Rails Hosting -- (866) 518-YARD (9273)