Module: SystemInformation::OS

Defined in:
lib/systeminformation/os.rb

Class Method Summary collapse

Class Method Details

.linux?Boolean

Returns:



32
33
34
# File 'lib/systeminformation/os.rb', line 32

def self.linux?
  os == :linux
end

.osObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/systeminformation/os.rb', line 9

def self.os
  return @os if @os
  name = RUBY_PLATFORM
  @os = case name
  when /linux/
    :linux
  when /solaris/
    :solaris
  when /bsd/
    :bsd
  when /darwin/ 
    :darwin
  when /win/
    :windows
  else
    :unknown
  end
end

.unix?Boolean

Returns:



28
29
30
# File 'lib/systeminformation/os.rb', line 28

def self.unix?
  [:linux, :bsd, :darwin, :solaris].member?(os)
end