pantry/projects/rubygems.org/fit-n-finish2-pre357.patch
Jacob Heider 5c1ae5bbb7 fix(rubygems)
repair broken patches

closes #5679
closes #5863
2024-04-11 12:42:29 -04:00

40 lines
1.2 KiB
Diff

diff --git a/lib/rubygems/defaults.rb b/lib/rubygems/defaults.rb
index b186375..de168c4 100644
--- a/lib/rubygems/defaults.rb
+++ b/lib/rubygems/defaults.rb
@@ -111,18 +104,17 @@ def self.user_dir
# The path to standard location of the user's configuration directory.
def self.config_home
- @config_home ||= (ENV["XDG_CONFIG_HOME"] || File.join(Gem.user_home, ".config"))
+ @config_home ||= (ENV["XDG_CONFIG_HOME"] || File.join(Gem.user_home, ".gem"))
end
##
# Finds the user's config file
def self.find_config_file
- gemrc = File.join Gem.user_home, ".gemrc"
- if File.exist? gemrc
- gemrc
+ @gemrc = if ENV["XDG_CONFIG_HOME"]
+ File.join ENV["XDG_CONFIG_HOME"], "gemrc"
else
- File.join Gem.config_home, "gem", "gemrc"
+ File.join Gem.user_home, ".gemrc"
end
end
@@ -151,7 +143,11 @@ def self.cache_home
# The path to standard location of the user's data directory.
def self.data_home
- @data_home ||= (ENV["XDG_DATA_HOME"] || File.join(Gem.user_home, ".local", "share"))
+ @data_home ||= if ENV["XDG_DATA_HOME"]
+ File.join(ENV["XDG_DATA_HOME"], "gem")
+ else
+ File.join(Gem.user_home, ".gem")
+ end
end
##