Class: SystemUtil

Inherits:
Object
  • Object
show all
Defined in:
lib/yadecli/util/system_util.rb

Overview

system util

Class Method Summary collapse

Class Method Details

.osObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/yadecli/util/system_util.rb', line 6

def self.os
  host_os = RbConfig::CONFIG['host_os']
  case host_os
  when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
    return :windows
  when /darwin|mac os/
    return :macosx
  when /linux/
    return :linux
  when /solaris|bsd/
    return :unix
  else
    raise Error, "unknown os: #{host_os.inspect}"
  end
end