Skip to content

Instantly share code, notes, and snippets.

@joker1007
Created October 18, 2010 15:22
Show Gist options
  • Save joker1007/632384 to your computer and use it in GitHub Desktop.
Save joker1007/632384 to your computer and use it in GitHub Desktop.
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