I use irb for composing and debugging scripts. Following is what you might need to do inorder to run Sikuli in IRB:
- cp /Applications/Sikuli-IDE.app/Contents/Resources/Java/sikuli-script.jar $JRUBY_HOME/lib
- For RVM:
- rvm list (to list currently installed rubies)
- rvm use jruby-1.x.x (to use jruby as the ruby implementation)
- rvm info (to print information about the ruby currently being used)
- cp /Applications/Sikuli-IDE.app/Contents/Resources/Java/sikuli-script.jar $MY_RUBY_HOME/lib ($MY_RUBY_HOME points to the current ruby home, in this case jruby)
- => true
- => Java::OrgSikuliScript::Screen
- => #<Java::OrgSikuliScript::Screen:0x1dc2dad7>
- => "/Users/mubbashir/Desktop"
- [info] Sikuli vision engine loaded.
- => 1
With Auto Completion IRB is just a blessing, specially when you want to try some new library or need to run some snippets:
Similarly in script it would be something like:
to run the script ruby script_file_name.rb Just be sure that you are using JRuby ;)