diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-02-01 12:43:26 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-02-01 12:43:26 +0000 |
commit | a21d403f21473b21b5766c2483b4325240e9edda (patch) | |
tree | bd10197f9589251f35f0f9dc6fa387f0e298a6ef /lib/rubygems/commands/yank_command.rb | |
parent | 94cfa2893ccab71341d4671201253339d56d6c97 (diff) |
* lib/rubygems.rb, lib/rubygems/*, test/rubygems/*: Update rubygems-2.5.2.
It supports to enable frozen string literal and add `--norc` option for
disable to `.gemrc` configuration.
See 2.5.2 release notes for other fixes and enhancements.
https://github.com/rubygems/rubygems/blob/a8aa3bac723f045c52471c7b9328310a048561e0/History.txt#L3
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53707 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/commands/yank_command.rb')
-rw-r--r-- | lib/rubygems/commands/yank_command.rb | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/lib/rubygems/commands/yank_command.rb b/lib/rubygems/commands/yank_command.rb index ec99bd7df6..0d6575b272 100644 --- a/lib/rubygems/commands/yank_command.rb +++ b/lib/rubygems/commands/yank_command.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true require 'rubygems/command' require 'rubygems/local_remote_options' require 'rubygems/version_option' @@ -32,7 +32,7 @@ as the reason for the removal request. end def usage # :nodoc: - "#{program_name} GEM -v VERSION [-p PLATFORM] [--undo] [--key KEY_NAME]" + "#{program_name} GEM -v VERSION [-p PLATFORM] [--key KEY_NAME] [--host HOST]" end def initialize @@ -41,25 +41,25 @@ as the reason for the removal request. add_version_option("remove") add_platform_option("remove") - add_option('--undo') do |value, options| - options[:undo] = true + add_option('--host HOST', + 'Yank from another gemcutter-compatible host') do |value, options| + options[:host] = value end add_key_option + @host = nil end def execute - sign_in + @host = options[:host] + + sign_in @host version = get_version_from_requirements(options[:version]) platform = get_platform_from_requirements(options) if version then - if options[:undo] then - unyank_gem(version, platform) - else - yank_gem(version, platform) - end + yank_gem(version, platform) else say "A version argument is required: #{usage}" terminate_interaction @@ -71,16 +71,11 @@ as the reason for the removal request. yank_api_request(:delete, version, platform, "api/v1/gems/yank") end - def unyank_gem(version, platform) - say "Unyanking gem from #{host}..." - yank_api_request(:put, version, platform, "api/v1/gems/unyank") - end - private def yank_api_request(method, version, platform, api) name = get_one_gem_name - response = rubygems_api_request(method, api) do |request| + response = rubygems_api_request(method, api, host) do |request| request.add_field("Authorization", api_key) data = { |