Created
October 18, 2010 15:22
-
-
Save joker1007/632384 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 "autotest/growl" | |
require "ruby_gntp" | |
module Autotest::Growl | |
@@growl_for_win = ::GNTP.new("Rails Autotest", "192.168.1.5") | |
@@growl_for_win.register({ | |
:notifications => [ | |
{ | |
:name => "passed", | |
:enabled => true, | |
}, | |
{ | |
:name => "failed", | |
:enabled => true, | |
}, | |
{ | |
:name => "error", | |
:enabled => true, | |
}, | |
{ | |
:name => "info", | |
:enabled => true, | |
}, | |
{ | |
:name => "pending", | |
:enabled => true, | |
}, | |
] | |
}) | |
## | |
# Display a message through Growl. | |
def self.growl(title, message, icon, priority=0, stick="") | |
image = File.join(ENV['HOME'], '.autotest-growl', "#{icon}.png") | |
image = File.join(GEM_PATH, 'img', "#{icon}.png") unless File.exists?(image) | |
@@growl_for_win.notify({ | |
:name => icon, | |
:title => title, | |
:text => message, | |
:icon => image | |
}) | |
end | |
end | |
# vim: ft=ruby |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment