Skip to content

Instantly share code, notes, and snippets.

@owenthereal
Forked from drogus/pusher-travis-client.rb
Created February 19, 2014 17:54
Show Gist options
  • Save owenthereal/9097503 to your computer and use it in GitHub Desktop.
Save owenthereal/9097503 to your computer and use it in GitHub Desktop.
require 'pusher-client'
socket = PusherClient::Socket.new('5df8ac576dcccf4fd076')
socket.subscribe('common')
handler = lambda do |event, data|
p [event, data]
end
events = ['job:created', 'job:started', 'job:finished', 'job:canceled',
'build:created', 'build:started', 'build:finished', 'build:canceled',
'job:log']
events.each do |event|
socket.bind(event) do |data|
handler.call(event, data)
end
end
socket.connect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment