From 8b424513fd43c398aaeea5dede8bbc5c51602773 Mon Sep 17 00:00:00 2001 From: drbrain Date: Thu, 26 Jun 2008 02:06:00 +0000 Subject: Upgrade to RubyGems 1.2.0 r1824. Incorporates [ruby-core:17353]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17576 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rubygems/config_file.rb | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'lib/rubygems/config_file.rb') diff --git a/lib/rubygems/config_file.rb b/lib/rubygems/config_file.rb index 8cea513790..c093c31a1b 100644 --- a/lib/rubygems/config_file.rb +++ b/lib/rubygems/config_file.rb @@ -18,6 +18,18 @@ class Gem::ConfigFile DEFAULT_VERBOSITY = true DEFAULT_UPDATE_SOURCES = true + ## + # For Ruby packagers to set configuration defaults. Set in + # rubygems/defaults/operating_system.rb + + OPERATING_SYSTEM_DEFAULTS = {} + + ## + # For Ruby implementers to set configuration defaults. Set in + # rubygems/defaults/#{RUBY_ENGINE}.rb + + PLATFORM_DEFAULTS = {} + system_config_path = begin require 'Win32API' @@ -98,8 +110,14 @@ class Gem::ConfigFile @verbose = DEFAULT_VERBOSITY @update_sources = DEFAULT_UPDATE_SOURCES - @hash = load_file(SYSTEM_WIDE_CONFIG_FILE) - @hash.merge!(load_file(config_file_name.dup.untaint)) + operating_system_config = Marshal.load Marshal.dump(OPERATING_SYSTEM_DEFAULTS) + platform_config = Marshal.load Marshal.dump(PLATFORM_DEFAULTS) + system_config = load_file SYSTEM_WIDE_CONFIG_FILE + user_config = load_file config_file_name.dup.untaint + + @hash = operating_system_config.merge platform_config + @hash = @hash.merge system_config + @hash = @hash.merge user_config # HACK these override command-line args, which is bad @backtrace = @hash[:backtrace] if @hash.key? :backtrace -- cgit v1.2.3