Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Gem::Commands::PushCommand#validate_attestation_json
validate_attestation_json(data, source)
lib/rubygems/commands/push_command.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/rubygems/commands/push_command.rb, line 219
def validate_attestation_json(data, source)
require "json"
parsed = begin
JSON.parse(data)
rescue JSON::ParserError => e
raise Gem::Exception, "Attestation #{source} is not valid JSON: #{e.message}"
end
raise Gem::Exception, "Attestation #{source} is not a JSON object" unless parsed.is_a?(Hash)
data
end
No documentation available