Sha256: 91bada29a33f24650d77ed14cbeeadd240b4886e65bd0a9e482fd7200608a487

Contents?: true

Size: 481 Bytes

Versions: 2

Compression:

Stored size: 481 Bytes

Contents

require 'rbconfig'

def x86_64_from_build_cpu
  RbConfig::MAKEFILE_CONFIG['build_cpu'] == 'x86_64'
end

def x86_64_from_byte_length
  ['foo'].pack('p').size == 8 
end

def x86_64_from_arch_flag
  RbConfig::MAKEFILE_CONFIG['ARCH_FLAG'] =~ /x86_64/
end

def rubinius?
  Object.const_defined?(:RUBY_ENGINE) && RUBY_ENGINE == "rbx"
end

def x64?
  if rubinius?
    x86_64_from_build_cpu || x86_64_from_arch_flag
  else
    x86_64_from_byte_length
  end
end

puts x64? ? "x64" : "ia32"

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
tomato-0.0.1.prealpha2 ext/tomato/external/arch.rb
tomato-0.0.1.prealpha1 ext/tomato/external/arch.rb