Class | Gem::Commands::PushCommand |
In: |
lib/rubygems/commands/push_command.rb
|
Parent: | Gem::Command |
# File lib/rubygems/commands/push_command.rb, line 21 21: def initialize 22: super 'push', description 23: add_proxy_option 24: end
# File lib/rubygems/commands/push_command.rb, line 26 26: def execute 27: sign_in 28: send_gem get_one_gem_name 29: end
# File lib/rubygems/commands/push_command.rb, line 31 31: def send_gem name 32: say "Pushing gem to RubyGems.org..." 33: 34: response = rubygems_api_request :post, "api/v1/gems" do |request| 35: request.body = Gem.read_binary name 36: request.add_field "Content-Length", request.body.size 37: request.add_field "Content-Type", "application/octet-stream" 38: request.add_field "Authorization", Gem.configuration.rubygems_api_key 39: end 40: 41: with_response response 42: end