Skip to content

Commit

Permalink
📝 Document require_relative > require
Browse files Browse the repository at this point in the history
  • Loading branch information
pboling committed Sep 20, 2024
1 parent 3854951 commit 8eef85e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/gem_bench/jersey.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,9 @@ def load_gem_copy(tmp_dir, files)
files.each do |filepath|
# But files required here may not load their own internal files properly if they are still using `require`.
# Since Ruby 1.9.2, best practice for ruby libraries is to use require_relative for internal files,
# and require for external files and dependencies.
# Ref: https://github.com/panorama-ed/memo_wise/issues/349
# We *can* use `require` *here*, because filepath here is an absolute paths
# and require for external files and dependencies, generally, and oversimplified.
# Ref: https://github.com/rubocop/rubocop/issues/8748#issuecomment-2363327346
# However, We *can* use `require` *here*, because filepath here is an absolute paths
require filepath
end

Expand Down

0 comments on commit 8eef85e

Please sign in to comment.