diff options
author | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-22 08:24:42 +0000 |
---|---|---|
committer | drbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-22 08:24:42 +0000 |
commit | 372dcece3f69989d133f720468f1e24aa1133cda (patch) | |
tree | c173ca48a23ce18afa44feb15bf68d2dd14ac619 /lib/rubygems/remote_fetcher.rb | |
parent | d0e5a34ac7c34e70c145024a0fed8f6042814f29 (diff) | |
download | ruby-372dcece3f69989d133f720468f1e24aa1133cda.tar.gz |
Update to RubyGems 1.3.7.pre.1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/remote_fetcher.rb')
-rw-r--r-- | lib/rubygems/remote_fetcher.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/rubygems/remote_fetcher.rb b/lib/rubygems/remote_fetcher.rb index dbd4cef816..07cd55b161 100644 --- a/lib/rubygems/remote_fetcher.rb +++ b/lib/rubygems/remote_fetcher.rb @@ -88,7 +88,9 @@ class Gem::RemoteFetcher # Always escape URI's to deal with potential spaces and such unless URI::Generic === source_uri - source_uri = URI.parse(URI.escape(source_uri)) + source_uri = URI.parse(URI.const_defined?(:DEFAULT_PARSER) ? + URI::DEFAULT_PARSER.escape(source_uri) : + URI.escape(source_uri)) end scheme = source_uri.scheme @@ -252,6 +254,8 @@ class Gem::RemoteFetcher connection.start unless connection.started? connection + rescue Errno::EHOSTDOWN => e + raise FetchError.new(e.message, uri) end ## @@ -309,7 +313,7 @@ class Gem::RemoteFetcher request.basic_auth uri.user, uri.password end - ua = "RubyGems/#{Gem::RubyGemsVersion} #{Gem::Platform.local}" + ua = "RubyGems/#{Gem::VERSION} #{Gem::Platform.local}" ua << " Ruby/#{RUBY_VERSION} (#{RUBY_RELEASE_DATE}" ua << " patchlevel #{RUBY_PATCHLEVEL}" if defined? RUBY_PATCHLEVEL ua << ")" @@ -351,7 +355,9 @@ class Gem::RemoteFetcher # HACK work around EOFError bug in Net::HTTP # NOTE Errno::ECONNABORTED raised a lot on Windows, and make impossible # to install gems. - rescue EOFError, Errno::ECONNABORTED, Errno::ECONNRESET, Errno::EPIPE + rescue EOFError, Timeout::Error, + Errno::ECONNABORTED, Errno::ECONNRESET, Errno::EPIPE + requests = @requests[connection.object_id] say "connection reset after #{requests} requests, retrying" if Gem.configuration.really_verbose |