Skip to content

Instantly share code, notes, and snippets.

@okitan
Created February 10, 2011 10:05
Show Gist options
  • Save okitan/820229 to your computer and use it in GitHub Desktop.
Save okitan/820229 to your computer and use it in GitHub Desktop.
require 'ruby_gntp'
def your_app
#TODO:
end
def your_host
#TODO:
end
def your_password
#TODO:
end
def growl
unless @growl
@growl = GNTP.new(your_app, your_host, your_password, 23053)
@growl.register :notifications => [ :name => your_app ]
end
@growl
end
def notify(message)
growl.notify :name => your_app, :title => your_app, :text => message
end
local_notify_setting = File.join(File.dirname(__FILE__), 'notify')
if File.exist?(local_notify_setting + '.rb')
require local_notify_setting
else
def notify(message)
# do nothing
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment