aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rubygems/install_update_options.rb
diff options
context:
space:
mode:
authorryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-19 21:23:04 +0000
committerryan <ryan@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-01-19 21:23:04 +0000
commit64847a9cfe467b808ca5e8148dfa85a059198963 (patch)
treeb21ca4404f92f1fe269347a8d624cf188e7fbc97 /lib/rubygems/install_update_options.rb
parentdf2762fb1aaa82577b4e3e8df67cc56b7aefdfb8 (diff)
downloadruby-64847a9cfe467b808ca5e8148dfa85a059198963.tar.gz
Importing rubygems @ c2d4131: Deal with platforms that have DLEXT2 == nil. Fixes RF#28867
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/install_update_options.rb')
-rw-r--r--lib/rubygems/install_update_options.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/lib/rubygems/install_update_options.rb b/lib/rubygems/install_update_options.rb
index f3ec1aa12a..5073be0c21 100644
--- a/lib/rubygems/install_update_options.rb
+++ b/lib/rubygems/install_update_options.rb
@@ -11,7 +11,13 @@
#++
require 'rubygems'
-require 'rubygems/security'
+
+# forward-declare
+
+module Gem::Security # :nodoc:
+ class Policy # :nodoc:
+ end
+end
##
# Mixin methods for install and update options for Gem::Commands
@@ -23,8 +29,12 @@ module Gem::InstallUpdateOptions
def add_install_update_options
OptionParser.accept Gem::Security::Policy do |value|
+ require 'rubygems/security'
+
value = Gem::Security::Policies[value]
- raise OptionParser::InvalidArgument, value if value.nil?
+ valid = Gem::Security::Policies.keys.sort
+ message = "#{value} (#{valid.join ', '} are valid)"
+ raise OptionParser::InvalidArgument, message if value.nil?
value
end