Skip to content

Instantly share code, notes, and snippets.

@youpy
Created September 14, 2012 05:27
Show Gist options
  • Save youpy/3719969 to your computer and use it in GitHub Desktop.
Save youpy/3719969 to your computer and use it in GitHub Desktop.
require 'eventmachine-distributed-notification'
require 'ruby_gntp'
require 'json'
# EM.post_distributed_notification('growl_notify', msg)
EM.run {
EM.watch_distributed_notification('growl_notify') {|c|
(class << c; self; end).send(:define_method, :notify) {|name, info|
msg = info['data']
GNTP.notify(
:app_name => "notify",
:title => "Instant notification",
:text => msg
)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment