End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
Gem::Security::Policy.new
new(name, policy = {}, opt = {})
lib/rubygems/security/policy.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/rubygems/security/policy.rb, line 26
def initialize(name, policy = {}, opt = {})
@name = name
@opt = opt
# Default to security
@only_signed = true
@only_trusted = true
@verify_chain = true
@verify_data = true
@verify_root = true
@verify_signer = true
policy.each_pair do |key, val|
case key
when :verify_data then @verify_data = val
when :verify_signer then @verify_signer = val
when :verify_chain then @verify_chain = val
when :verify_root then @verify_root = val
when :only_trusted then @only_trusted = val
when :only_signed then @only_signed = val
end
end
end
Create a new Gem::Security::Policy object with the given mode and options.