diff options
author | Hiroshi SHIBATA <[email protected]> | 2019-06-01 12:49:40 +0300 |
---|---|---|
committer | Hiroshi SHIBATA <[email protected]> | 2019-06-09 12:44:10 +0900 |
commit | 8f37629519ad330032a38ac0e871b2912ed38a1b (patch) | |
tree | bb0529b77583d47993d8b0d608d68896aa3a5298 /lib/bundler/inline.rb | |
parent | 66508992483ae5d77b56a98427c50c772341c0ac (diff) |
Merge bundler master from upstream.
Pick from 8dd59e3ba97eb80a599f8149f31bf40773b69dc0
Diffstat (limited to 'lib/bundler/inline.rb')
-rw-r--r-- | lib/bundler/inline.rb | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/lib/bundler/inline.rb b/lib/bundler/inline.rb index 93355c9460..317bf892ab 100644 --- a/lib/bundler/inline.rb +++ b/lib/bundler/inline.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require "bundler/compatibility_guard" +require_relative "compatibility_guard" # Allows for declaring a Gemfile inline in a ruby script, optionally installing # any gems that aren't already installed on the user's system. @@ -32,7 +32,7 @@ require "bundler/compatibility_guard" # puts Pod::VERSION # => "0.34.4" # def gemfile(install = false, options = {}, &gemfile) - require "bundler" + require_relative "../bundler" opts = options.dup ui = opts.delete(:ui) { Bundler::UI::Shell.new } @@ -49,26 +49,28 @@ def gemfile(install = false, options = {}, &gemfile) builder = Bundler::Dsl.new builder.instance_eval(&gemfile) - definition = builder.to_definition(nil, true) - def definition.lock(*); end - definition.validate_runtime! + Bundler.settings.temporary(:frozen => false) do + definition = builder.to_definition(nil, true) + def definition.lock(*); end + definition.validate_runtime! - missing_specs = proc do - definition.missing_specs? - end + missing_specs = proc do + definition.missing_specs? + end - Bundler.ui = ui if install - if install || missing_specs.call - Bundler.settings.temporary(:inline => true) do - installer = Bundler::Installer.install(Bundler.root, definition, :system => true) - installer.post_install_messages.each do |name, message| - Bundler.ui.info "Post-install message from #{name}:\n#{message}" + Bundler.ui = ui if install + if install || missing_specs.call + Bundler.settings.temporary(:inline => true, :disable_platform_warnings => true) do + installer = Bundler::Installer.install(Bundler.root, definition, :system => true) + installer.post_install_messages.each do |name, message| + Bundler.ui.info "Post-install message from #{name}:\n#{message}" + end end end - end - runtime = Bundler::Runtime.new(nil, definition) - runtime.setup.require + runtime = Bundler::Runtime.new(nil, definition) + runtime.setup.require + end ensure bundler_module = class << Bundler; self; end bundler_module.send(:define_method, :root, old_root) if old_root |