P
Paul Mckibbin
Hi all,
I am trying to work out a 'better' way of determing if my ruby code is
running on a Windows platform, and so far I've had to modify the
standard RUBY_PLATFORM several times depending on which version of
windows/compiler etc. it was built with. I also tried using
require 'rbconfig'
Config::CONFIG['host_os']
but found that (with 1.8.6) there are still distinction versions
reported on windows, such as a mingw32 build reporting an os of
'mingw32'.
I came up with Config::CONFIG['EXEEXT'] to determine whether it is
running on Windows as opposed to any other platform we support. Windows
return ".exe" and other platforms tested come back with "", so that
seems to work, but is there a better way?
Best wishes,
Mac
I am trying to work out a 'better' way of determing if my ruby code is
running on a Windows platform, and so far I've had to modify the
standard RUBY_PLATFORM several times depending on which version of
windows/compiler etc. it was built with. I also tried using
require 'rbconfig'
Config::CONFIG['host_os']
but found that (with 1.8.6) there are still distinction versions
reported on windows, such as a mingw32 build reporting an os of
'mingw32'.
I came up with Config::CONFIG['EXEEXT'] to determine whether it is
running on Windows as opposed to any other platform we support. Windows
return ".exe" and other platforms tested come back with "", so that
seems to work, but is there a better way?
Best wishes,
Mac