Created
February 1, 2012 17:43
-
-
Save Jaym3s/1718275 to your computer and use it in GitHub Desktop.
UIAutomation and Pusher
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rvm use [email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ruby_script=$(cat <<EOP | |
require "pusher" | |
Pusher['test_channel'].trigger('hello_event', {hello: 'world'}) | |
EOP) | |
ruby -e "$ruby_script" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require "pusher" | |
channel = ARGV[0] | |
event = ARGV[1] | |
data = ARGV[2] | |
Pusher[channel].trigger(event, data) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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