[前][次][番号順一覧][スレッド一覧]

ruby-changes:61105

From: Thomas <ko1@a...>
Date: Fri, 8 May 2020 14:14:15 +0900 (JST)
Subject: [ruby-changes:61105] 856f2f31ff (master): [rubygems/rubygems] Remove unnecessary code

https://git.ruby-lang.org/ruby.git/commit/?id=856f2f31ff

From 856f2f31ffebd070405821dd41fca9c67fd5cced Mon Sep 17 00:00:00 2001
From: Thomas McDonald <thomasm@p...>
Date: Tue, 28 Apr 2020 17:37:59 +0200
Subject: [rubygems/rubygems] Remove unnecessary code

`@host` _could_ be `nil` at this point, but only if all the conditions
above for setting `@host` were `nil`. In that case, it is guaranteed
to `default_gem_server` metadata is `nil` since it's one of the
branches in that condition. So this code would just be setting an
already `nil` variable to `nil`. Hence, not needed.

https://github.com/rubygems/rubygems/commit/e3ccff3c5c

diff --git a/lib/rubygems/commands/push_command.rb b/lib/rubygems/commands/push_command.rb
index bdb92cb..0c121cb 100644
--- a/lib/rubygems/commands/push_command.rb
+++ b/lib/rubygems/commands/push_command.rb
@@ -72,10 +72,6 @@ The push command will use ~/.gem/credentials to authenticate to a server, but yo https://github.com/ruby/ruby/blob/trunk/lib/rubygems/commands/push_command.rb#L72
 
     gem_data = Gem::Package.new(name)
 
-    unless @host
-      @host = gem_data.spec.metadata['default_gem_server']
-    end
-
     push_host = nil
 
     if gem_data.spec.metadata.has_key?('allowed_push_host')
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]