Skip to content

Instantly share code, notes, and snippets.

@drogus
Created January 30, 2014 19:50
Show Gist options
  • Save drogus/8717376 to your computer and use it in GitHub Desktop.
Save drogus/8717376 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