Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Merge #7417
Browse files Browse the repository at this point in the history
7417: Fix bundler/inline warning: method redefined; discarding old root r=deivid-rodriguez a=fatkodima

Closes #6167

Co-authored-by: fatkodima <fatkodima123@gmail.com>
  • Loading branch information
bundlerbot and fatkodima committed Nov 7, 2019
2 parents ac758c8 + 7952842 commit a1ecdbf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/bundler/inline.rb
Expand Up @@ -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
Expand Down Expand Up @@ -70,6 +72,8 @@ def definition.lock(*); end
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

0 comments on commit a1ecdbf

Please sign in to comment.