Sha256: 98e0d900a9da0d8f5763e1895239423a0548cfe3623463fa8dd0621579a744a9
Contents?: true
Size: 667 Bytes
Versions: 7
Compression:
Stored size: 667 Bytes
Contents
module TestNotifier module Notifier module Growl extend self SCRIPT = File.dirname(__FILE__) + "/../../../resources/register-growl.scpt" FILE = File.expand_path("~/.test_notifier-growl") def supported? RUBY_PLATFORM =~ /darwin/ && `ps -Al | grep GrowlHelper` && `which growlnotify` && $? == 0 end def notify(options) Thread.new do `growlnotify -n test_notifier --image #{options[:image]} -p 2 -m '#{options[:message]}' -t '#{options[:title]}'` end end def register return if File.file?(FILE) system "osascript #{SCRIPT} > #{FILE}" end end end end
Version data entries
7 entries across 7 versions & 1 rubygems