diff options
Diffstat (limited to 'lib/rubygems/install_update_options.rb')
-rw-r--r-- | lib/rubygems/install_update_options.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/rubygems/install_update_options.rb b/lib/rubygems/install_update_options.rb index dd35acb176..a43a2a171c 100644 --- a/lib/rubygems/install_update_options.rb +++ b/lib/rubygems/install_update_options.rb @@ -9,9 +9,12 @@ require 'rubygems/security' ## # Mixin methods for install and update options for Gem::Commands + module Gem::InstallUpdateOptions + ## # Add the install/update options to the option parser. + def add_install_update_options OptionParser.accept Gem::Security::Policy do |value| value = Gem::Security::Policies[value] @@ -92,7 +95,7 @@ module Gem::InstallUpdateOptions add_option(:"Install/Update", '--[no-]user-install', 'Install in user\'s home directory instead', - 'of GEM_HOME. Defaults to using home directory', + 'of GEM_HOME. Defaults to using home', 'only if GEM_HOME is not writable.') do |value, options| options[:user_install] = value end @@ -102,9 +105,18 @@ module Gem::InstallUpdateOptions "dependencies") do |value, options| options[:development] = true end + + add_option(:"Install/Update", "--prerelease", + "Install prerelease versions of a gem if", + "available. Defaults to skipping", + "prereleases.") do |value, options| + options[:prerelease] = true + end end + ## # Default options for the gem install command. + def install_update_defaults_str '--rdoc --no-force --no-test --wrappers' end |