--90e6ba53b0908deb0504a439f77e
Content-Type: text/plain; charset=ISO-8859-1

On Thu, May 26, 2011 at 10:26 PM, serialhex <serialhex / gmail.com> wrote:

> one method to require them all:
> require_relative
>
> ok, maybe not 'all' but it will solve your problem, as long as you're using
> 1.9.  and if you want to be *sure* it will work you can do something like:
>
> if RUBY_VERSION < '1.9'
>  Kernel.class_eval do
>    def require_relative str
>      require './' + str
>    end
>  end
> end
>
>
According to the spec (
https://github.com/rubyspec/rubyspec/blob/master/core/kernel/require_relative_spec.rb#L20),
require_relative
requires relative to the file rather than current dir. I think this means it
would have to be handled by the interpreter because I don't think there is a
way to get the file of the caller.

--90e6ba53b0908deb0504a439f77e--