| Server IP : 217.160.0.244 / Your IP : 216.73.216.36 Web Server : Apache System : Linux infong-eu155 4.4.400-icpu-108 #2 SMP Wed Feb 11 11:51:01 UTC 2026 x86_64 User : u100174116 ( 6746176) PHP Version : 8.5.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/ruby/3.3.0/rubygems/ |
Upload File : |
# frozen_string_literal: true
#--
# Copyright 2006 by Chad Fowler, Rich Kilmer, Jim Weirich and others.
# All rights reserved.
# See LICENSE.txt for permissions.
#++
require_relative "../rubygems"
# forward-declare
module Gem::Security # :nodoc:
class Policy # :nodoc:
end
end
##
# Mixin methods for security option for Gem::Commands
module Gem::SecurityOption
def add_security_option
Gem::OptionParser.accept Gem::Security::Policy do |value|
require_relative "security"
raise Gem::OptionParser::InvalidArgument, "OpenSSL not installed" unless
defined?(Gem::Security::HighSecurity)
policy = Gem::Security::Policies[value]
unless policy
valid = Gem::Security::Policies.keys.sort
raise Gem::OptionParser::InvalidArgument, "#{value} (#{valid.join ", "} are valid)"
end
policy
end
add_option(:"Install/Update", "-P", "--trust-policy POLICY",
Gem::Security::Policy,
"Specify gem trust policy") do |value, options|
options[:security_policy] = value
end
end
end