summaryrefslogtreecommitdiff
path: root/lib/rubygems/commands/yank_command.rb
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-03-05 03:32:58 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-03-05 03:32:58 +0000
commit08f8cfe14e0f8937e3bcf8a22becdc5ce60b920e (patch)
tree30977064b5f93f9ac5b01b2a676f6d6ffdcec652 /lib/rubygems/commands/yank_command.rb
parent593505ac6f802d2b5bff469425b7c76b65cc9b10 (diff)
Merge RubyGems upstream: 56c0bbb69e4506bda7ef7f447dfec5db820df20b
It fixed the multiple vulnerabilities. https://blog.rubygems.org/2019/03/05/security-advisories-2019-03.html git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67168 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/commands/yank_command.rb')
-rw-r--r--lib/rubygems/commands/yank_command.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/rubygems/commands/yank_command.rb b/lib/rubygems/commands/yank_command.rb
index be675fa460..3ca05756f6 100644
--- a/lib/rubygems/commands/yank_command.rb
+++ b/lib/rubygems/commands/yank_command.rb
@@ -33,6 +33,7 @@ data you will need to change them immediately and yank your gem.
add_version_option("remove")
add_platform_option("remove")
+ add_otp_option
add_option('--host HOST',
'Yank from another gemcutter-compatible host',
@@ -62,7 +63,10 @@ data you will need to change them immediately and yank your gem.
def yank_gem(version, platform)
say "Yanking gem from #{self.host}..."
- yank_api_request(:delete, version, platform, "api/v1/gems/yank")
+ args = [:delete, version, platform, "api/v1/gems/yank"]
+ response = yank_api_request(*args)
+
+ say response.body
end
private
@@ -71,6 +75,7 @@ data you will need to change them immediately and yank your gem.
name = get_one_gem_name
response = rubygems_api_request(method, api, host) do |request|
request.add_field("Authorization", api_key)
+ request.add_field("OTP", options[:otp]) if options[:otp]
data = {
'gem_name' => name,
@@ -80,7 +85,7 @@ data you will need to change them immediately and yank your gem.
request.set_form_data data
end
- say response.body
+ response
end
def get_version_from_requirements(requirements)