Module: Cxxproject::Utils::OS
- Defined in:
- lib/cxxproject/utils/utils.rb
Overview
Simple helper query the operating system we are running in
Class Method Summary collapse
-
.linux? ⇒ Boolean
Is it linux.
-
.mac? ⇒ Boolean
Is it osx.
- .os ⇒ Object
-
.unix? ⇒ Boolean
Is it kind of unix.
-
.windows? ⇒ Boolean
Is it windows.
Class Method Details
.linux? ⇒ Boolean
Is it linux
28 29 30 |
# File 'lib/cxxproject/utils/utils.rb', line 28 def self.linux? OS.unix? and not OS.mac? end |
.mac? ⇒ Boolean
Is it osx
18 19 20 |
# File 'lib/cxxproject/utils/utils.rb', line 18 def self.mac? (RUBY_PLATFORM =~ /darwin/) != nil end |
.os ⇒ Object
6 7 8 9 10 |
# File 'lib/cxxproject/utils/utils.rb', line 6 def self.os return :OSX if mac? return :WINDOWS if windows? return :UNIX end |
.unix? ⇒ Boolean
Is it kind of unix
23 24 25 |
# File 'lib/cxxproject/utils/utils.rb', line 23 def self.unix? !OS.windows? end |
.windows? ⇒ Boolean
Is it windows
13 14 15 |
# File 'lib/cxxproject/utils/utils.rb', line 13 def self.windows? (RUBY_PLATFORM =~ /cygwin|mswin|mingw|bccwin|wince|emx/) != nil end |