Module: ProcessObserver::OS
- Defined in:
- lib/process_observer/os.rb
Overview
Module with methods to identify current platform.
Class Method Summary collapse
-
.linux? ⇒ Boolean
Whether Linux (Unix but not Mac) is used.
-
.mac? ⇒ Boolean
Whether Mac is used.
-
.unix? ⇒ Boolean
Whether Unix (not Windows) is used.
-
.windows? ⇒ Boolean
Whether Windows is used.
Class Method Details
.linux? ⇒ Boolean
Whether Linux (Unix but not Mac) is used.
29 30 31 |
# File 'lib/process_observer/os.rb', line 29 def OS.linux? OS.unix? and not OS.mac? end |
.mac? ⇒ Boolean
Whether Mac is used.
17 18 19 |
# File 'lib/process_observer/os.rb', line 17 def OS.mac? (/darwin/ =~ RUBY_PLATFORM) != nil end |
.unix? ⇒ Boolean
Whether Unix (not Windows) is used.
23 24 25 |
# File 'lib/process_observer/os.rb', line 23 def OS.unix? !OS.windows? end |
.windows? ⇒ Boolean
Whether Windows is used.
11 12 13 |
# File 'lib/process_observer/os.rb', line 11 def OS.windows? (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil end |