diff options
author | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-08 01:32:18 +0000 |
---|---|---|
committer | hsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-08 01:32:18 +0000 |
commit | c00e84327f14845bd484e76b5ee5dfeb1fa9ce3d (patch) | |
tree | 9f558dafa363f4f0118d504a50cd4461e2821cd1 /lib/rubygems/install_update_options.rb | |
parent | 6b05153a3a75b74b64553d6a46f501d9ee0f0376 (diff) | |
download | ruby-c00e84327f14845bd484e76b5ee5dfeb1fa9ce3d.tar.gz |
Merge rubygems master.
This is RC version of Rubygems 2.7.0.
https://github.com/rubygems/rubygems/commit/688fb7e83c13c3fe7c2bb03c49a2db4c82852aee
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60133 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/install_update_options.rb')
-rw-r--r-- | lib/rubygems/install_update_options.rb | 33 |
1 files changed, 5 insertions, 28 deletions
diff --git a/lib/rubygems/install_update_options.rb b/lib/rubygems/install_update_options.rb index 5559c94370..190372739b 100644 --- a/lib/rubygems/install_update_options.rb +++ b/lib/rubygems/install_update_options.rb @@ -6,37 +6,18 @@ #++ require 'rubygems' - -# forward-declare - -module Gem::Security # :nodoc: - class Policy # :nodoc: - end -end +require 'rubygems/security_option' ## # Mixin methods for install and update options for Gem::Commands module Gem::InstallUpdateOptions + include Gem::SecurityOption ## # Add the install/update options to the option parser. def add_install_update_options - # TODO: use @parser.accept - OptionParser.accept Gem::Security::Policy do |value| - require 'rubygems/security' - - raise OptionParser::InvalidArgument, 'OpenSSL not installed' unless - defined?(Gem::Security::HighSecurity) - - value = Gem::Security::Policies[value] - valid = Gem::Security::Policies.keys.sort - message = "#{value} (#{valid.join ', '} are valid)" - raise OptionParser::InvalidArgument, message if value.nil? - value - end - add_option(:"Install/Update", '-i', '--install-dir DIR', 'Gem repository directory to get installed', 'gems') do |value, options| @@ -124,11 +105,7 @@ module Gem::InstallUpdateOptions options[:wrappers] = value end - add_option(:"Install/Update", '-P', '--trust-policy POLICY', - Gem::Security::Policy, - 'Specify gem trust policy') do |value, options| - options[:security_policy] = value - end + add_security_option add_option(:"Install/Update", '--ignore-dependencies', 'Do not install any required dependent gems') do |value, options| @@ -136,8 +113,8 @@ module Gem::InstallUpdateOptions end add_option(:"Install/Update", '--[no-]format-executable', - 'Make installed executable names match ruby.', - 'If ruby is ruby18, foo_exec will be', + 'Make installed executable names match Ruby.', + 'If Ruby is ruby18, foo_exec will be', 'foo_exec18') do |value, options| options[:format_executable] = value end |