Sha256: 26bf9151c285096a791857e5eef063aff23534c2f396dbaa449da209b6dd0d6d

Contents?: true

Size: 886 Bytes

Versions: 5

Compression:

Stored size: 886 Bytes

Contents

module Bundler
  module GemHelpers
    GENERIC_CACHE = {}
    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")]
    ]

    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
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bundler-1.11.2 lib/bundler/gem_helpers.rb
bundler-1.11.1 lib/bundler/gem_helpers.rb
bundler-1.11.0 lib/bundler/gem_helpers.rb
bundler-1.11.0.pre.2 lib/bundler/gem_helpers.rb
bundler-1.11.0.pre.1 lib/bundler/gem_helpers.rb