Checking the name of the host Operating System

S

Sonny Chee

Hey Guys,

Anyone know how I can determine the name of the host operating system
from within Ruby?

Sonny.
 
J

James Edward Gray II

Hey Guys,

Anyone know how I can determine the name of the host operating system
from within Ruby?
Sure:
RUBY_PLATFORM => "i686-darwin8.8.1"
require "rbconfig" => false
Config::CONFIG["target"] => "i686-apple-darwin8.8.1"
Config::CONFIG["arch"] => "i686-darwin8.8.1"
Config::CONFIG["target_os"]
=> "darwin8.8.1"

Hope that helps.

James Edward Gray II
 
S

Sonny Chee

Thanks James, that's exactly what I need.

Sonny.

James said:
Hey Guys,

Anyone know how I can determine the name of the host operating system
from within Ruby?
Sure:
RUBY_PLATFORM => "i686-darwin8.8.1"
require "rbconfig" => false
Config::CONFIG["target"] => "i686-apple-darwin8.8.1"
Config::CONFIG["arch"] => "i686-darwin8.8.1"
Config::CONFIG["target_os"]
=> "darwin8.8.1"

Hope that helps.

James Edward Gray II
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,234
Messages
2,571,178
Members
47,809
Latest member
Adisty

Latest Threads

Top