Module: ChuckTesta::Portable

Defined in:
lib/chuck_testar.rb

Class Method Summary collapse

Class Method Details

.linux?Boolean

Returns:

  • (Boolean)


41
42
43
# File 'lib/chuck_testar.rb', line 41

def self.linux?
  ChuckTesta::Portable::platform == 'linux'
end

.osx?Boolean

Returns:

  • (Boolean)


45
46
47
# File 'lib/chuck_testar.rb', line 45

def self.osx?
  ChuckTesta::Portable::platform == 'osx'
end

.platformObject



31
32
33
34
35
36
37
38
39
# File 'lib/chuck_testar.rb', line 31

def self.platform
  if RbConfig::CONFIG['host_os'] =~ /mswin|windows|cygwin/i
    'windows'
  elsif RbConfig::CONFIG['host_os'] =~ /darwin/
    'osx'
  else
    'linux'
  end
end