Created
February 1, 2012 17:10
-
-
Save Jaym3s/1718079 to your computer and use it in GitHub Desktop.
pusher_event_script with RVM
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 | |
rvm use [email protected] | |
ruby_program=$(cat <<EOP | |
require 'pusher' | |
Pusher.app_id = '<your_app_id>' | |
Pusher.key = '<your_app_key>' | |
Pusher.secret = '<your_pusher_secret>' | |
channel = %Q($1) | |
event = %Q($2) | |
data = %Q($3) | |
if channel && event && data | |
Pusher[channel].trigger(event, data) | |
else | |
puts 'usage: pusher_event <channel> <event> <data>' | |
end | |
EOP | |
) | |
ruby -e "$ruby_program" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment