Module: SeleniumPrep::System::OS

Extended by:
OS
Included in:
OS
Defined in:
lib/selenium-prep/system/os.rb

Instance Method Summary collapse

Instance Method Details

#linux?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/selenium-prep/system/os.rb', line 19

def linux?
  unix? and not mac?
end

#mac?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/selenium-prep/system/os.rb', line 11

def mac?
 (/darwin/ =~ RUBY_PLATFORM) != nil
end

#set_typeObject



23
24
25
26
27
28
# File 'lib/selenium-prep/system/os.rb', line 23

def set_type
  ENV['SE_OS_TYPE'] = 'win'   if System::OS.windows?
  ENV['SE_OS_TYPE'] = 'mac'   if System::OS.mac?
  ENV['SE_OS_TYPE'] = 'linux' if System::OS.linux?
  ENV['SE_OS_TYPE'] = ENV['SE_OS_TYPE'] + (ENV['SE_OS_TYPE_BIT'] ||= '32')
end

#unix?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/selenium-prep/system/os.rb', line 15

def unix?
  !windows?
end

#windows?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/selenium-prep/system/os.rb', line 7

def windows?
  (/cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM) != nil
end