summaryrefslogtreecommitdiff
path: root/lib/bundler
diff options
context:
space:
mode:
authorfatkodima <fatkodima123@gmail.com>2019-11-02 15:29:15 +0200
committerfatkodima <fatkodima123@gmail.com>2019-11-03 04:31:16 +0200
commit795284275d53d7661121656906b7f24968aeaafd (patch)
tree94797f1da43e05d4de3a59a5fa4d3addd0704449 /lib/bundler
parent49f585ca9e5ecf2f0cf5529e1b320ce07d443de9 (diff)
downloadbundler-795284275d53d7661121656906b7f24968aeaafd.tar.gz
Fix bundler/inline warning: method redefined; discarding old root
Diffstat (limited to 'lib/bundler')
-rw-r--r--lib/bundler/inline.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/bundler/inline.rb b/lib/bundler/inline.rb
index dbf737c7ee..db08355460 100644
--- a/lib/bundler/inline.rb
+++ b/lib/bundler/inline.rb
@@ -38,6 +38,8 @@ def gemfile(install = false, options = {}, &gemfile)
raise ArgumentError, "Unknown options: #{opts.keys.join(", ")}" unless opts.empty?
old_root = Bundler.method(:root)
+ bundler_module = class << Bundler; self; end
+ bundler_module.send(:remove_method, :root)
def Bundler.root
Bundler::SharedHelpers.pwd.expand_path
end
@@ -70,6 +72,8 @@ def gemfile(install = false, options = {}, &gemfile)
runtime.setup.require
end
ensure
- bundler_module = class << Bundler; self; end
- bundler_module.send(:define_method, :root, old_root) if old_root
+ if bundler_module
+ bundler_module.send(:remove_method, :root)
+ bundler_module.send(:define_method, :root, old_root)
+ end
end