michokest / Teambox-Community

DEPRECATED, look for Teambox-2 instead: http://github.com/michokest/Teambox-

This URL has Read+Write access

Pablo Villalba (author)
Wed Nov 04 10:35:34 -0800 2009
commit  2be53259ee2773955f19a0450ae5c242d3c53baf
tree    e265b075966b507c33b934f7d482145bdc36aefc
parent  818171c059b9cd515c2c594ae7a2049a35136573
Teambox-Community / .autotest
100644 22 lines (18 sloc) 0.736 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
require 'redgreen/autotest'
 
module Autotest::Growl
  def self.growl title, msg, img, pri=0, stick=""
    system "growlnotify -n autotest --image #{img} -p #{pri} -m #{msg.inspect} #{title} #{stick}"
  end
 
  Autotest.add_hook :ran_command do |at|
    output = at.results.last.slice(/(\d+).*errors/)
    if output =~ /ns.*[1-9]/
      growl "Test Results", "#{output}", '~/Library/autotest/rails_fail.png', 2 #, "-s"
    else
      growl "Test Results", "#{output}", '~/Library/autotest/rails_ok.png'
    end
  end
end
 
#Autotest.send(:alias_method, :real_make_test_cmd, :make_test_cmd)
#Autotest.send(:define_method, :make_test_cmd) do |*args|
# real_make_test_cmd(*args).sub('test/unit', %[rubygems -e "require 'redgreen'"])
#end