diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/gem_helpers.rb | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/bundler/gem_helpers.rb b/lib/bundler/gem_helpers.rb index 75243873f2..56aefadc74 100644 --- a/lib/bundler/gem_helpers.rb +++ b/lib/bundler/gem_helpers.rb @@ -4,19 +4,18 @@ module Bundler module GemHelpers GENERIC_CACHE = { Gem::Platform::RUBY => Gem::Platform::RUBY } # rubocop:disable Style/MutableConstant GENERICS = [ - [Gem::Platform.new("java"), Gem::Platform.new("java")], - [Gem::Platform.new("mswin32"), Gem::Platform.new("mswin32")], - [Gem::Platform.new("mswin64"), Gem::Platform.new("mswin64")], - [Gem::Platform.new("universal-mingw32"), Gem::Platform.new("universal-mingw32")], - [Gem::Platform.new("x64-mingw32"), Gem::Platform.new("x64-mingw32")], - [Gem::Platform.new("x86_64-mingw32"), Gem::Platform.new("x64-mingw32")], - [Gem::Platform.new("x64-mingw-ucrt"), Gem::Platform.new("x64-mingw-ucrt")], - [Gem::Platform.new("mingw32"), Gem::Platform.new("x86-mingw32")], + Gem::Platform.new("java"), + Gem::Platform.new("mswin32"), + Gem::Platform.new("mswin64"), + Gem::Platform.new("universal-mingw32"), + Gem::Platform.new("x64-mingw32"), + Gem::Platform.new("x64-mingw-ucrt"), + Gem::Platform.new("x86-mingw32"), ].freeze def generic(p) GENERIC_CACHE[p] ||= begin - _, found = GENERICS.find do |match, _generic| + found = GENERICS.find do |match| p.os == match.os && (!match.cpu || p.cpu == match.cpu) end found || Gem::Platform::RUBY |