Module: Digiproc::OS
- Included in:
- Rbplot::LinePlot
- Defined in:
- lib/concerns/os.rb
Overview
Deternine the OS for classes which need to perform system commands
Instance Method Summary collapse
-
#linux? ⇒ Boolean
return true if in a linux env.
-
#mac? ⇒ Boolean
return true if in a mac env.
-
#ruby? ⇒ Boolean
return true if using jruby.
-
#unix? ⇒ Boolean
return true if in a unix env.
-
#windows? ⇒ Boolean
return true if in a windows env.
Instance Method Details
#linux? ⇒ Boolean
return true if in a linux env
26 27 28 |
# File 'lib/concerns/os.rb', line 26 def linux? unix? and not mac? end |
#mac? ⇒ Boolean
return true if in a mac env
14 15 16 |
# File 'lib/concerns/os.rb', line 14 def mac? (/darwin/ =~ RUBY_PLATFORM) != nil end |
#ruby? ⇒ Boolean
return true if using jruby
32 33 34 |
# File 'lib/concerns/os.rb', line 32 def ruby? RUBY_ENGINE == 'jruby' end |
#unix? ⇒ Boolean
return true if in a unix env
20 21 22 |
# File 'lib/concerns/os.rb', line 20 def unix? !windows? end |
#windows? ⇒ Boolean
return true if in a windows env
8 9 10 |
# File 'lib/concerns/os.rb', line 8 def windows? (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil end |