After learning of growl from Micah's post, I decided to port it to the windows equivalent: snarl. It was pretty easy:
- Follow Micah's instructions except for the growl bits
- Install Snarl from their website, this is a setup .exe
- gem install ruby-snarl
- get the icon images from Micah's post and put them some where. I put them in c:/devtools/autotest redgreen icons/
- Put the code below in your .autotest, in place of the stuff for growl:
require 'autotest/redgreen'
require 'snarl'
module Autotest::Growl
def self.notify title, msg, img
Snarl.show_message title, msg, img
end
Autotest.add_hook :ran_command do |autotest|
icon_path = 'c:/devtools/autotest redgreen icons/'
output = autotest.results.grep(/\d+\s.*examples?/).last.slice(/(\d+)\s.*examples?,\s(\d+)\s.*failures?(?:,\s(\d+)\s.*pending)?/)
if output =~ /[1-9]\sfailures?/
notify "Test Results", "#{output}", "#{icon_path}rails_fail.png"
elsif output =~ /pending/
notify "Test Results", "#{output}", "#{icon_path}rails_pending.png"
else
notify "Test Results", "#{output}", "#{icon_path}rails_ok.png"
end
end
end
Screenshot: