Handles the platforms: option from options. Returns true if the
platform
matches the current platform.
# File lib/rubygems/request_set/gem_dependency_api.rb, line 487
def gem_platforms options # :nodoc:
platform_names = Array(options.delete :platform)
platform_names.concat Array(options.delete :platforms)
platform_names.concat @current_platforms if @current_platforms
return true if platform_names.empty?
platform_names.any? do |platform_name|
raise ArgumentError, "unknown platform #{platform_name.inspect}" unless
platform = PLATFORM_MAP[platform_name]
next false unless Gem::Platform.match platform
if engines = ENGINE_MAP[platform_name] then
next false unless engines.include? Gem.ruby_engine
end
case WINDOWS[platform_name]
when :only then
next false unless Gem.win_platform?
when :never then
next false if Gem.win_platform?
end
VERSION_MAP[platform_name].satisfied_by? Gem.ruby_version
end
end