Is it possible to tell that you’re on windows from within jruby?
Thanks!
-r
I’ve used this :
require ‘rubygems’
puts RbConfig::CONFIG[‘host_os’]
then to check it:
if RbConfig::CONFIG[‘host_os’] =~ /mswin32/
On Sat, Oct 10, 2009 at 7:43 PM, Roger P. [email protected]
wrote:
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
then to check it:
if RbConfig::CONFIG[‘host_os’] =~ /mswin32/
Thanks.
-r
At 2:22 AM +0200 10/11/09, Roger P. wrote:
then to check it:
if RbConfig::CONFIG[‘host_os’] =~ /mswin32/
fyi: you don’t need to use rubgems, RbConfig::CONFIG is part of Ruby
itself.
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
On Sat, Oct 10, 2009 at 5:55 PM, Jay McGaffigan [email protected]
wrote:
I’ve used this :
require ‘rubygems’
Just require ‘rbconfig’
puts RbConfig::CONFIG[‘host_os’]
then to check it:
if RbConfig::CONFIG[‘host_os’] =~ /mswin32/
- Charlie
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
On Sun, Oct 11, 2009 at 4:24 AM, Stephen B.
[email protected] wrote:
At 2:22 AM +0200 10/11/09, Roger P. wrote:
then to check it:
if RbConfig::CONFIG[‘host_os’] =~ /mswin32/fyi: you don’t need to use rubgems, RbConfig::CONFIG is part of Ruby itself.
Indeed, and here’s what we do in JRuby tests to detect Windows platform:
require ‘rbconfig’
WINDOWS = Config::CONFIG[‘host_os’] =~ /Windows|mswin/
The ‘Windows’ part of the regexp sees to be a legacy for older JRuby
versions. With newer JRubys (JRubies?) checking for mswin seems to be
enough.
Thanks,
–Vladimir
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
Vladimir S. wrote:
On Sun, Oct 11, 2009 at 4:24 AM, Stephen B.
[email protected] wrote:At 2:22 AM +0200 10/11/09, Roger P. wrote:
then to check it:
if RbConfig::CONFIG[‘host_os’] =~ /mswin32/fyi: you don’t need to use rubgems, RbConfig::CONFIG is part of Ruby itself.
Indeed, and here’s what we do in JRuby tests to detect Windows platform:
require ‘rbconfig’
WINDOWS = Config::CONFIG[‘host_os’] =~ /Windows|mswin/
As a note, it appears that many of the regexes in this thread don’t
handle mingw32 (which is what the next release of windows one click
installer will be using).
Cheers!
-r
On Sun, Oct 11, 2009 at 01:43, Roger P. [email protected] wrote:
I normally have this method in Kernel module (so it’ll be globally
available)
def is_windows?
!! if PLATFORM.match /java/
java.lang.System.getProperty(‘os.name’).match(/win/i)
else
PLATFORM.match(/win/)
end
end
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
On Mon, Oct 12, 2009 at 9:38 AM, Roger P. [email protected]
wrote:
As a note, it appears that many of the regexes in this thread don’t
handle mingw32 (which is what the next release of windows one click
installer will be using).
I would strongly recommend that the one-click installer not introduce
a new platform name. FileUtils, for example, has special-cased logic
for mswin32. There are other examples as well. Is Luis L. in
charge of one-click these days?
- Charlie
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
I would strongly recommend that the one-click installer not introduce
a new platform name. FileUtils, for example, has special-cased logic
for mswin32. There are other examples as well. Is Luis L. in
charge of one-click these days?
He is.
Unfortunately it’s not really luis’ thing–well…it kind of was to
decide to shift compilers, but that’s another story.
RUBY_PLATFORM is set to mingw whether we want it to be or not
-r
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
require ‘rbconfig’
RbConfig::CONFIG[‘host_os’] =~ /mswin|mingw/viewed as not-good-enough-for-now when trying to determine if you’re
running on Windows from multiple Ruby impl’s?It appears to work for me on 1.9.1p243 from http://rubyinstaller.org/,
JRuby 1.3.1, and IronRuby 0.9.1.
I think that will work as long as you have Jruby versions new enough
[older versions wouldn’t work–but who uses older versions anyway?]
-r
RUBY_PLATFORM is set to mingw whether we want it to be or not
-r
To make sure I didn’t miss something here, is this
require ‘rbconfig’
RbConfig::CONFIG[‘host_os’] =~ /mswin|mingw/
viewed as not-good-enough-for-now when trying to determine if you’re
running on Windows from multiple Ruby impl’s?
It appears to work for me on 1.9.1p243 from http://rubyinstaller.org/,
JRuby 1.3.1, and IronRuby 0.9.1.
Jon
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email