From c9ee9c1e23ac27cf2699a41e221e05d82f30e4c3 Mon Sep 17 00:00:00 2001 From: Shinichi Maeshima Date: Thu, 7 May 2026 19:03:03 +0900 Subject: [ruby/rubygems] Return exit status 1 only when the config value is nil When using something like `bundle config set foo false`, the config value is converted via `Bundler::Settings#converted_value`, so the stored value becomes `false` instead of the string `"false"`. Because of that, passing `Bundler.settings[name]` directly to an `if` statement can execute `exit 1` even when the value is actually configured. Since config values do not appear to become `nil` explicitly, use `nil?` to determine whether the value is configured. https://github.com/ruby/rubygems/commit/8fd32cb611 --- lib/bundler/cli/config.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/bundler/cli/config.rb b/lib/bundler/cli/config.rb index 8248e3b15b..976cda7484 100644 --- a/lib/bundler/cli/config.rb +++ b/lib/bundler/cli/config.rb @@ -97,10 +97,10 @@ module Bundler confirm(name) end - if current_value - return - else + if current_value.nil? exit 1 + else + return end end -- cgit v1.2.3