2011-06-09 23:24:08 -04:00
|
|
|
module MailCatcher
|
2012-07-25 00:00:31 -04:00
|
|
|
module Growl extend self
|
2011-06-09 23:24:08 -04:00
|
|
|
def start
|
|
|
|
MailCatcher::Events::MessageAdded.subscribe MailCatcher::Growl.method :notify
|
|
|
|
end
|
|
|
|
|
|
|
|
def notify message
|
2011-08-25 16:39:49 -04:00
|
|
|
image_path = File.expand_path(File.join(__FILE__, '..', '..', '..', 'public', 'images', 'logo_large.png'))
|
|
|
|
system "growlnotify", "--image", image_path, "--name", "MailCatcher", "--message", "Message received:\n#{message["subject"]}"
|
2011-06-09 23:24:08 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
# TODO: Native support on MacRuby with click backs
|
|
|
|
#def click
|
|
|
|
#end
|
|
|
|
end
|
|
|
|
end
|