aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/commands/push_command.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rubygems/commands/push_command.rb')
-rw-r--r--lib/rubygems/commands/push_command.rb10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/rubygems/commands/push_command.rb b/lib/rubygems/commands/push_command.rb
index 035a03e5e7..6adeff6b30 100644
--- a/lib/rubygems/commands/push_command.rb
+++ b/lib/rubygems/commands/push_command.rb
@@ -76,13 +76,17 @@ You can upgrade or downgrade to the latest release version with:
@host = gem_data.spec.metadata['default_gem_server']
end
- # Always include this, even if it's nil
- args << @host
+ push_host = nil
if gem_data.spec.metadata.has_key?('allowed_push_host')
- args << gem_data.spec.metadata['allowed_push_host']
+ push_host = gem_data.spec.metadata['allowed_push_host']
end
+ @host ||= push_host
+
+ # Always include @host, even if it's nil
+ args += [ @host, push_host ]
+
say "Pushing gem to #{@host || Gem.host}..."
response = rubygems_api_request(*args) do |request|