Skip to content

Instantly share code, notes, and snippets.

@Jaym3s
Created February 1, 2012 17:43
Show Gist options
  • Save Jaym3s/1718275 to your computer and use it in GitHub Desktop.
Save Jaym3s/1718275 to your computer and use it in GitHub Desktop.
UIAutomation and Pusher
#!/usr/bin/env bash
if [[ -s "$HOME/.rvm/scripts/rvm" ]] ; then
source "$HOME/.rvm/scripts/rvm"
elif [[ -s "/usr/local/rvm/scripts/rvm" ]] ; then
source "/usr/local/rvm/scripts/rvm"
else
printf "ERROR: An RVM installation was not found.\n"
fi
ruby_script=$(cat <<EOP
require "pusher"
Pusher['test_channel'].trigger('hello_event', {hello: 'world'})
EOP)
ruby -e "$ruby_script"
#!/usr/bin/env ruby
require "pusher"
channel = ARGV[0]
event = ARGV[1]
data = ARGV[2]
Pusher[channel].trigger(event, data)
var host = UIATarget.localTarget().host();
var timeout = 5; // seconds
var args = ['test_channel', 'test-event', '{"hello":"world"}'];
var scriptPath = "/Users/home/me/pusher_script";
var result = host.performTaskWithPathArgumentsTimeout(scriptPath,args,timeout);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment