lib/rubygems/version_option.rb
##
# Add the --platform option to the option parser.
Add the --platform option to the option parser.
Add the -- platform option to the option parser .
def add_platform_option(task = command, *wrap)
    Gem::OptionParser.accept Gem::Platform do |value|
      if value == Gem::Platform::RUBY
        value
      else
        Gem::Platform.new value
      end
    end
    add_option('--platform PLATFORM', Gem::Platform,
               "Specify the platform of gem to #{task}", *wrap) do
                 |value, options|
      unless options[:added_platform]
        Gem.platforms = [Gem::Platform::RUBY]
        options[:added_platform] = true
      end
      Gem.platforms << value unless Gem.platforms.include? value
    end
  end
def add_platform_option ( task = command , * wrap ) Gem :: OptionParser . accept Gem :: Platform do | value | if value == Gem :: Platform :: RUBY value else Gem :: Platform . new value end end add_option ( '--platform PLATFORM' , Gem :: Platform , "Specify the platform of gem to #{task}" , * wrap ) do | value , options | unless options [ :added_platform ] Gem . platforms = [ Gem :: Platform :: RUBY ] options [ :added_platform ] = true end Gem . platforms << value unless Gem . platforms . include? value end end
Add the --platform option to the option parser.
Add the -- platform option to the option parser .
task
<not_specific>
command
<not_specific>
wrap
<not_specific>