ruby / rake

A make-like build utility for Ruby.
https://ruby.github.io/rake
MIT License
2.32k stars 614 forks source link

Use `require_relative` in the Rake codebase #566

Closed koic closed 2 months ago

koic commented 2 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.

Rake requires Ruby 2.3+, it is possible to use require_relative, which was introduced in Ruby 1.9. https://github.com/ruby/rake/blob/v13.2.1/rake.gemspec#L99

hsbt commented 2 months ago

Thanks!