diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/rubygems/core_ext/kernel_warn.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/rubygems/core_ext/kernel_warn.rb b/lib/rubygems/core_ext/kernel_warn.rb index 8b73902d3b..e10a845b98 100644 --- a/lib/rubygems/core_ext/kernel_warn.rb +++ b/lib/rubygems/core_ext/kernel_warn.rb @@ -4,7 +4,7 @@ if RUBY_VERSION >= "2.5" module Kernel - path = "#{__dir__}/" # Frames to be skipped start with this path. + rubygems_path = "#{__dir__}/" # Frames to be skipped start with this path. original_warn = method(:warn) @@ -38,7 +38,8 @@ if RUBY_VERSION >= "2.5" start += 1 - unless loc.path.start_with?(path) + path = loc.path + unless path.start_with?(rubygems_path) or path.start_with?('<internal:') # Non-rubygems frames uplevel -= 1 end |