Sha256: fb14dac2a51c8dea42350e453e0825771b593459f521c459e4186df97ceb1e83

Contents?: true

Size: 799 Bytes

Versions: 20

Compression:

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

20 entries across 20 versions & 2 rubygems

Version Path
bundler-1.8.9 lib/bundler/gem_helpers.rb
bundler-1.8.8 lib/bundler/gem_helpers.rb
bundler-1.8.7 lib/bundler/gem_helpers.rb
bundler-1.9.2 lib/bundler/gem_helpers.rb
bundler-1.8.6 lib/bundler/gem_helpers.rb
bundler-1.9.1 lib/bundler/gem_helpers.rb
bundler-1.9.0 lib/bundler/gem_helpers.rb
bundler-1.9.0.pre.1 lib/bundler/gem_helpers.rb
bundler-1.9.0.rc lib/bundler/gem_helpers.rb
bundler-1.9.0.pre lib/bundler/gem_helpers.rb
bundler-1.8.5 lib/bundler/gem_helpers.rb
bundler-1.8.4 lib/bundler/gem_helpers.rb
bundler-1.8.3 lib/bundler/gem_helpers.rb
bundler-1.8.2 lib/bundler/gem_helpers.rb
bundler-1.8.1 lib/bundler/gem_helpers.rb
bundler-1.8.0 lib/bundler/gem_helpers.rb
bundler-1.8.0.pre lib/bundler/gem_helpers.rb
bundler-prehistoric-1.6.2.2 lib/bundler/gem_helpers.rb
bundler-prehistoric-1.6.2.1 lib/bundler/gem_helpers.rb
bundler-prehistoric-1.6.2 lib/bundler/gem_helpers.rb