Created
February 10, 2011 10:05
-
-
Save okitan/820229 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 '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 |
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
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