Class: Sikuli::Platform

Inherits:
Object
  • Object
show all
Defined in:
lib/sikuli/platform.rb

Constant Summary collapse

WINDOWS =
RbConfig::CONFIG['host_os'] =~ /mswin/
LINUX =
RbConfig::CONFIG['host_os'] =~ /linux/
MINGW =
RbConfig::CONFIG['host_os'] =~ /mingw/
OS_X =
RbConfig::CONFIG['host_os'] =~ /darwin/

Class Method Summary collapse

Class Method Details

.sikuli_script_pathObject



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/sikuli/platform.rb', line 12

def self.sikuli_script_path
  if OS_X
    path = "/Applications/Sikuli-IDE.app/Contents/Resources/Java/sikuli-script.jar"
  else
    raise LoadError, no_sikuli_home_err_msg if ENV['SIKULI_HOME'].nil?
    path = "#{ENV['SIKULI_HOME']}/sikuli-script.jar"
  end
  unless File.exist?(path)
    raise LoadError, "Failed to load '#{path}'\nIs Sikuli installed?"
  end
  path
end