module Overcommit::OS

Methods relating to the current operating system

Constants

SEPARATOR

Public Class Methods

cygwin?() click to toggle source
# File lib/overcommit/os.rb, line 13
def cygwin?
  !(/cygwin/ =~ host_os).nil?
end
linux?() click to toggle source
# File lib/overcommit/os.rb, line 25
def linux?
  unix? && !mac? && !cygwin?
end
mac?() click to toggle source
# File lib/overcommit/os.rb, line 17
def mac?
  !(/darwin|mac os/ =~ host_os).nil?
end
unix?() click to toggle source
# File lib/overcommit/os.rb, line 21
def unix?
  !windows?
end
windows?() click to toggle source
# File lib/overcommit/os.rb, line 9
def windows?
  !(/mswin|msys|mingw|bccwin|wince|emc/ =~ host_os).nil?
end

Private Class Methods

host_os() click to toggle source
# File lib/overcommit/os.rb, line 31
def host_os
  @host_os ||= ::RbConfig::CONFIG['host_os'].freeze
end