From d96cc52ef1857297ffd608cf6a1eef1022286ebd Mon Sep 17 00:00:00 2001 From: Ellen Marie Dash Date: Tue, 31 Dec 2024 17:04:16 -0500 Subject: [PATCH] [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 --- lib/rubygems/commands/environment_command.rb | 5 +++++ 1 file changed, 5 insertions(+) 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 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"