Created
January 30, 2014 19:50
-
-
Save drogus/8717376 to your computer and use it in GitHub Desktop.
This file contains 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
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