On 20/09/2001 at 4:09 AM Paul Brannan wrote:
>I've proposed yet another solution [ruby-talk:20198]:
>
>  def requirelocal(file, *args)
>    caller_file, *foo = caller[0].split(':')
>    caller_dir = File.dirname(caller_file)
>    require File.join(caller_dir, file)
>  end
>
>This, IMHO, is the best solution out of the ones here, but it's still got
>issues, since it depends on the formatting of caller() (though RCR#15
>would help here).  It does help with the security issue, and it solves the
>problem of requiring the same file twice, since the filename is
>"normalized"  before it is required.

I was playing with this method too... definitely seems the best way but I was also unhappy with the fact that it requires parsing text that is destined for humans to read...  I'm planning on implementing this and overriding require (maybe with an old_require alias) in my own projects if nothing else turns up

Julian