public
Description: Ryan McGeary's configuration shiznit that makes him productive
Homepage: http://ryan.mcgeary.org
Clone URL: git://github.com/rmm5t/dotfiles.git
Search Repo:
Updated custom autotest growl hooks
rmm5t (author)
Thu May 15 21:33:44 -0700 2008
commit  f4675594b899177747e3957a6b45663639d5f519
tree    f79c502371cbf56ec856f110ee9a12edbf7062cb
parent  d79fa6edd7288f055cd043a5ef06730721494266
...
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
...
37
38
39
40
41
42
43
44
...
5
6
7
8
9
10
11
12
13
...
14
15
16
 
 
 
 
 
 
 
 
 
 
17
18
19
20
21
22
23
24
25
26
27
...
35
36
37
 
 
 
 
 
0
@@ -5,6 +5,8 @@
0
 
0
 module Autotest::Growl
0
   def self.growl(title, message, pass = nil)
0
+ title += " in #{Dir.pwd.split(/\//)[-3..-1].join("/")}"
0
+ message += " at #{Time.now.strftime('%Y-%m-%d %H:%M:%S')}"
0
     priority = pass ? -2 : 2
0
     image = pass ? '~/.autotest.d/pass.png' : '~/.autotest.d/fail.png'
0
     sticky = false # !pass
0
0
@@ -12,18 +14,14 @@
0
     system "growlnotify -n autotest --image #{image} -p #{priority} -m #{message.inspect} #{title.inspect} #{switches}"
0
   end
0
 
0
- Autotest.add_hook :ran_command do |at|
0
- results = at.results.last.chomp
0
- if results.match(/^.* (\d+) failures, (\d+) errors$/)
0
- error_count = $1.to_i + $2.to_i
0
- if (error_count.zero?)
0
- growl "Tests Passed", "#{results}", :pass # if at.tainted
0
- else
0
- growl "Tests Failed", "#{results}"
0
- end
0
- end
0
+ Autotest.add_hook :red do |at|
0
+ growl "Tests Failed", "#{at.files_to_test.size} tests failed"
0
   end
0
   
0
+ Autotest.add_hook :green do |at|
0
+ growl "Tests Passed", "Tests passed", :pass
0
+ end
0
+
0
   Autotest.add_hook :all_good do |at|
0
     growl "Tests Passed", "All tests passed", :pass if at.tainted
0
   end
0
@@ -37,9 +35,4 @@
0
   alias_method :find_files_without_flymake, :find_files
0
   alias_method :find_files, :find_files_with_flymake
0
 end
0
-
0
-# Autotest.send(:alias_method, :real_make_test_cmd, :make_test_cmd)
0
-# Autotest.send(:define_method, :make_test_cmd) do |*args|
0
-# real_make_test_cmd(*args).sub('test/unit', %[rubygems -e "require 'redgreen'"])
0
-# end

Comments

    No one has commented yet.