ajmorris (owner)

Revisions

  • 7999c5 ajmorris Thu Apr 09 08:26:45 -0700 2009
  • 8f8f05 ajmorris Thu Apr 09 08:25:39 -0700 2009
  • d39e8f ajmorris Thu Apr 09 08:25:10 -0700 2009
  • 1f8553 ajmorris Thu Apr 09 08:24:30 -0700 2009
  • 81a1c8 ajmorris Thu Apr 09 08:23:22 -0700 2009
gist: 92529 Download_button fork
public
Public Clone URL: git://gist.github.com/92529.git
Embed All Files: show embed
autotest.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# .autotest
require 'autotest/redgreen'
require 'autotest/menu'
# This replaces the stock Autotest::Growl
module Autotest::Growl
  def self.growl title, msg, image=nil, pri=0
    title += " in #{Dir.pwd}"
    msg += " at #{Time.now}"
    system "growlnotify -n autotest --image #{image || "/Applications/Mail.app/Contents/Resources/Caution.tiff"} -m #{msg.inspect} -t #{title}"
  end
 
 
  Autotest.add_hook :initialize do |at|
    growl "autotest running", "Started",'~/Library/autotest/rails_grey.png'
  end
  
  Autotest.add_hook :reset do |at|
     growl "autotest reset", "Reset",'~/Library/autotest/rails_grey.png'
  end
   
  Autotest.add_hook :red do |at|
    growl "Tests Failed", "#{at.files_to_test.size} tests failed", '~/Library/autotest/rails_fail.png'
  end
 
  Autotest.add_hook :green do |at|
    growl "Tests Passed", "#{at.results.scan(at.completed_re)}", '~/Library/autotest/rails_ok.png'
  end
 
  Autotest.add_hook :all_good do |at|
    growl "All Tests Passed", "#{at.results.scan(at.completed_re)}", '~/Library/autotest/rails_ok.png'
  end
 
end