Closed koic closed 3 months ago
If there are many searches in the $LOAD_PATH in the user environment, require will perform unnecessary searches that are not needed. In contrast, require_relative is efficient because it uses a relative path.
$LOAD_PATH
require_relative
Racc requires Ruby 2.5+, it is possible to use require_relative, which was introduced in Ruby 1.9. https://github.com/ruby/racc/blob/v1.8.0/racc.gemspec#L44
If there are many searches in the
$LOAD_PATH
in the user environment, require will perform unnecessary searches that are not needed. In contrast,require_relative
is efficient because it uses a relative path.Racc requires Ruby 2.5+, it is possible to use
require_relative
, which was introduced in Ruby 1.9. https://github.com/ruby/racc/blob/v1.8.0/racc.gemspec#L44