[sikuli] 213/385: set to version Feb 14 from fork
Gilles Filippini
pini at moszumanska.debian.org
Sun Jun 29 19:26:14 UTC 2014
This is an automated email from the git hooks/post-receive script.
pini pushed a commit to tag upstream/1.1.0_beta1
in repository sikuli.
commit d7be2092f2540a5aad3331f4acebe99742d8fa39
Author: Raimund Hocke <info at its-me-raiman.de>
Date: Fri Feb 14 09:51:19 2014 +0100
set to version Feb 14 from fork
---
JRuby/src/main/resources/sikulix.rb | 77 +++++++++++++++++++++++++++++++++++++
1 file changed, 77 insertions(+)
diff --git a/JRuby/src/main/resources/sikulix.rb b/JRuby/src/main/resources/sikulix.rb
index 62820af..37fc033 100755
--- a/JRuby/src/main/resources/sikulix.rb
+++ b/JRuby/src/main/resources/sikulix.rb
@@ -1,3 +1,79 @@
+# SikuliX
+
+require 'java'
+
+module SikuliX4Ruby
+
+ java_import org.sikuli.basics.SikuliX
+ java_import org.sikuli.script.Screen
+ java_import org.sikuli.script.Region
+ java_import org.sikuli.script.compare.DistanceComparator
+ java_import org.sikuli.script.Observer
+
+ $SIKULI_SCREEN = Screen.new
+
+
+ UNDOTTED_METHODS =
+ [SikuliX, $SIKULI_SCREEN].inject({}) do |h, obj|
+ p obj
+ h.merge!(obj.methods.inject({}){|h, name| h.merge!(name => obj.method(name))})
+ end
+
+ def method_missing name, *args
+ ret = nil
+ puts "method not exists: #{name} - trying SikuliX"
+ begin
+ puts "using: #{args}"
+ if method = UNDOTTED_METHODS[name] then
+ puts "SikuliX has: #{name}"
+ ret = method.call *args
+ Object.send(:define_method, name){ |*args| method.call *args }
+ return ret
+ else
+ raise "Problem (#{e}) with SikuliX.#{m} (#{args})"
+ end
+ rescue Exception => e
+ raise "Problem (#{e}) with SikuliX.#{m} (#{args})"
+ end
+ end
+
+
+ class Region
+ def on_vanish target, &block
+ onVanish target, block
+ end
+ end
+
+ # Public: the setter for the absolute file path where Sikuli will search
+ # for images with given a filename as an image
+ #
+ # Examples
+ #
+ # Rukuli::Config.image_path = "/Users/andreanastacio/rukuli/images/"
+ #
+ # Returns nothing
+ def image_path=(path)
+ java.lang.System.setProperty("SIKULI_IMAGE_PATH", path)
+ end
+
+ # Public: turns stdout logging on and off for the Sikuli java classes.
+ # Defaults to true.
+ #
+ # Examples
+ #
+ # Rukuli::Config.logging = false
+ #
+ # Returns nothing
+ def logging=(boolean)
+ return unless [TrueClass, FalseClass].include? boolean.class
+ org.sikuli.basics::Settings.InfoLogs = boolean
+ org.sikuli.basics::Settings.ActionLogs = boolean
+ org.sikuli.basics::Settings.DebugLogs = boolean
+ end
+end
+
+=begin Rukuli variant
+
require_relative 'rukuli'
include Rukuli
@@ -14,3 +90,4 @@ searchable = [:find, :find!, :find_all, :wait]
method = $screen.method (name)
Object.send(:define_method, name){ |*args| method.call *args }
end
+=end
\ No newline at end of file
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/sikuli.git
More information about the pkg-java-commits
mailing list