Created
April 4, 2009 00:20
-
-
Save jodosha/90060 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
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