Tool::Growl.notify("提示", "完成任务!")
Created
May 12, 2011 09:20
-
-
Save qichunren/968232 to your computer and use it in GitHub Desktop.
growlnotify
This file contains hidden or 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
module Tool | |
module Growl | |
def self.growlnotify | |
`which growlnotify`.chomp | |
end | |
def self.exists? | |
!growlnotify.empty? | |
end | |
def self.notify(title, message) | |
Kernel.system("#{growlnotify} -t \"#{title}\" -m \"#{message}\"") if exists? | |
end | |
end # end module Growl | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment