Module: Overcommit::OS

Defined in:
lib/overcommit/os.rb

Overview

Methods relating to the current operating system

Constant Summary collapse

SEPARATOR =
(windows? ? '\\' : File::SEPARATOR).freeze

Class Method Summary collapse

Class Method Details

.cygwin?Boolean


13
14
15
# File 'lib/overcommit/os.rb', line 13

def cygwin?
  !(/cygwin/ =~ host_os).nil?
end

.linux?Boolean


25
26
27
# File 'lib/overcommit/os.rb', line 25

def linux?
  unix? && !mac? && !cygwin?
end

.mac?Boolean


17
18
19
# File 'lib/overcommit/os.rb', line 17

def mac?
  !(/darwin|mac os/ =~ host_os).nil?
end

.unix?Boolean


21
22
23
# File 'lib/overcommit/os.rb', line 21

def unix?
  !windows?
end

.windows?Boolean


9
10
11
# File 'lib/overcommit/os.rb', line 9

def windows?
  !(/mswin|msys|mingw|bccwin|wince|emc/ =~ host_os).nil?
end