class OS

Public Class Methods

linux?() click to toggle source
# File lib/core_extended/os.rb, line 7
def self.linux?
  is? /linux/
end
mac?() click to toggle source
# File lib/core_extended/os.rb, line 11
def self.mac?
  is? /darwin|mac os/
end
name() click to toggle source
# File lib/core_extended/os.rb, line 3
def self.name
  RbConfig::CONFIG['host_os']
end
unix?() click to toggle source
# File lib/core_extended/os.rb, line 19
def self.unix?
  is? /solaris|sunos|bsd/
end
unknown?() click to toggle source
# File lib/core_extended/os.rb, line 23
def self.unknown?
  !linux? && !mac? && !windows? && !unix?
end
windows?() click to toggle source
# File lib/core_extended/os.rb, line 15
def self.windows?
  is? /mswin|msys|mingw|cygwin|bccwin|wince|emc/
end

Private Class Methods

is?(regex) click to toggle source
# File lib/core_extended/os.rb, line 29
def self.is?(regex)
  !regex.match(name).nil?
end