rdp / os

The OS gem allows for some easy telling if you’re on windows or not. OS.windows? as well as some other helper utilities
MIT License
145 stars 30 forks source link

Wrong OS bits size on mingw64 on Windows 10 x64 #32

Open artemshein opened 6 years ago

artemshein commented 6 years ago

Same OS, different Rubies (64-bit and 32-bit): $ uname -a MINGW64_NT-10.0 name 2.5.0(0.295/5/3) 2016-03-31 18:47 x86_64 Msys $ ruby -e 'require "os";p RUBY_PLATFORM;p OS.bits' "x64-mingw32" 64 $ ruby -e 'require "os";p RUBY_PLATFORM;p OS.bits' "i386-mingw32" 32

artemshein commented 6 years ago

The only solution I found is:

def is_64bit_win?
  ENV.has_key?('ProgramFiles(x86)')
end

Ugly, but works

rdp commented 6 years ago

Yeah that's a tricky one, since it's basically "os differs from runtime" and I never did figure out an awesome solution there. Maybe another method "OS.os_bits" LOL?

On Mon, Feb 19, 2018 at 11:14 AM, Artem Shein notifications@github.com wrote:

The only solution I found is:

def is_64bit_win? ENV.has_key?('ProgramFiles(x86)') end

Ugly, but works

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rdp/os/issues/32#issuecomment-366769148, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAw0PEPjwW4jPZEsEst3LJUbqO8poiKks5tWboRgaJpZM4SIafX .

rdp commented 5 years ago

pr welcome!