From d35a2bd4dfdb974ff741736ad27b420c40365515 Mon Sep 17 00:00:00 2001 From: hsbt Date: Mon, 17 Nov 2014 03:55:02 +0000 Subject: * lib/rubygems/*, test/rubygems/*: Update to RubyGems 2.4.4 master (2f6e42e). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/rubygems/commands/contents_command.rb | 1 - lib/rubygems/commands/update_command.rb | 2 -- lib/rubygems/dependency.rb | 2 +- lib/rubygems/indexer.rb | 2 +- lib/rubygems/package/old.rb | 4 ++-- lib/rubygems/remote_fetcher.rb | 6 +++++- lib/rubygems/request/connection_pools.rb | 6 +++++- lib/rubygems/request/http_pool.rb | 9 +++++++++ lib/rubygems/user_interaction.rb | 1 - 9 files changed, 23 insertions(+), 10 deletions(-) (limited to 'lib/rubygems') diff --git a/lib/rubygems/commands/contents_command.rb b/lib/rubygems/commands/contents_command.rb index 9a1c6c532f..4b944f18be 100644 --- a/lib/rubygems/commands/contents_command.rb +++ b/lib/rubygems/commands/contents_command.rb @@ -146,7 +146,6 @@ prefix or only the files that are requireable. def path_description spec_dirs # :nodoc: if spec_dirs.empty? then - spec_dirs = Gem::Specification.dirs "default gem paths" else "specified path" diff --git a/lib/rubygems/commands/update_command.rb b/lib/rubygems/commands/update_command.rb index b132089612..001dd777cc 100644 --- a/lib/rubygems/commands/update_command.rb +++ b/lib/rubygems/commands/update_command.rb @@ -84,8 +84,6 @@ command to remove old versions. end def execute - hig = {} - if options[:system] then update_rubygems return diff --git a/lib/rubygems/dependency.rb b/lib/rubygems/dependency.rb index b72a540dc8..5924d2fc6b 100644 --- a/lib/rubygems/dependency.rb +++ b/lib/rubygems/dependency.rb @@ -281,7 +281,7 @@ class Gem::Dependency } end - matches = matches.sort_by { |s| s.sort_obj } # HACK: shouldn't be needed + matches.sort_by { |s| s.sort_obj } # HACK: shouldn't be needed end ## diff --git a/lib/rubygems/indexer.rb b/lib/rubygems/indexer.rb index 1c7f8e709f..f94fb1bcb8 100644 --- a/lib/rubygems/indexer.rb +++ b/lib/rubygems/indexer.rb @@ -235,7 +235,7 @@ class Gem::Indexer sanitize spec spec - rescue SignalException => e + rescue SignalException alert_error "Received signal, exiting" raise rescue Exception => e diff --git a/lib/rubygems/package/old.rb b/lib/rubygems/package/old.rb index 65bcbb2283..d7b228d893 100644 --- a/lib/rubygems/package/old.rb +++ b/lib/rubygems/package/old.rb @@ -153,10 +153,10 @@ class Gem::Package::Old < Gem::Package begin @spec = Gem::Specification.from_yaml yaml - rescue yaml_error => e + rescue yaml_error raise Gem::Exception, "Failed to parse gem specification out of gem file" end - rescue ArgumentError => e + rescue ArgumentError raise Gem::Exception, "Failed to parse gem specification out of gem file" end diff --git a/lib/rubygems/remote_fetcher.rb b/lib/rubygems/remote_fetcher.rb index 607827c47e..d42a7bd9de 100644 --- a/lib/rubygems/remote_fetcher.rb +++ b/lib/rubygems/remote_fetcher.rb @@ -326,7 +326,7 @@ class Gem::RemoteFetcher def correct_for_windows_path(path) if path[0].chr == '/' && path[1].chr =~ /[a-z]/i && path[2].chr == ':' - path = path[1..-1] + path[1..-1] else path end @@ -352,6 +352,10 @@ class Gem::RemoteFetcher uri.scheme.downcase == 'https' end + def close_all + @pools.each_value {|pool| pool.close_all} + end + protected # we have our own signing code here to avoid a dependency on the aws-sdk gem diff --git a/lib/rubygems/request/connection_pools.rb b/lib/rubygems/request/connection_pools.rb index 27ee99c20d..7a0a6e6e74 100644 --- a/lib/rubygems/request/connection_pools.rb +++ b/lib/rubygems/request/connection_pools.rb @@ -28,6 +28,10 @@ class Gem::Request::ConnectionPools # :nodoc: end end + def close_all + @pools.each_value {|pool| pool.close_all} + end + private ## @@ -69,7 +73,7 @@ class Gem::Request::ConnectionPools # :nodoc: Gem::UriFormatter.new(proxy_uri.password).unescape, ] elsif no_proxy? uri.host, no_proxy then - net_http_args += [nil, nil] + net_http_args + [nil, nil] else net_http_args end diff --git a/lib/rubygems/request/http_pool.rb b/lib/rubygems/request/http_pool.rb index 61c8884af7..c9a1858b98 100644 --- a/lib/rubygems/request/http_pool.rb +++ b/lib/rubygems/request/http_pool.rb @@ -23,6 +23,15 @@ class Gem::Request::HTTPPool # :nodoc: @queue.push connection end + def close_all + until @queue.empty? + if connection = @queue.pop(true) and connection.started? + connection.finish + end + end + @queue.push(nil) + end + private def make_connection diff --git a/lib/rubygems/user_interaction.rb b/lib/rubygems/user_interaction.rb index 917b4ea5aa..44ff2d33ff 100644 --- a/lib/rubygems/user_interaction.rb +++ b/lib/rubygems/user_interaction.rb @@ -318,7 +318,6 @@ class Gem::StreamUI elsif Gem.win_platform? def _gets_noecho require "Win32API" - char = nil password = '' while char = Win32API.new("crtdll", "_getch", [ ], "L").Call do -- cgit v1.2.3