Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
48 lines (41 sloc) 1.25 KB
# #
# nofxx - 2008
#
# http://wiki.nofxx.com/rspec
#
# FAIL IMAGE => http://wiki.nofxx.com/_media/fail.png
# PASS IMAGE => http://wiki.nofxx.com/_media/pass.png
#
# Display styles growl
# Fail => "Media Audio"
# Pass => "Smoke"
#
#require 'autotest/growl'
#require 'autotest/html_report'
# require 'autotest/kdenotify'
require 'autotest/menu'
#require 'autotest/pretty'
require 'autotest/redgreen'
# require 'autotest/snarl'
require 'autotest/timestamp'
module Autotest::Growl
def self.growl pass, title, msg, img, pri=0, sticky=""
if RUBY_PLATFORM =~ /darwin/
system "growlnotify -n #{pass} --image #{img} -p #{pri} -m #{msg.inspect} #{title} #{sticky}"
else #Errno::ENOENT => e
nil #p e
end
end
Autotest.add_hook :initialize do |at|
growl "autotest", "Rodando..", "Started autotest", ''
%w{.svn .hg .git .DS_store}.each {|exception|at.add_exception(exception)}
end
Autotest.add_hook :ran_command do |at|
output = at.results.last.gsub!(/(\e\[3\dm)|(\e\[0m)|(\n)/, '') unless at.results.last.nil?
if output =~ /[1-9]\sfailures?/
growl "epic", "BURRO!", "#{output}", ".autotest_images/fail.png", 2, "-s"
else
growl "autotest", "GO GO GO", "#{output}", ".autotest_images/pass.png",2
end
end
end