Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Gem::ConfigFile#credential_store_read_failed_for?
credential_store_read_failed_for?(host)
lib/rubygems/config_file.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/rubygems/config_file.rb, line 454
def credential_store_read_failed_for?(host)
return false unless credential_store
return false unless store = active_credential_store
# #rubygems_api_key reads the default account on the way to answering, and
# for the default host that is the only failure that can happen.
return true if store.read_failed?(CREDENTIAL_STORE_DEFAULT_ACCOUNT)
return false if host.nil? || host.to_s.empty?
store.read_failed?(self.class.credential_store_account(host))
end
True when a read for host failed rather than finding nothing. Whether the store holds a key for it is unknowable once the read fails, which is the point: a caller that would otherwise fall through to a key belonging to a different host has to treat “unknown” differently from “absent”.