Class: Sikuli::Config

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

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.highlight_on_findObject

Public: the Boolean representing whether or not to perform a 1 second highlight when an image is matched through Searchable#find, Searchable#find_all. Defaults to false.



10
11
12
# File 'lib/sikuli/config.rb', line 10

def highlight_on_find
  @highlight_on_find
end

Class Method Details

.image_pathObject

Public: the absolute file path where Sikuli will look for images when a just a filename is passed to a search or click method

Returns the String representation of the path



16
17
18
# File 'lib/sikuli/config.rb', line 16

def image_path
  java.lang.System.getProperty("SIKULI_IMAGE_PATH")
end

.image_path=(path) ⇒ Object

Public: the setter for the absolute file path where Sikuli will search for images with given a filename as an image

Examples

Sikuli::Config.image_path = "/Users/clemley/sikuli/images/"

Returns nothing



28
29
30
# File 'lib/sikuli/config.rb', line 28

def image_path=(path)
  java.lang.System.setProperty("SIKULI_IMAGE_PATH", path)
end

.logging=(boolean) ⇒ Object

Public: turns stdout logging on and off for the Sikuli java classes. Defaults to true.

Examples

Sikuli::Config.logging = false

Returns nothing



40
41
42
43
44
45
# File 'lib/sikuli/config.rb', line 40

def logging=(boolean)
  return unless [TrueClass, FalseClass].include? boolean.class
  org.sikuli.script::Settings.InfoLogs = boolean
  org.sikuli.script::Settings.ActionLogs = boolean
  org.sikuli.script::Settings.DebugLogs = boolean
end

.run(*args) ⇒ Object

Public: convienence method for grouping the setting of config variables

Examples

Sikuli::Config.run do |config|
  config.logging = true
  config.image_path = "/User/clemley/images"
  config.highlight_on_find = true
end

Returns nothing



59
60
61
62
63
# File 'lib/sikuli/config.rb', line 59

def run(*args)
  if block_given?
    yield self
  end
end