From 08f8cfe14e0f8937e3bcf8a22becdc5ce60b920e Mon Sep 17 00:00:00 2001 From: hsbt Date: Tue, 5 Mar 2019 03:32:58 +0000 Subject: 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 --- lib/rubygems/commands/yank_command.rb | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/rubygems/commands/yank_command.rb') 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) -- cgit v1.2.3