[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Checking the name of the host Operating System

Sonny Chee

2/13/2007 8:08:00 PM

Hey Guys,

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

Sonny.

--
Posted via http://www.ruby-....

2 Answers

James Gray

2/13/2007 8:25:00 PM

0

On Feb 13, 2007, at 2:07 PM, Sonny Chee wrote:

> 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

Sonny Chee

2/13/2007 8:30:00 PM

0

Thanks James, that's exactly what I need.

Sonny.

James Gray wrote:
> On Feb 13, 2007, at 2:07 PM, Sonny Chee wrote:
>
>> 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


--
Posted via http://www.ruby-....