Skip to content

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_api_key_for

credential_store_api_key_for(host)

Looks up host‘s own API key from the credential store, when the credential_store setting is on. Only the host-specific account is consulted: falling back to the default account here would send the RubyGems.org key to whatever host was asked for, ahead of that host’s own key in the credentials file. credential_store_default_api_key covers the default account, at the precedence the credentials file uses for it.