1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[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:
David Rodríguez 2022-08-19 14:03:43 +02:00 committed by git
parent b87ddd7538
commit 560941e711
2 changed files with 15 additions and 1 deletions

View file

@ -54,7 +54,7 @@ def gemfile(install = false, options = {}, &gemfile)
Bundler.ui = install ? ui : Bundler::UI::Silent.new
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.post_install_messages.each do |name, message|
Bundler.ui.info "Post-install message from #{name}:\n#{message}"

View file

@ -355,6 +355,20 @@ RSpec.describe "bundler/inline#gemfile" do
expect(err).to be_empty
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
ENV["BUNDLE_GEMFILE"] = ""
script <<-RUBY