Class: OS

Inherits:
Object
  • Object
show all
Defined in:
lib/core_extended/os.rb

Class Method Summary collapse

Class Method Details

.linux?Boolean

Returns:

  • (Boolean)


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

def self.linux?
  is? /linux/
end

.mac?Boolean

Returns:

  • (Boolean)


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

def self.mac?
  is? /darwin|mac os/
end

.nameObject



3
4
5
# File 'lib/core_extended/os.rb', line 3

def self.name
  RbConfig::CONFIG['host_os']
end

.unix?Boolean

Returns:

  • (Boolean)


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

def self.unix?
  is? /solaris|sunos|bsd/
end

.unknown?Boolean

Returns:

  • (Boolean)


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

def self.unknown?
  !linux? && !mac? && !windows? && !unix?
end

.windows?Boolean

Returns:

  • (Boolean)


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

def self.windows?
  is? /mswin|msys|mingw|cygwin|bccwin|wince|emc/
end