class ET::OperatingSystem
Attributes
raw_name[R]
version[R]
Public Class Methods
new(os = nil, version = nil)
click to toggle source
# File lib/et/operating_system.rb, line 7 def initialize(os = nil, version = nil) @raw_name, @version = os, version if @raw_name.nil? derive_raw_name end end
Public Instance Methods
name()
click to toggle source
cribbed from Selenium
# File lib/et/operating_system.rb, line 15 def name case @raw_name when /mswin|msys|mingw|cygwin|bccwin|wince|emc/ :windows when /darwin|mac os/ :mac when /linux/ :linux when /solaris|bsd/ :unix end end
platform_family?(platform)
click to toggle source
# File lib/et/operating_system.rb, line 28 def platform_family?(platform) name == platform.to_sym end
Protected Instance Methods
derive_raw_name()
click to toggle source
# File lib/et/operating_system.rb, line 33 def derive_raw_name @raw_name = RbConfig::CONFIG['host_os'] end