diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-02-22 02:52:35 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-02-22 02:52:35 +0000 |
commit | b551e8c8b36766651be4e782e09e3b02e7d14a10 (patch) | |
tree | e164a1ef908bd4451568abf05b688f1593915b81 /lib/rubygems/version_option.rb | |
parent | 65544f575b25b18dc27f9364f973556ddb48538f (diff) |
* lib/rubygems: update to 1.3.6.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rubygems/version_option.rb')
-rw-r--r-- | lib/rubygems/version_option.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/rubygems/version_option.rb b/lib/rubygems/version_option.rb index a69b732f78..a3de4dc9e7 100644 --- a/lib/rubygems/version_option.rb +++ b/lib/rubygems/version_option.rb @@ -6,10 +6,14 @@ require 'rubygems' +## # Mixin methods for --version and --platform Gem::Command options. + module Gem::VersionOption + ## # Add the --platform option to the option parser. + def add_platform_option(task = command, *wrap) OptionParser.accept Gem::Platform do |value| if value == Gem::Platform::RUBY then @@ -31,7 +35,19 @@ module Gem::VersionOption end end + ## + # Add the --prerelease option to the option parser. + + def add_prerelease_option(*wrap) + add_option("--[no-]prerelease", + "Allow prerelease versions of a gem", *wrap) do |value, options| + options[:prerelease] = value + end + end + + ## # Add the --version option to the option parser. + def add_version_option(task = command, *wrap) OptionParser.accept Gem::Requirement do |value| Gem::Requirement.new value |