diff options
author | fatkodima <fatkodima123@gmail.com> | 2019-11-02 15:29:15 +0200 |
---|---|---|
committer | fatkodima <fatkodima123@gmail.com> | 2019-11-03 04:31:16 +0200 |
commit | 795284275d53d7661121656906b7f24968aeaafd (patch) | |
tree | 94797f1da43e05d4de3a59a5fa4d3addd0704449 /lib/bundler | |
parent | 49f585ca9e5ecf2f0cf5529e1b320ce07d443de9 (diff) | |
download | bundler-795284275d53d7661121656906b7f24968aeaafd.tar.gz |
Fix bundler/inline warning: method redefined; discarding old root
Diffstat (limited to 'lib/bundler')
-rw-r--r-- | lib/bundler/inline.rb | 8 |
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 |