lib/bundler/rubygems_integration.rb in bundler-1.16.1 vs lib/bundler/rubygems_integration.rb in bundler-1.16.2
- old
+ new
@@ -130,11 +130,15 @@
def read_binary(path)
Gem.read_binary(path)
end
def inflate(obj)
- Gem.inflate(obj)
+ if defined?(Gem::Util)
+ Gem::Util.inflate(obj)
+ else
+ Gem.inflate(obj)
+ end
end
def sources=(val)
# Gem.configuration creates a new Gem::ConfigFile, which by default will read ~/.gemrc
# If that file exists, its settings (including sources) will overwrite the values we
@@ -568,11 +572,13 @@
def undo_replacements
@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[0] == __FILE__ }
+ else
+ post_reset_hooks.reject! {|proc| proc.binding.eval("__FILE__") == __FILE__ }
end
@replaced_methods.clear
end
def redefine_method(klass, method, unbound_method = nil, &block)