carlosbrando-autotest-notification 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/History.txt +8 -2
- data/README.txt +4 -0
- data/autotest-notification.gemspec +2 -2
- data/bin/an-install +10 -2
- data/config/hoe.rb +1 -1
- data/lib/autotest_notification.rb +1 -1
- data/lib/autotest_notification/doom.rb +8 -1
- data/lib/autotest_notification/linux.rb +23 -19
- data/lib/autotest_notification/version.rb +1 -1
- data/website/index.html +1 -1
- metadata +3 -1
data/History.txt
CHANGED
@@ -1,7 +1,13 @@
|
|
1
|
-
|
1
|
+
1.4.0 - Jun 18, 2008
|
2
|
+
* Special Doom Edition for Linux (ozsantana)
|
3
|
+
|
4
|
+
1.3.1 - Jun 18, 2008
|
5
|
+
* Added backup to old .autotest file (tchandy)
|
6
|
+
|
7
|
+
1.3.0 - Jun 18, 2008
|
2
8
|
* Added Doom sounds.
|
3
9
|
|
4
|
-
1.2.0
|
10
|
+
1.2.0 - Jun 17, 2008
|
5
11
|
* Special Doom Edition
|
6
12
|
|
7
13
|
1.1.2
|
data/README.txt
CHANGED
@@ -65,6 +65,8 @@ Independent of operating system you are using, you must install the ZenTest:
|
|
65
65
|
If you want to be notified with voice of the test results, instal espeak [http://espeak.sourceforge.net/] too, it is not needed.
|
66
66
|
And when running an-install, pass a "-s" switch, when you do not want voices notifications anymore, just run it again without the "-s" switch.
|
67
67
|
|
68
|
+
To hear the sounds of Doom Edition, you need the mplayer [http://www.mplayerhq.hu/design7/dload.html] installed.
|
69
|
+
|
68
70
|
|
69
71
|
== INSTALL:
|
70
72
|
|
@@ -95,6 +97,8 @@ To turn off the notifier:
|
|
95
97
|
* chjunior [http://tas.milk-it.net]
|
96
98
|
* daviscabral [http://blog.impactmedia.com.br]
|
97
99
|
* tapajos [http://www.improveit.com.br/tapajos]
|
100
|
+
* tchandy [http://tchandy.wordpress.com]
|
101
|
+
* ozsantana [http://blog.iconcreative.net/]
|
98
102
|
|
99
103
|
|
100
104
|
== LICENSE:
|
@@ -1,11 +1,11 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = %q{autotest-notification}
|
3
|
-
s.version = "1.
|
3
|
+
s.version = "1.4.0"
|
4
4
|
|
5
5
|
s.specification_version = 2 if s.respond_to? :specification_version=
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
-
s.authors = ["Carlos Brando", "Rodrigo Urubatan", "Alexandre da Silva", "Carlos J\303\272nior", "Davis Zanetti Cabral", "Marcos Tapaj\303\263s"]
|
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"]
|
9
9
|
s.date = %q{2008-06-18}
|
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 = ["eduardobrando@gmail.com"]
|
data/bin/an-install
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
#
|
2
|
+
#
|
3
3
|
# Created on 2008-5-11.
|
4
4
|
# Copyright (c) 2008. All rights reserved.
|
5
5
|
|
@@ -55,11 +55,19 @@ end
|
|
55
55
|
|
56
56
|
path = OPTIONS[:path]
|
57
57
|
|
58
|
-
|
58
|
+
autotest_path = File.expand_path(path)
|
59
|
+
|
60
|
+
if File.exists?("#{autotest_path}/.autotest")
|
61
|
+
puts "\nYou Already have a .autotest file, renamed to .autotest.backup"
|
62
|
+
FileUtils.cp "#{autotest_path}/.autotest", "#{autotest_path}/.autotest.backup"
|
63
|
+
end
|
64
|
+
|
65
|
+
f = File.new("#{autotest_path}/.autotest", "w")
|
59
66
|
f.write "# ~.autotest\n"
|
60
67
|
f.write "require 'autotest_notification'\n"
|
61
68
|
f.write("SPEAKING = #{OPTIONS[:speaking]}\n")
|
62
69
|
f.write("DOOM_EDITION = #{OPTIONS[:doom]}\n")
|
63
70
|
f.close
|
71
|
+
|
64
72
|
puts "\nAs from now all tests will be notified automatically."
|
65
73
|
puts "" # a blank line
|
data/config/hoe.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'autotest_notification/version'
|
2
2
|
|
3
|
-
AUTHOR = "Carlos Brando, Rodrigo Urubatan, Alexandre da Silva, Carlos Júnior, Davis Zanetti Cabral, Marcos Tapajós"
|
3
|
+
AUTHOR = "Carlos Brando, Rodrigo Urubatan, Alexandre da Silva, Carlos Júnior, Davis Zanetti Cabral, Marcos Tapajós, Thiago Pradi, Ozéias Sant'ana"
|
4
4
|
EMAIL = "eduardobrando@gmail.com"
|
5
5
|
DESCRIPTION = "This gem set the autotest (ZenTest) to send messages to software as Growl, LibNotify, and Snarl, displaying a window with the results."
|
6
6
|
GEM_NAME = 'autotest-notification' # what ppl will type to install your gem
|
@@ -6,7 +6,14 @@ module AutotestNotification
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def play_sound(total, failures)
|
9
|
-
|
9
|
+
sound_file = "#{File.expand_path(File.dirname(__FILE__) + "/../../sounds/doom/")}/#{percent(total, failures)}.wav"
|
10
|
+
|
11
|
+
case RUBY_PLATFORM
|
12
|
+
when /darwin/
|
13
|
+
`#{File.expand_path(File.dirname(__FILE__) + "/../../bin/")}/playsound #{sound_file}`
|
14
|
+
when /linux/
|
15
|
+
system("/usr/bin/mplayer #{sound_file}")
|
16
|
+
end
|
10
17
|
end
|
11
18
|
|
12
19
|
private
|
@@ -2,7 +2,7 @@ module AutotestNotification
|
|
2
2
|
class Linux
|
3
3
|
class << self
|
4
4
|
|
5
|
-
def notify(title, msg, img, failures=0)
|
5
|
+
def notify(title, msg, img, total = 1, failures = 0)
|
6
6
|
if has_notify?
|
7
7
|
notify_send(title, msg, img)
|
8
8
|
elsif has_zenity?
|
@@ -11,10 +11,23 @@ module AutotestNotification
|
|
11
11
|
kdialog(title, msg, img)
|
12
12
|
end
|
13
13
|
|
14
|
-
|
14
|
+
say(total, failures) if SPEAKING
|
15
15
|
end
|
16
16
|
|
17
17
|
protected
|
18
|
+
|
19
|
+
def has_notify?
|
20
|
+
system "which notify-send 2> /dev/null"
|
21
|
+
end
|
22
|
+
|
23
|
+
def has_kdialog?
|
24
|
+
system "which kdialog 2> /dev/null"
|
25
|
+
end
|
26
|
+
|
27
|
+
def has_zenity?
|
28
|
+
system "which zenity 2> /dev/null"
|
29
|
+
end
|
30
|
+
|
18
31
|
def notify_send(title, msg, img)
|
19
32
|
system "notify-send -t #{EXPIRATION_IN_SECONDS * 1000} -i #{img} '#{title}' '#{msg}'"
|
20
33
|
end
|
@@ -27,25 +40,16 @@ module AutotestNotification
|
|
27
40
|
system "zenity --info --text='#{msg}' --title='#{title}'"
|
28
41
|
end
|
29
42
|
|
30
|
-
def
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
43
|
+
def say(total, failures)
|
44
|
+
if failures > 0
|
45
|
+
DOOM_EDITION ? Doom.play_sound(total, failures) : system("/usr/bin/espeak '#{failures} test#{'s' unless failures == 1} failed'")
|
46
|
+
else
|
47
|
+
DOOM_EDITION ? Doom.play_sound(total, failures) : system("/usr/bin/espeak 'All tests passed successfully'")
|
35
48
|
end
|
49
|
+
rescue
|
50
|
+
puts "You need the #{DOOM_EDITION ? 'mplayer' : 'espeak'} installed to hear the sounds."
|
36
51
|
end
|
37
|
-
|
38
|
-
def has_zenity?
|
39
|
-
system "which zenity 2> /dev/null"
|
40
|
-
end
|
41
|
-
|
42
|
-
def has_notify?
|
43
|
-
system "which notify-send 2> /dev/null"
|
44
|
-
end
|
45
|
-
|
46
|
-
def has_kdialog?
|
47
|
-
system "which kdialog 2> /dev/null"
|
48
|
-
end
|
52
|
+
|
49
53
|
end
|
50
54
|
end
|
51
55
|
end
|
data/website/index.html
CHANGED
@@ -33,7 +33,7 @@
|
|
33
33
|
<h1>autotest_notification</h1>
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/autotest_notification"; return false'>
|
35
35
|
<p>Get Version</p>
|
36
|
-
<a href="http://rubyforge.org/projects/autotest_notification" class="numbers">1.
|
36
|
+
<a href="http://rubyforge.org/projects/autotest_notification" class="numbers">1.4.0</a>
|
37
37
|
</div>
|
38
38
|
<h1>→ ‘autotest_notification’</h1>
|
39
39
|
|
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.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Brando
|
@@ -10,6 +10,8 @@ authors:
|
|
10
10
|
- "Carlos J\xC3\xBAnior"
|
11
11
|
- Davis Zanetti Cabral
|
12
12
|
- "Marcos Tapaj\xC3\xB3s"
|
13
|
+
- Thiago Pradi
|
14
|
+
- "Oz\xC3\xA9ias Sant'ana"
|
13
15
|
autorequire:
|
14
16
|
bindir: bin
|
15
17
|
cert_chain: []
|