Module: Notifier::Growl
Constant Summary collapse
- SCRIPT =
File.dirname(__FILE__) + "/../../resources/register-growl.scpt"
- FILE =
File.("~/.test_notifier-growl")
Instance Method Summary collapse
Instance Method Details
#notify(options) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/notifier/growl.rb', line 12 def notify() register command = [ "growlnotify", "--name", "test_notifier", "--image", .fetch(:image, ''), "--priority", "2", "--message", [:message], [:title] ] Thread.new { system(*command) } end |
#register ⇒ Object
26 27 28 29 |
# File 'lib/notifier/growl.rb', line 26 def register return if File.file?(FILE) system "osascript #{SCRIPT} > #{FILE}" end |
#supported? ⇒ Boolean
8 9 10 |
# File 'lib/notifier/growl.rb', line 8 def supported? Notifier.os?(/darwin/) && `which growlnotify` && $? == 0 end |