lib/rubygems_plugin.rb in rubygems_ssl-client-certs-0.0.2.pre.alpha.pre.54 vs lib/rubygems_plugin.rb in rubygems_ssl-client-certs-0.0.2.pre.alpha.pre.55

- old
+ new

@@ -16,28 +16,31 @@ class << self unless self.method_defined? :__new__ $stderr.puts "aliasing new to __new__" alias_method :__new__, :new end - if Gem.instance_variable_get(:@configuration) then - $stderr.puts "forcing a reload of the Gem configuration" - Gem.configuration = Gem::ConfigFile.new [] - end + def new(*args) $stderr.puts "instantiating new Gem::ConfigFile with patch" config = __new__(*args) config.set_ssl_vars return config end + end def set_ssl_vars $stderr.puts "Configuring SSL variables for Gem::ConfigFile" @ssl_verify_mode = @hash[:ssl_verify_mode] if @hash.key? :ssl_verify_mode @ssl_ca_cert = @hash[:ssl_ca_cert] if @hash.key? :ssl_ca_cert @ssl_ca_cert = ENV['BUNDLE_SSL_CA_CERT'] unless @ssl_ca_cert @ssl_client_cert = @hash[:ssl_client_cert] if @hash.key? :ssl_client_cert @ssl_client_cert = ENV['BUNDLE_SSL_CLIENT_CERT'] unless @ssl_client_cert + end + + if Gem.instance_variable_get(:@configuration) then + $stderr.puts "forcing a reload of the Gem configuration" + Gem.configuration = nil end end class Gem::RemoteFetcher