module FFI::Platform

This module defines different constants and class methods to play with various platforms.

Constants

ARCH
CONF_DIR
IS_BSD
IS_FREEBSD
IS_GNU
IS_LINUX
IS_MAC
IS_NETBSD
IS_OPENBSD
IS_SOLARIS
IS_WINDOWS
LIBC
LIBPREFIX
LIBSUFFIX
NAME
OS

Public Class Methods

bsd?() click to toggle source

Test if current OS is a *BSD (include MAC) @return [Boolean]

# File lib/ffi/platform.rb, line 130
def self.bsd?
  IS_BSD
end
mac?() click to toggle source

Test if current OS is Mac OS @return [Boolean]

# File lib/ffi/platform.rb, line 142
def self.mac?
  IS_MAC
end
solaris?() click to toggle source

Test if current OS is Solaris (Sun OS) @return [Boolean]

# File lib/ffi/platform.rb, line 148
def self.solaris?
  IS_SOLARIS
end
unix?() click to toggle source

Test if current OS is a unix OS @return [Boolean]

# File lib/ffi/platform.rb, line 154
def self.unix?
  !IS_WINDOWS
end
windows?() click to toggle source

Test if current OS is Windows @return [Boolean]

# File lib/ffi/platform.rb, line 136
def self.windows?
  IS_WINDOWS
end

Private Class Methods

is_os(os) click to toggle source

@param [String) os @return [Boolean] Test if current OS is os.

# File lib/ffi/platform.rb, line 79
def self.is_os(os)
  OS == os
end