Skip to content

Commit

Permalink
Merge pull request #366 from Shopify/fix-ruby-head-require-relative-f…
Browse files Browse the repository at this point in the history
…rom-evaled-file

Handle Ruby 3.1 eval location change
  • Loading branch information
casperisfine committed Aug 2, 2021
2 parents 9562e21 + 0d64e7e commit b6f0c03
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/bootsnap/load_path_cache/core_ext/kernel_require.rb
Expand Up @@ -47,8 +47,9 @@ def require(path)

alias_method(:require_relative_without_bootsnap, :require_relative)
def require_relative(path)
location = caller_locations(1..1).first
realpath = Bootsnap::LoadPathCache.realpath_cache.call(
caller_locations(1..1).first.absolute_path, path
location.absolute_path || location.path, path
)
require(realpath)
end
Expand Down

0 comments on commit b6f0c03

Please sign in to comment.