module OS

Public Class Methods

linux?() click to toggle source
# File lib/os.rb, line 20
def linux?
  self.os_family == "unix" ? true : false
end
os_family() click to toggle source
# File lib/os.rb, line 3
def os_family  
  case RUBY_PLATFORM  
  when /ix/i, /ux/i, /gnu/i,  
       /sysv/i, /solaris/i,  
       /sunos/i, /bsd/i  
    "unix"  
  when /win/i, /ming/i  
    "windows"  
  else  
    "other"  
  end  
end
windows?() click to toggle source
# File lib/os.rb, line 16
def windows?
  self.os_family == "windows" ? true : false
end