ruby-changes:71642
From: Ashley <ko1@a...>
Date: Wed, 6 Apr 2022 08:55:16 +0900 (JST)
Subject: [ruby-changes:71642] 925d73b3ee (master): [rubygems/rubygems] Make changes <2.6 compatible
https://git.ruby-lang.org/ruby.git/commit/?id=925d73b3ee From 925d73b3eec1aa213173c24c3b784bbb7debe79e Mon Sep 17 00:00:00 2001 From: Ashley Ellis Pierce <anellis12@g...> Date: Mon, 24 Jan 2022 17:09:25 -0500 Subject: [rubygems/rubygems] Make changes <2.6 compatible Multiple params to merge was not introduced until Ruby 2.6, so this merges the two additional params together first and then merges that with the request body https://github.com/rubygems/rubygems/commit/870f7e9a1c --- lib/rubygems/gemcutter_utilities.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/rubygems/gemcutter_utilities.rb b/lib/rubygems/gemcutter_utilities.rb index 3f111c628e..9fd788793c 100644 --- a/lib/rubygems/gemcutter_utilities.rb +++ b/lib/rubygems/gemcutter_utilities.rb @@ -165,12 +165,14 @@ module Gem::GemcutterUtilities https://github.com/ruby/ruby/blob/trunk/lib/rubygems/gemcutter_utilities.rb#L165 key_name = get_key_name(scope) scope_params = get_scope_params(scope) mfa_params = get_mfa_params(email, password) + all_params = scope_params.merge(mfa_params) + response = rubygems_api_request(:post, "api/v1/api_key", sign_in_host, scope: scope) do |request| request.basic_auth email, password request["OTP"] = otp if otp - request.body = URI.encode_www_form({ name: key_name }.merge(scope_params, mfa_params)) + request.body = URI.encode_www_form({ name: key_name }.merge(all_params)) end with_response response do |resp| -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/