Method: Bundler::SpecSet#add_extra_platforms!

Defined in:
lib/bundler/spec_set.rb

#add_extra_platforms!(platforms) ⇒ Object

[View source]

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/bundler/spec_set.rb', line 50

def add_extra_platforms!(platforms)
  return platforms.concat([Gem::Platform::RUBY]).uniq if @specs.empty?

  new_platforms = all_platforms.select do |platform|
    next if platforms.include?(platform)
    next unless GemHelpers.generic(platform) == Gem::Platform::RUBY

    complete_platform(platform)
  end
  return platforms if new_platforms.empty?

  platforms.concat(new_platforms)

  less_specific_platform = new_platforms.find {|platform| platform != Gem::Platform::RUBY && Bundler.local_platform === platform && platform === Bundler.local_platform }
  platforms.delete(Bundler.local_platform) if less_specific_platform

  platforms
end