summaryrefslogtreecommitdiff
path: root/lib/rubygems/commands/push_command.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-18 21:29:41 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-09-18 21:29:41 +0000
commit95683e5cb2d1ab8351402b09ef853dcdf875bf8d (patch)
tree44500dba22e9aa94ecc5d4fd348512d0fb236501 /lib/rubygems/commands/push_command.rb
parent81629f05312cc4df2193a17f13c581eda174d9af (diff)
* lib/rubygems: Update to RubyGems 2.2.0.preview.1
This brings several new features to RubyGems summarized here: https://github.com/rubygems/rubygems/blob/v2.2.0.preview.1/History.txt * test/rubygems: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/commands/push_command.rb')
-rw-r--r--lib/rubygems/commands/push_command.rb13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/rubygems/commands/push_command.rb b/lib/rubygems/commands/push_command.rb
index b90be7bd10..6899b489ad 100644
--- a/lib/rubygems/commands/push_command.rb
+++ b/lib/rubygems/commands/push_command.rb
@@ -69,13 +69,18 @@ You can upgrade or downgrade to the latest release version with:
terminate_interaction 1
end
+ gem_data = Gem::Package.new(name)
+
unless @host then
- if gem_data = Gem::Package.new(name) then
- @host = gem_data.spec.metadata['default_gem_server']
- end
+ @host = gem_data.spec.metadata['default_gem_server']
end
- args << @host if @host
+ # Always include this, even if it's nil
+ args << @host
+
+ if gem_data.spec.metadata.has_key?('allowed_push_host')
+ args << gem_data.spec.metadata['allowed_push_host']
+ end
say "Pushing gem to #{@host || Gem.host}..."