module OS
Public Class Methods
jruby?()
click to toggle source
# File lib/os.rb, line 18 def OS.jruby? RUBY_ENGINE == 'jruby' end
linux?()
click to toggle source
# File lib/os.rb, line 14 def OS.linux? OS.unix? and not OS.mac? end
mac?()
click to toggle source
# File lib/os.rb, line 6 def OS.mac? (/darwin/ =~ RUBY_PLATFORM) != nil end
unix?()
click to toggle source
# File lib/os.rb, line 10 def OS.unix? !OS.windows? end
windows?()
click to toggle source
# File lib/os.rb, line 2 def OS.windows? (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil end
wsl?()
click to toggle source
# File lib/os.rb, line 22 def OS.wsl? version = File.read(WSL_VERSION_PATH) OS.linux? and (/microsoft|wsl/ =~ version.downcase) != nil end