Skip to content

Instantly share code, notes, and snippets.

@rafmagana
Created May 30, 2012 16:34
Show Gist options
  • Save rafmagana/2837480 to your computer and use it in GitHub Desktop.
Save rafmagana/2837480 to your computer and use it in GitHub Desktop.
Send growl notifications from vagrant to mac
# First, enable "Listen for incoming notifications"
# in Growl preferences and set a password
# You might want to use this in an initializer
growl = Growl::GNTP.new 'ip_of_your_mac', 'App name'
growl.password = 'your_password'
# growl.add_notification 'name'
# growl.notify 'name', 'title', 'message'
ActiveSupport::Notifications.subscribe 'hook_name' do |*args|
event = ActiveSupport::Notification::Event.new args
if event.payload[:some_key] = 'some_value'
growl.notify 'notification', 'title', 'message'
end
end
require 'ruby-growl'
growl = Growl::GNTP.new 'ip_of_your_mac', 'App name'
growl.password = 'your_password'
growl.notify 'notification', 'title', 'message'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment