module Digiproc::OS

Deternine the OS for classes which need to perform system commands

Public Instance Methods

linux?() click to toggle source

return true if in a linux env

# File lib/concerns/os.rb, line 26
def linux?
    unix? and not mac?
end
mac?() click to toggle source

return true if in a mac env

# File lib/concerns/os.rb, line 14
def mac?
    (/darwin/ =~ RUBY_PLATFORM) != nil
end
ruby?() click to toggle source

return true if using jruby

# File lib/concerns/os.rb, line 32
def ruby?
    RUBY_ENGINE == 'jruby'
end
unix?() click to toggle source

return true if in a unix env

# File lib/concerns/os.rb, line 20
def unix?
    !windows?
end
windows?() click to toggle source

return true if in a windows env

# File lib/concerns/os.rb, line 8
def windows?
    (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
end