diff options
author | Daniel Berger <dberger@redhat.com> | 2015-06-04 10:31:06 -0600 |
---|---|---|
committer | Daniel Berger <dberger@redhat.com> | 2015-06-04 10:31:06 -0600 |
commit | d81e709cb27b6f947db48b0cdaa8759261647801 (patch) | |
tree | eb004b9df9a0d20522aa47899b753c2a92524710 | |
parent | 83c53aa8d51a24f6f7e2f866eeb1649484f57a22 (diff) | |
download | ffi-d81e709cb27b6f947db48b0cdaa8759261647801.tar.gz |
Added Platform.solaris? singleton method.
-rw-r--r-- | lib/ffi/platform.rb | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/ffi/platform.rb b/lib/ffi/platform.rb index ab647ef..7393459 100644 --- a/lib/ffi/platform.rb +++ b/lib/ffi/platform.rb @@ -79,7 +79,7 @@ module FFI def self.is_os(os) OS == os end - + NAME = "#{ARCH}-#{OS}" IS_GNU = defined?(GNU_LIBC) IS_LINUX = is_os("linux") @@ -87,12 +87,12 @@ module FFI IS_FREEBSD = is_os("freebsd") IS_NETBSD = is_os("netbsd") IS_OPENBSD = is_os("openbsd") + IS_SOLARIS = is_os("solaris") IS_WINDOWS = is_os("windows") IS_BSD = IS_MAC || IS_FREEBSD || IS_NETBSD || IS_OPENBSD CONF_DIR = File.join(File.dirname(__FILE__), 'platform', NAME) - public - + public LIBPREFIX = case OS when /windows/ @@ -143,6 +143,12 @@ module FFI IS_MAC end + # Test if current OS is Solaris (Sun OS) + # @return [Boolean] + def self.solaris? + IS_SOLARIS + end + # Test if current OS is a unix OS # @return [Boolean] def self.unix? |