diff options
author | Ellen Marie Dash <[email protected]> | 2024-12-31 17:04:16 -0500 |
---|---|---|
committer | git <[email protected]> | 2025-01-09 18:13:57 +0000 |
commit | d96cc52ef1857297ffd608cf6a1eef1022286ebd (patch) | |
tree | 7f2a1f4a2e6c0d33e34e887758e10e22e71b1c54 /lib/rubygems/commands | |
parent | 2da91080d3120057a1efd51a08f350dcba26faab (diff) |
[rubygems/rubygems] Add credentials file path to "gem env".
There are 3 possible locations:
- $HOME/.gem/credentials
- $XDG_DATA_HOME/gem/credentials
- $HOME/.local/share/gem/credentials
https://github.com/rubygems/rubygems/commit/c51756b96e
Diffstat (limited to 'lib/rubygems/commands')
-rw-r--r-- | lib/rubygems/commands/environment_command.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/rubygems/commands/environment_command.rb b/lib/rubygems/commands/environment_command.rb index 8ed0996069..aea8c0d7de 100644 --- a/lib/rubygems/commands/environment_command.rb +++ b/lib/rubygems/commands/environment_command.rb @@ -15,6 +15,7 @@ class Gem::Commands::EnvironmentCommand < Gem::Command version display the gem format version remotesources display the remote gem servers platform display the supported gem platforms + credentials display the path where credentials are stored <omitted> display everything EOF args.gsub(/^\s+/, "") @@ -88,6 +89,8 @@ lib/rubygems/defaults/operating_system.rb Gem.sources.to_a.join("\n") when /^platform/ then Gem.platforms.join(File::PATH_SEPARATOR) + when /^credentials/, /^creds/ then + Gem.configuration.credentials_path when nil then show_environment else @@ -114,6 +117,8 @@ lib/rubygems/defaults/operating_system.rb out << " - USER INSTALLATION DIRECTORY: #{Gem.user_dir}\n" + out << " - CREDENTIALS FILE: #{Gem.configuration.credentials_path}\n" + out << " - RUBYGEMS PREFIX: #{Gem.prefix}\n" unless Gem.prefix.nil? out << " - RUBY EXECUTABLE: #{Gem.ruby}\n" |