[rubygems/rubygems] Fix edge case where bundler/inline
unintentionally skips install
If the application has the `no_install` setting set for `bundle package`, then `bundler/inline` would silently skip installing any gems. https://github.com/rubygems/rubygems/commit/7864f49b27
This commit is contained in:
parent
b87ddd7538
commit
560941e711
@ -54,7 +54,7 @@ def gemfile(install = false, options = {}, &gemfile)
|
|||||||
|
|
||||||
Bundler.ui = install ? ui : Bundler::UI::Silent.new
|
Bundler.ui = install ? ui : Bundler::UI::Silent.new
|
||||||
if install || definition.missing_specs?
|
if install || definition.missing_specs?
|
||||||
Bundler.settings.temporary(:inline => true) do
|
Bundler.settings.temporary(:inline => true, :no_install => false) do
|
||||||
installer = Bundler::Installer.install(Bundler.root, definition, :system => true)
|
installer = Bundler::Installer.install(Bundler.root, definition, :system => true)
|
||||||
installer.post_install_messages.each do |name, message|
|
installer.post_install_messages.each do |name, message|
|
||||||
Bundler.ui.info "Post-install message from #{name}:\n#{message}"
|
Bundler.ui.info "Post-install message from #{name}:\n#{message}"
|
||||||
|
@ -355,6 +355,20 @@ RSpec.describe "bundler/inline#gemfile" do
|
|||||||
expect(err).to be_empty
|
expect(err).to be_empty
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "still installs if the application has `bundle package` no_install config set" do
|
||||||
|
bundle "config set --local no_install true"
|
||||||
|
|
||||||
|
script <<-RUBY
|
||||||
|
gemfile do
|
||||||
|
source "#{file_uri_for(gem_repo1)}"
|
||||||
|
gem "rack"
|
||||||
|
end
|
||||||
|
RUBY
|
||||||
|
|
||||||
|
expect(last_command).to be_success
|
||||||
|
expect(system_gem_path("gems/rack-1.0.0")).to exist
|
||||||
|
end
|
||||||
|
|
||||||
it "preserves previous BUNDLE_GEMFILE value" do
|
it "preserves previous BUNDLE_GEMFILE value" do
|
||||||
ENV["BUNDLE_GEMFILE"] = ""
|
ENV["BUNDLE_GEMFILE"] = ""
|
||||||
script <<-RUBY
|
script <<-RUBY
|
||||||
|
Loading…
x
Reference in New Issue
Block a user