Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- ruby -*-
- # require 'autotest/autoupdate'
- # require 'autotest/once'
- # require 'autotest/rcov'
- # require 'autotest/restart'
- # require 'autotest/timestamp'
- # Autotest::AutoUpdate.sleep_time = o
- # Autotest::AutoUpdate.update_cmd = o
- # Autotest::RCov.command = o
- # Autotest::RCov.pattern = o
- module Autotest::Growl
- def self.growl title, msg, img="~/images/rails_ok.png", pri=0, sticky=""
- msg += " at #{Time.now.strftime('%Y-%m-%d %H:%M:%S')}"
- system "growlnotify -n autotest --image #{img} -p #{pri} -m #{msg.inspect} #{title} #{sticky}"
- end
- Autotest.add_hook :ran_command do |at|
- results = [at.results].flatten.join("¥n")
- output = results.slice(/\d+\s+examples,\s*(\d)\s*failure/)
- if output
- if $~[1].to_i > 0
- growl "Tests Failed", "#{output}", "~/images/rails_fail.png", 2
- else
- growl "Tests Passed", "#{output}", "~/images/rails_ok.png", 2
- end
- else
- growl "Tests Errored", "errors", "~/images/rails_fail.png", 2
- end
- end
- end
Add Comment
Please, Sign In to add comment