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
Special Doom Edition for Linux
ozeias (author)
Wed Jun 18 07:04:35 -0700 2008
commit  33ce19588ae2a59230f4c75251377a0141e84fae
tree    0bd456ad997ebaf3264c8ee6a08a23b01ef89ed8
parent  641eb97a0d5d9f4b9dee3b7666585a20914dc6e5
...
1
 
2
3
4
...
 
1
2
3
4
0
@@ -1,4 +1,4 @@
0
-#!/usr/bin/env ruby
0
+#! /opt/ruby-enterprise-1.8.6-20080507/bin/ruby
0
 #
0
 # Created on 2008-5-11.
0
 # Copyright (c) 2008. All rights reserved.
...
1
 
2
3
4
...
 
1
2
3
4
0
@@ -1,4 +1,4 @@
0
-#!/usr/bin/env ruby
0
+#! /opt/ruby-enterprise-1.8.6-20080507/bin/ruby
0
 #
0
 # Created on 2008-5-11.
0
 # Copyright (c) 2008. All rights reserved.
...
2
3
4
5
 
6
7
8
...
2
3
4
 
5
6
7
8
0
@@ -2,7 +2,7 @@ require 'fileutils'
0
 include FileUtils
0
 
0
 require 'rubygems'
0
-%w[rake hoe newgem rubigen ZenTest].each do |req_gem|
0
+%w[rake hoe newgem rubigen zentest].each do |req_gem|
0
   begin
0
     require req_gem
0
   rescue LoadError
...
44
45
46
47
 
48
49
50
...
44
45
46
 
47
48
49
50
0
@@ -44,7 +44,7 @@ module AutotestNotification
0
 
0
       case RUBY_PLATFORM
0
       when /linux/
0
- Linux.notify(title, msg, img, failures)
0
+ Linux.notify(title, msg, img, total, failures)
0
       when /darwin/
0
         Mac.notify(title, msg, img, total, failures, pri)
0
       when /cygwin/
...
9
10
11
 
 
 
 
12
13
14
...
9
10
11
12
13
14
15
16
17
18
0
@@ -9,6 +9,10 @@ module AutotestNotification
0
         `#{File.expand_path(File.dirname(__FILE__) + "/../../bin/")}/playsound #{File.expand_path(File.dirname(__FILE__) + "/../../sounds/doom/")}/#{percent(total, failures)}.wav`
0
       end
0
 
0
+ def mplayer_sound(total, failures)
0
+ system("/usr/bin/mplayer #{File.expand_path(File.dirname(__FILE__) + "../../../sounds/doom/")}/#{percent(total, failures)}.wav")
0
+ end
0
+
0
       private
0
         def percent(total, failures)
0
           percent = failures.zero? ? 0 : ((5 * failures) / total) + 1
...
2
3
4
5
 
6
7
8
...
11
12
13
14
 
15
16
17
...
27
28
29
30
31
 
 
32
33
 
 
 
 
 
34
35
36
...
2
3
4
 
5
6
7
8
...
11
12
13
 
14
15
16
17
...
27
28
29
 
 
30
31
32
 
33
34
35
36
37
38
39
40
0
@@ -2,7 +2,7 @@ module AutotestNotification
0
   class Linux
0
     class << self
0
 
0
- def notify(title, msg, img, failures=0)
0
+ def notify(title, msg, img, total=1, failures=0)
0
         if has_notify?
0
           notify_send(title, msg, img)
0
         elsif has_zenity?
0
@@ -11,7 +11,7 @@ module AutotestNotification
0
           kdialog(title, msg, img)
0
         end
0
 
0
- talk(msg, failures)
0
+ talk(msg, total, failures) if SPEAKING
0
       end
0
 
0
       protected
0
@@ -27,10 +27,14 @@ module AutotestNotification
0
           system "zenity --info --text='#{msg}' --title='#{title}'"
0
         end
0
 
0
- def talk(msg, failures)
0
- # TODO: check if user has espeak installed
0
+ def talk(msg, total, failures)
0
+ # TODO: check if user has espeak and mplayer installed
0
           begin
0
- system("/usr/bin/espeak '#{failures} test#{'s' unless failures == 1} failed'") if SPEAKING && failures > 0
0
+ if failures > 0
0
+ DOOM_EDITION ? Doom.mplayer_sound(total, failures) : system("/usr/bin/espeak '#{failures} test#{'s' unless failures == 1} failed'")
0
+ else
0
+ DOOM_EDITION ? Doom.mplayer_sound(total, failures) : system("/usr/bin/espeak 'All tests passed successfully'")
0
+ end
0
           rescue
0
           end
0
         end
...
33
34
35
36
 
37
38
39
...
130
131
132
133
 
134
135
136
...
33
34
35
 
36
37
38
39
...
130
131
132
 
133
134
135
136
0
@@ -33,7 +33,7 @@
0
     <h1>autotest_notification</h1>
0
     <div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/autotest_notification"; return false'>
0
       <p>Get Version</p>
0
- <a href="http://rubyforge.org/projects/autotest_notification" class="numbers">1.2.0</a>
0
+ <a href="http://rubyforge.org/projects/autotest_notification" class="numbers">1.3.0</a>
0
     </div>
0
     <h1>&#x2192; &#8216;autotest_notification&#8217;</h1>
0
 
0
@@ -130,7 +130,7 @@ rake install_gem</pre>
0
 
0
   <p>Comments are welcome. Send an email to <a href="mailto:eduardobrando@gmail.com">Carlos Brando</a> via the <a href="http://groups.google.com/group/autotest_notification">forum</a></p>
0
     <p class="coda">
0
- <a href="FIXME email">FIXME full name</a>, 15th June 2008<br>
0
+ <a href="FIXME email">FIXME full name</a>, 18th June 2008<br>
0
       Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
0
     </p>
0
 </div>

Comments

    No one has commented yet.