Sha256: af7911ff8a2d66f41e8136b57683fd6a54fdf96536308d70e518ad53d8a36788

Contents?: true

Size: 731 Bytes

Versions: 41

Compression:

Stored size: 731 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('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

41 entries across 41 versions & 1 rubygems

Version Path
bundler-1.7.15 lib/bundler/gem_helpers.rb
bundler-1.7.14 lib/bundler/gem_helpers.rb
bundler-1.7.13 lib/bundler/gem_helpers.rb
bundler-1.7.12 lib/bundler/gem_helpers.rb
bundler-1.7.11 lib/bundler/gem_helpers.rb
bundler-1.7.10 lib/bundler/gem_helpers.rb
bundler-1.7.9 lib/bundler/gem_helpers.rb
bundler-1.7.8 lib/bundler/gem_helpers.rb
bundler-1.7.7 lib/bundler/gem_helpers.rb
bundler-1.7.6 lib/bundler/gem_helpers.rb
bundler-1.6.9 lib/bundler/gem_helpers.rb
bundler-1.7.5 lib/bundler/gem_helpers.rb
bundler-1.6.8 lib/bundler/gem_helpers.rb
bundler-1.7.4 lib/bundler/gem_helpers.rb
bundler-1.6.7 lib/bundler/gem_helpers.rb
bundler-1.7.3 lib/bundler/gem_helpers.rb
bundler-1.6.6 lib/bundler/gem_helpers.rb
bundler-1.7.2 lib/bundler/gem_helpers.rb
bundler-1.7.1 lib/bundler/gem_helpers.rb
bundler-1.7.1.pre.3 lib/bundler/gem_helpers.rb