diff options
author | MSP-Greg <MSP-Greg@users.noreply.github.com> | 2017-12-29 14:52:21 -0600 |
---|---|---|
committer | MSP-Greg <MSP-Greg@users.noreply.github.com> | 2017-12-30 07:32:47 -0600 |
commit | fbb1ff7a6fae5e63614f74622156d583ac312629 (patch) | |
tree | a9e34ee8ca48b97b13a43193621f89fd251bf960 | |
parent | ab14bb1938d70cbe76a1fe1ddba64a84cee5a847 (diff) | |
download | bundler-fbb1ff7a6fae5e63614f74622156d583ac312629.tar.gz |
Fix warning in rubygems testing re __FILE__
-rw-r--r-- | lib/bundler/rubygems_integration.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index 0f16b6231d..2d70eae7dc 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -570,8 +570,10 @@ module Bundler @replaced_methods.each do |(sym, klass), method| redefine_method(klass, sym, method) end - post_reset_hooks.reject! do |proc| - proc.binding.eval("__FILE__") == __FILE__ + if Binding.public_method_defined?(:source_location) + post_reset_hooks.reject! {|proc| proc.binding.source_location == __FILE__ } + else + post_reset_hooks.reject! {|proc| proc.binding.eval("__FILE__") == __FILE__ } end @replaced_methods.clear end |