Detect on which OS jruby is running

Hi all,

I’d like to know if there is a safe and standard way to detect on which
OS jruby is running. The RUBY_PLATFORM constant doesn’t seem to be very
useful in this case.

Thanks in advance.
Andrea


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Hi Anrdea,

Sure, use rbconfig:

jruby -e “require ‘rbconfig’; p Config::CONFIG[‘target_os’]”

It will print out the OS name, e.g.:
“mswin”

Thanks,
–Vladimir

On Tue, Mar 31, 2009 at 9:52 PM, Andrea F. [email protected]
wrote:


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Or you could:

jruby -e “include Java; puts java.lang.System.getProperty(‘os.name’)”

On Tue, Mar 31, 2009 at 12:57 PM, Vladimir S. [email protected]
wrote:

–Vladimir


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Il giorno mar, 31/03/2009 alle 16.33 -0500, Charles Oliver N. ha
scritto:

Adam S. wrote:

Or you could:

jruby -e “include Java; puts
java.lang.System.getProperty(‘os.name’)”

The difference being that for the rbconfig version we try to
normalize
the names to what CRuby reports…

Thanks for the suggestions. There was a bug in the OS detection that
prevented to run ffi-opengl with jruby. Now it should be fixed as commit
645184 on github[1].

Andrea

[1] - GitHub - remogatto/ffi-opengl: A ruby-ffi binding to OpenGL libraries


To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email

Adam S. wrote:

Or you could:

jruby -e “include Java; puts java.lang.System.getProperty(‘os.name’)”

The difference being that for the rbconfig version we try to normalize
the names to what CRuby reports…

  • Charlie

To unsubscribe from this list, please visit:

http://xircles.codehaus.org/manage_email