I wonder if it would been better if we had gone another route with the
whole `#require_relative` thing. Instead of a special require method, we
could have a method that adds the current file's directory to the top of
the $LOAD_PATH temporarily while a block executes.
For example, lets say we have a library `fruit_basket' with:
lib/
fruit_basket.rb
fruit_basket/
grape.rb
orange.rb
Then in `fruit_basket.rb`:
relative do
require 'grape'
require 'orange'
end
Assuming `#relative` to be the name of such a method.
This is actually quite easy to implement in pure Ruby and would not have
required a C-based patch to Ruby core.
-- You received this message because you are subscribed to the Google Groups
ruby-talk-google group. To post to this group, send email to
[email protected]. To unsubscribe from this group, send email
to [email protected]. For more options, visit this
group at https://groups.google.com/d/forum/ruby-talk-google?hl=en