From: Charles Hixson Date: 2004-10-19T04:38:43+09:00 Subject: Re: Relative #require trans. (T. Onoma) wrote: >... > module Kernel > # Require files from same dir as running script. > def import(*args) > fd = File.dirname(caller[0]) > args.each do |file_name| > require File.join(fd, file_name) > end > end > end > >Perhaps your hack is better? >Nonetheless, the point being that it is preferable to have this as a separate >method rather then integrated into #require. I recall that my experiments >(also long ago) bore this out. >T. > Thanks for the nice snippet. And I agree that it may well be best to have separate words for basing a path around an absolute path and around a relative path. (OTOneH, it seems to me that I use a relative path more frequently, so that should be more fundamental. OTOH, an absolute path is easier to base things on. The gripping hand is that require is already defined, and any change to it risks breaking code.)