Skip to content

Instantly share code, notes, and snippets.

@jodosha
Created April 4, 2009 00:20
Show Gist options
  • Save jodosha/90060 to your computer and use it in GitHub Desktop.
Save jodosha/90060 to your computer and use it in GitHub Desktop.
module Autotest::Growl
Autotest.add_hook :ran_command do |at|
output = at.results.last.slice(/(\d+).*(failure|error)/).gsub(/31m/, "")
if output !~ /\s0\s/
status, priority = "fail", "High"
else
status, priority = "pass", "Normal"
end
image_dir = "~/Library/autotest"
growl_notify status, "Test Results", output, "#{image_dir}/rails_#{status}.p
ng", priority #, “-s”
end
def self.growl_notify status, title, msg, img, pri=0, stick=""
system "growlnotify -n autotest_#{status} --image #{img} -p #{pri} -m #{msg.
inspect} #{title} #{stick}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment