instance method
Gem::VersionOption#add_platform_option
add_platform_option(task = command, *wrap)
lib/rubygems/version_option.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/rubygems/version_option.rb, line 18
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.