Sha256: 4c4703182d02e4730be6d61db896308b64cde2af58a8f5e6c57d9a74792cf4e6
Contents?: true
Size: 1.08 KB
Versions: 27
Compression:
Stored size: 1.08 KB
Contents
# frozen_string_literal: true module Bundler module GemHelpers GENERIC_CACHE = {} # rubocop:disable 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("mingw32"), Gem::Platform.new("x86-mingw32")] ].freeze def generic(p) return p if p == Gem::Platform::RUBY GENERIC_CACHE[p] ||= begin _, found = GENERICS.find do |match, _generic| p.os == match.os && (!match.cpu || p.cpu == match.cpu) end found || Gem::Platform::RUBY end end module_function :generic def generic_local_platform generic(Gem::Platform.local) end module_function :generic_local_platform end end
Version data entries
27 entries across 27 versions & 2 rubygems