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


11
12
13
# File 'lib/overcommit/os.rb', line 11

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

.linux?Boolean


23
24
25
# File 'lib/overcommit/os.rb', line 23

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

.mac?Boolean


15
16
17
# File 'lib/overcommit/os.rb', line 15

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

.unix?Boolean


19
20
21
# File 'lib/overcommit/os.rb', line 19

def unix?
  !windows?
end

.windows?Boolean


7
8
9
# File 'lib/overcommit/os.rb', line 7

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