Method not available on this version
This method is only available on newer versions.
The first available version (v2_6_3) is shown here.
need_otp?(response)
public
Returns true when the user has enabled multifactor authentication from
response text.
# File lib/rubygems/gemcutter_utilities.rb, line 183
def need_otp?(response)
return unless response.kind_of?(Net::HTTPUnauthorized) &&
response.body.start_with?('You have enabled multifactor authentication')
return true if options[:otp]
say 'You have enabled multi-factor authentication. Please enter OTP code.'
options[:otp] = ask 'Code: '
true
end