Module: AssLauncher::Platform

Defined in:
lib/ass_launcher/support/platforms.rb

Overview

Code partly copied from sources [FFI::Platform] module Module provides some functional like [FFI::Platform] Gem ffi builds binary extension and decided don’t use it

Constant Summary collapse

OS =

:nocov:

case RbConfig::CONFIG['host_os'].downcase
when /linux/
  'linux'
when /darwin/
  'darwin'
when /freebsd/
  'freebsd'
when /netbsd/
  'netbsd'
when /openbsd/
  'openbsd'
when /sunos|solaris/
  'solaris'
when /mingw|mswin/
  'windows'
else
  RbConfig::CONFIG['host_os'].downcase
end
IS_CYGWIN =
os?('cygwin')
IS_WINDOWS =
os?('windows')
IS_LINUX =
os?('linux')

Class Method Summary collapse

Class Method Details

.cygwin?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/ass_launcher/support/platforms.rb', line 40

def self.cygwin?
  IS_CYGWIN
end

.linux?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'lib/ass_launcher/support/platforms.rb', line 44

def self.linux?
  IS_LINUX
end

.os?(os) ⇒ Boolean

Test if current OS is os.

Parameters:

Returns:

  • (Boolean)


32
33
34
# File 'lib/ass_launcher/support/platforms.rb', line 32

def self.os?(os)
  OS == os
end

.windows?Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/ass_launcher/support/platforms.rb', line 48

def self.windows?
  IS_WINDOWS
end