module Legion::Settings::OS
Public Class Methods
jruby?()
click to toggle source
# File lib/legion/settings/os.rb, line 20 def self.jruby? RUBY_ENGINE == 'jruby' end
linux?()
click to toggle source
# File lib/legion/settings/os.rb, line 16 def self.linux? OS.unix? and !OS.mac? end
mac?()
click to toggle source
# File lib/legion/settings/os.rb, line 8 def self.mac? (/darwin/ =~ RUBY_PLATFORM) != nil end
unix?()
click to toggle source
# File lib/legion/settings/os.rb, line 12 def self.unix? !OS.windows? end
windows?()
click to toggle source
# File lib/legion/settings/os.rb, line 4 def self.windows? (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil end
Public Instance Methods
os()
click to toggle source
# File lib/legion/settings/os.rb, line 24 def os return 'jruby' if jruby? return 'windows' if windows? return 'mac' if mac? return 'unix' if unix? 'linux' end