public
Rubygem
Description: This gem set the autotest (ZenTest) to send messages to software as Growl, LibNotify, and Snarl, displaying a window with the results.
Homepage: http://www.nomedojogo.com/
Clone URL: git://github.com/carlosbrando/autotest-notification.git
Buuf icons (--buuf) and Sticky notification (--sticky)
samflores (author)
Wed Oct 08 15:26:53 -0700 2008
commit  9997858b924182f8ed7a6acccf6eb35fa1e9e29b
tree    ef8a1b74bdfc4c72c3ce438aad5718b0a2708d81
parent  7d20bb8fe0c3efb646703d6a5eedb0885f7ad756
...
 
 
 
 
 
1
2
3
...
1
2
3
4
5
6
7
8
0
@@ -1,3 +1,8 @@
0
+1.6.0 - Oct 08, 2008
0
+ * Buuf Edition - display Buuf icons by Mattahan [http://mattahan.deviantart.com] (samflores)
0
+ * Added --sticky flag to an-install to keep notifications on screen in case of errors/failures or pending specs (samflores)
0
+ * Pending notifications now have a priority different from Passed and Failled notifications, to allow set diff color with Growl (samflores)
0
+
0
 1.5.0 - Oct 02, 2008
0
   * If an-install is run with --pending, shows a yellow warning when there are no errors/failures but there are pending specs. (lucasuyezu)
0
 
...
89
90
91
 
 
 
 
92
93
94
...
89
90
91
92
93
94
95
96
97
98
0
@@ -89,6 +89,10 @@ To turn off the notifier:
0
 
0
   $ an-install --doom --speaking
0
 
0
+== Buuf Edition - Display Buuf icons by Mattahan [http://mattahan.deviantart.com]
0
+
0
+ $ an-install --buuf
0
+
0
 == Showing a yellow warning image when there are no errors/failures but there are pending specs
0
 
0
   $ an-install --pending
...
18
19
20
21
 
 
 
22
23
24
...
43
44
45
 
 
 
 
46
47
48
49
 
 
 
 
 
 
50
51
52
...
72
73
74
 
75
 
76
77
78
...
18
19
20
 
21
22
23
24
25
26
...
45
46
47
48
49
50
51
52
53
 
 
54
55
56
57
58
59
60
61
62
...
82
83
84
85
86
87
88
89
90
0
@@ -18,7 +18,9 @@ OPTIONS = {
0
   :path => '~',
0
   :speaking => false,
0
   :doom => false,
0
- :pending => false
0
+ :sticky => false,
0
+ :pending => false,
0
+ :buuf => false
0
 }
0
 MANDATORY_OPTIONS = %w( )
0
 
0
@@ -43,10 +45,18 @@ BANNER
0
   opts.on("-d", "--doom",
0
           "Special Doom Edition.",
0
           "Only for Mac.") { |OPTIONS[:doom]| OPTIONS[:doom] = true }
0
+
0
+ opts.on("-b", "--buuf",
0
+ "Special Buuf Images.",
0
+ "For all platforms") { |OPTIONS[:buuf]| }
0
           
0
   opts.on("--pending",
0
- "Shows a different image when there are no errors/failures but there are pending specs.",
0
- "Only for Mac.") { |OPTIONS[:pending]| OPTIONS[:pending] = true }
0
+ "Shows a different image when there are no errors/failures",
0
+ "but there are pending specs. Only for Mac.") { |OPTIONS[:pending]| OPTIONS[:pending] = true }
0
+
0
+ opts.on("--sticky",
0
+ "Keep notification on screen in case of errros/failures or pending specs.",
0
+ "Only for Mac.") { |OPTIONS[:sticky]| OPTIONS[:sticky] = true }
0
 
0
   opts.on("-h", "--help",
0
           "Show this help message.") { puts opts; exit }
0
@@ -72,7 +82,9 @@ f.write "# ~.autotest\n"
0
 f.write "require 'autotest_notification'\n"
0
 f.write("SPEAKING = #{OPTIONS[:speaking]}\n")
0
 f.write("DOOM_EDITION = #{OPTIONS[:doom]}\n")
0
+f.write("BUUF = #{OPTIONS[:buuf]}\n")
0
 f.write("PENDING = #{OPTIONS[:pending]}\n")
0
+f.write("STICKY = #{OPTIONS[:sticky]}\n")
0
 f.close
0
 
0
 puts "\nAs from now all tests will be notified automatically."
...
3
4
5
6
7
 
 
8
9
10
...
29
30
31
32
 
33
34
 
35
36
 
37
38
39
...
3
4
5
 
 
6
7
8
9
10
...
29
30
31
 
32
33
 
34
35
 
36
37
38
39
0
@@ -3,8 +3,8 @@ $:.unshift(File.dirname(__FILE__))
0
 
0
 module AutotestNotification
0
   IMAGES_DIRECTORY = File.expand_path(File.dirname(__FILE__) + "/../images/")
0
- SUCCESS_IMAGE = "#{IMAGES_DIRECTORY}/pass.png"
0
- FAIL_IMAGE = "#{IMAGES_DIRECTORY}/fail.png"
0
+ SUCCESS_IMAGE = "#{IMAGES_DIRECTORY}/pass.png";
0
+ FAIL_IMAGE = "#{IMAGES_DIRECTORY}/fail.png";
0
   PENDING_IMAGE = "#{IMAGES_DIRECTORY}/pending.png"
0
 
0
   EXPIRATION_IN_SECONDS = 3
0
@@ -29,11 +29,11 @@ module AutotestNotification
0
       end
0
 
0
       if @failures > 0 || @errors > 0
0
- notify "FAIL", msg, FAIL_IMAGE, @tests + @examples, @failures + @errors, 2
0
+ notify "FAIL", msg, (BUUF ? "#{IMAGES_DIRECTORY}/buuf/fail.png" : FAIL_IMAGE), @tests + @examples, @failures + @errors, 2
0
       elsif PENDING && @pendings > 0
0
- notify "Pending", msg, PENDING_IMAGE, @tests + @examples, @failures + @errors, 2
0
+ notify "Pending", msg, (BUUF ? "#{IMAGES_DIRECTORY}/buuf/pending.png" : PENDING_IMAGE), @tests + @examples, @failures + @errors, 1
0
       else
0
- notify "Pass", msg, SUCCESS_IMAGE, @tests + @examples
0
+ notify "Pass", msg, (BUUF ? "#{IMAGES_DIRECTORY}/buuf/pass.png" : SUCCESS_IMAGE), @tests + @examples, 0, -2
0
       end
0
 
0
       puts "\e[#{code}m#{'=' * 80}\e[0m\n\n"
...
5
6
7
8
 
9
10
11
...
5
6
7
 
8
9
10
11
0
@@ -5,7 +5,7 @@ module AutotestNotification
0
     class << self
0
       
0
       def notify(title, msg, img, total = 1, failures = 0, pri = 0)
0
- system "growlnotify -n autotest --image #{img} -p #{pri} -m '#{msg}' #{title}"
0
+ system "growlnotify -n autotest --image #{img} #{"-s" if ((pri > 0) and STICKY)} -p #{pri} -m '#{msg}' -t #{title}"
0
         say(total, failures) if SPEAKING
0
       end
0
 

Comments

    No one has commented yet.