Skip to content

Instantly share code, notes, and snippets.

Created Mar 13, 2013
What would you like to do?
System properties detection in ruby
# origin is here:
require 'rbconfig'
module SpecModule
def self.os
@os ||= (
host_os = RbConfig::CONFIG['host_os']
case host_os
when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
when /darwin|mac os/
when /linux/
when /solaris|bsd/
raise Error::WebDriverError, "unknown os: #{host_os.inspect}"
end ) ; end ; end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment