carlosbrando-autotest-notification 1.8.2 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{autotest-notification}
|
5
|
-
s.version = "1.
|
5
|
+
s.version = "1.9.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Carlos Brando", "Rodrigo Urubatan", "Alexandre da Silva", "Carlos J\303\272nior", "Davis Zanetti Cabral", "Marcos Tapaj\303\263s", "Thiago Pradi", "Oz\303\251ias Sant'ana", "Samuel Flores", "Diego Carrion"]
|
9
|
-
s.date = %q{2009-
|
9
|
+
s.date = %q{2009-03-19}
|
10
10
|
s.description = %q{This gem set the autotest (ZenTest) to send messages to software as Growl, LibNotify, and Snarl, displaying a window with the results.}
|
11
11
|
s.email = ["autotest-notification@carlosbrando.com"]
|
12
12
|
s.executables = ["an-install", "an-uninstall", "playsound"]
|
data/bin/an-install
CHANGED
@@ -49,7 +49,7 @@ BANNER
|
|
49
49
|
|
50
50
|
opts.on("-d", "--doom",
|
51
51
|
"Special Doom Edition.",
|
52
|
-
"Only for Mac.") { |OPTIONS[:doom]| OPTIONS[:doom] = true }
|
52
|
+
"Only for Mac/Cygwin.") { |OPTIONS[:doom]| OPTIONS[:doom] = true }
|
53
53
|
|
54
54
|
opts.on("-b", "--buuf",
|
55
55
|
"Special Buuf Images.",
|
@@ -65,11 +65,11 @@ BANNER
|
|
65
65
|
|
66
66
|
opts.on("--success-sound=PATH", String,
|
67
67
|
"Sound to play on success.",
|
68
|
-
"Only for Mac") { |OPTIONS[:sound][:success]| }
|
68
|
+
"Only for Mac/Cygwin.") { |OPTIONS[:sound][:success]| }
|
69
69
|
|
70
70
|
opts.on("--failure-sound=PATH", String,
|
71
71
|
"Sound to play on success.",
|
72
|
-
"Only for Mac") { |OPTIONS[:sound][:failure]| }
|
72
|
+
"Only for Mac/Cygwin.") { |OPTIONS[:sound][:failure]| }
|
73
73
|
|
74
74
|
opts.on("-h", "--help",
|
75
75
|
"Show this help message.") { puts opts; exit }
|
@@ -103,4 +103,4 @@ f.write("FAILURE_SOUND = '#{OPTIONS[:sound][:failure]}'\n")
|
|
103
103
|
f.close
|
104
104
|
|
105
105
|
puts "\nAs from now all tests will be notified automatically."
|
106
|
-
puts "" # a blank line
|
106
|
+
puts "" # a blank line
|
@@ -65,7 +65,7 @@ module AutotestNotification
|
|
65
65
|
when /darwin/
|
66
66
|
Mac.notify(title, msg, img, total, failures, priority)
|
67
67
|
when /cygwin/
|
68
|
-
Cygwin.notify(title, msg, img)
|
68
|
+
Cygwin.notify(title, msg, img, total, failures)
|
69
69
|
when /mswin/
|
70
70
|
Windows.notify(title, msg, img)
|
71
71
|
end
|
@@ -1,14 +1,34 @@
|
|
1
1
|
module AutotestNotification
|
2
2
|
class Cygwin
|
3
|
+
@last_test_failed = false
|
4
|
+
|
3
5
|
class << self
|
4
|
-
def notify(title, msg, img)
|
6
|
+
def notify(title, msg, img, total = 1, failures = 0)
|
5
7
|
img = get_image_path(img).strip
|
6
8
|
system "sncmd /m '#{title}' '#{msg}' '#{img}' /t #{Config.expiration_in_seconds}"
|
9
|
+
play(SUCCESS_SOUND) unless SUCCESS_SOUND.empty? or failures > 0
|
10
|
+
play(FAILURE_SOUND) unless FAILURE_SOUND.empty? or failures == 0
|
11
|
+
say(total, failures) if DOOM_EDITION
|
7
12
|
end
|
8
13
|
|
9
14
|
def get_image_path(img)
|
10
15
|
`cygpath -m #{img}`
|
11
16
|
end
|
17
|
+
|
18
|
+
def say(total, failures)
|
19
|
+
if failures > 0
|
20
|
+
Doom.play_sound(total, failures)
|
21
|
+
@last_test_failed = true
|
22
|
+
elsif @last_test_failed
|
23
|
+
Doom.play_sound(total, failures)
|
24
|
+
@last_test_failed = false
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def play(sound_file)
|
29
|
+
system "cp #{sound_file} /dev/dsp"
|
30
|
+
end
|
31
|
+
|
12
32
|
end
|
13
33
|
end
|
14
34
|
end
|
@@ -13,6 +13,8 @@ module AutotestNotification
|
|
13
13
|
`#{File.expand_path(File.dirname(__FILE__) + "/../../bin/")}/playsound #{sound_file}`
|
14
14
|
when /linux/
|
15
15
|
system("/usr/bin/mplayer #{sound_file} > /dev/null 2> /dev/null")
|
16
|
+
when /cygwin/
|
17
|
+
system "cp #{sound_file} /dev/dsp"
|
16
18
|
end
|
17
19
|
end
|
18
20
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carlosbrando-autotest-notification
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Brando
|
@@ -18,11 +18,12 @@ autorequire:
|
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
20
|
|
21
|
-
date: 2009-
|
21
|
+
date: 2009-03-19 00:00:00 -07:00
|
22
22
|
default_executable:
|
23
23
|
dependencies:
|
24
24
|
- !ruby/object:Gem::Dependency
|
25
25
|
name: ZenTest
|
26
|
+
type: :runtime
|
26
27
|
version_requirement:
|
27
28
|
version_requirements: !ruby/object:Gem::Requirement
|
28
29
|
requirements:
|
@@ -32,6 +33,7 @@ dependencies:
|
|
32
33
|
version:
|
33
34
|
- !ruby/object:Gem::Dependency
|
34
35
|
name: hoe
|
36
|
+
type: :development
|
35
37
|
version_requirement:
|
36
38
|
version_requirements: !ruby/object:Gem::Requirement
|
37
39
|
requirements:
|