[前][次][番号順一覧][スレッド一覧]

ruby-changes:73003

From: David <ko1@a...>
Date: Sun, 21 Aug 2022 17:54:21 +0900 (JST)
Subject: [ruby-changes:73003] 560941e711 (master): [rubygems/rubygems] Fix edge case where `bundler/inline` unintentionally skips install

https://git.ruby-lang.org/ruby.git/commit/?id=560941e711

From 560941e711bed8e8cdd0183b76d9e2057cce6806 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...>
Date: Fri, 19 Aug 2022 14:03:43 +0200
Subject: [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
---
 lib/bundler/inline.rb               |  2 +-
 spec/bundler/runtime/inline_spec.rb | 14 ++++++++++++++
 2 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/lib/bundler/inline.rb b/lib/bundler/inline.rb
index 8ef580f1f0..25e055fbe4 100644
--- a/lib/bundler/inline.rb
+++ b/lib/bundler/inline.rb
@@ -54,7 +54,7 @@ def gemfile(install = false, options = {}, &gemfile) https://github.com/ruby/ruby/blob/trunk/lib/bundler/inline.rb#L54
 
       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}"
diff --git a/spec/bundler/runtime/inline_spec.rb b/spec/bundler/runtime/inline_spec.rb
index dd22c86f90..e3cf5020ec 100644
--- a/spec/bundler/runtime/inline_spec.rb
+++ b/spec/bundler/runtime/inline_spec.rb
@@ -355,6 +355,20 @@ RSpec.describe "bundler/inline#gemfile" do https://github.com/ruby/ruby/blob/trunk/spec/bundler/runtime/inline_spec.rb#L355
     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
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]