Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.