Skip to content

Commit d12e41a

Browse files
hsbtclaude
andcommitted
Record why the RubyGems half keeps off
The two sides of one setting now disagree on `off`, so the list has to say why it stays wider here. Nothing on the way in turns `off` into a boolean, and nothing on this side shares the single vocabulary that Bundler's boolean settings all run through. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 0244255 commit d12e41a

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

lib/rubygems/config_file.rb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -852,11 +852,18 @@ def warn_credential_store_fallback
852852
alert_warning "Could not write the API key to the credential store, so it was written to #{credentials_path} in plain text."
853853
end
854854

855-
# Anything that reads as a boolean is one, so RUBYGEMS_CREDENTIAL_STORE=0
856-
# turns the store off rather than naming a backend gem "0".
857855
CREDENTIAL_STORE_OFF = %w[false 0 no off f n].freeze
858856
CREDENTIAL_STORE_ON = %w[true 1 yes on t y].freeze
859857

858+
#--
859+
# Anything that reads as a boolean is one, so RUBYGEMS_CREDENTIAL_STORE=0
860+
# turns the store off rather than naming a backend gem "0". Both lists are
861+
# this setting's own. Nothing on the way here turns `off` into a boolean, so
862+
# a gemrc saying `off` arrives as a String just as the environment variable
863+
# does. Bundler leaves `off` out of its half because every one of its
864+
# boolean settings shares a single vocabulary that has never had it. Nothing
865+
# here shares that constraint.
866+
860867
def normalize_credential_store(value, default)
861868
# An environment variable can carry bytes String#downcase would reject.
862869
normalized = value.to_s.b.downcase

0 commit comments

Comments
 (0)