carlosbrando-autotest-notification 1.5.0 → 1.6.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -0
- data/Manifest.txt +5 -1
- data/README.txt +8 -2
- data/autotest-notification.gemspec +21 -9
- data/bin/an-install +15 -3
- data/config/hoe.rb +2 -2
- data/images/buuf/fail.png +0 -0
- data/images/buuf/pass.png +0 -0
- data/images/buuf/pending.png +0 -0
- data/lib/autotest_notification/buuf.rb +9 -0
- data/lib/autotest_notification/doom.rb +4 -4
- data/lib/autotest_notification/mac.rb +3 -2
- data/lib/autotest_notification/version.rb +2 -2
- data/lib/autotest_notification.rb +8 -7
- data/test/autotest_notification/test_cygwin.rb +1 -2
- data/test/autotest_notification/test_linux.rb +9 -10
- data/test/autotest_notification/test_mac.rb +27 -9
- data/test/autotest_notification/test_windows.rb +1 -2
- data/test/test_autotest_notification.rb +16 -10
- data/website/index.html +33 -88
- metadata +19 -5
data/History.txt
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
1.6.0 - Oct 08, 2008
|
2
|
+
* Buuf Edition - display Buuf icons by Mattahan [http://mattahan.deviantart.com] (samflores)
|
3
|
+
* Added --sticky flag to an-install to keep notifications on screen in case of errors/failures or pending specs (samflores)
|
4
|
+
* Pending notifications now have a priority different from Passed and Failled notifications, to allow set diff color with Growl (samflores)
|
5
|
+
|
1
6
|
1.5.0 - Oct 02, 2008
|
2
7
|
* If an-install is run with --pending, shows a yellow warning when there are no errors/failures but there are pending specs. (lucasuyezu)
|
3
8
|
|
data/Manifest.txt
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
autotest-notification.gemspec
|
1
2
|
History.txt
|
2
3
|
License.txt
|
3
4
|
Manifest.txt
|
@@ -13,6 +14,7 @@ lib/autotest_notification/windows.rb
|
|
13
14
|
lib/autotest_notification/cygwin.rb
|
14
15
|
lib/autotest_notification/mac.rb
|
15
16
|
lib/autotest_notification/doom.rb
|
17
|
+
lib/autotest_notification/buuf.rb
|
16
18
|
script/console
|
17
19
|
script/destroy
|
18
20
|
script/generate
|
@@ -38,7 +40,9 @@ bin/playsound
|
|
38
40
|
images/pass.png
|
39
41
|
images/fail.png
|
40
42
|
images/pending.png
|
41
|
-
|
43
|
+
images/buuf/fail.png
|
44
|
+
images/buuf/pass.png
|
45
|
+
images/buuf/pending.png
|
42
46
|
images/doom/doom_0.png
|
43
47
|
images/doom/doom_1.png
|
44
48
|
images/doom/doom_2.png
|
data/README.txt
CHANGED
@@ -89,6 +89,10 @@ To turn off the notifier:
|
|
89
89
|
|
90
90
|
$ an-install --doom --speaking
|
91
91
|
|
92
|
+
== Buuf Edition - Display Buuf icons by Mattahan [http://mattahan.deviantart.com]
|
93
|
+
|
94
|
+
$ an-install --buuf
|
95
|
+
|
92
96
|
== Showing a yellow warning image when there are no errors/failures but there are pending specs
|
93
97
|
|
94
98
|
$ an-install --pending
|
@@ -102,9 +106,11 @@ To turn off the notifier:
|
|
102
106
|
* daviscabral [http://blog.impactmedia.com.br]
|
103
107
|
* tapajos [http://www.improveit.com.br/tapajos]
|
104
108
|
* tchandy [http://tchandy.wordpress.com]
|
105
|
-
* ozsantana [http://blog.iconcreative.net
|
109
|
+
* ozsantana [http://blog.iconcreative.net]
|
106
110
|
* lucasuyezu [http://xucros.com]
|
107
|
-
|
111
|
+
* samflores [http://github.com/samflores]
|
112
|
+
* dcrec1 [http://www.mouseoverstudio.com/blog]
|
113
|
+
* nuxlli [http://www.nuxlli.com.br]
|
108
114
|
|
109
115
|
== LICENSE:
|
110
116
|
|
@@ -1,17 +1,15 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = %q{autotest-notification}
|
3
|
-
s.version = "1.
|
4
|
-
|
5
|
-
s.specification_version = 2 if s.respond_to? :specification_version=
|
3
|
+
s.version = "1.6.0"
|
6
4
|
|
7
5
|
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", "Thiago Pradi", "Oz\303\251ias Sant'ana", "
|
9
|
-
s.date = %q{2008-
|
6
|
+
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"]
|
7
|
+
s.date = %q{2008-10-09}
|
10
8
|
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
|
-
s.email = ["
|
9
|
+
s.email = ["autotest-notification@carlosbrando.com"]
|
12
10
|
s.executables = ["an-install", "an-uninstall", "playsound"]
|
13
11
|
s.extra_rdoc_files = ["History.txt", "License.txt", "Manifest.txt", "PostInstall.txt", "README.txt", "website/index.txt"]
|
14
|
-
s.files = ["History.txt", "License.txt", "Manifest.txt", "PostInstall.txt", "README.txt", "Rakefile", "config/hoe.rb", "config/requirements.rb", "lib/autotest_notification.rb", "lib/autotest_notification/version.rb", "lib/autotest_notification/linux.rb", "lib/autotest_notification/windows.rb", "lib/autotest_notification/cygwin.rb", "lib/autotest_notification/mac.rb", "lib/autotest_notification/doom.rb", "script/console", "script/destroy", "script/generate", "script/txt2html", "setup.rb", "tasks/deployment.rake", "tasks/environment.rake", "tasks/website.rake", "test/test_autotest_notification.rb", "test/test_helper.rb", "test/autotest_notification/test_cygwin.rb", "test/autotest_notification/test_linux.rb", "test/autotest_notification/test_windows.rb", "test/autotest_notification/test_mac.rb", "website/index.html", "website/index.txt", "website/javascripts/rounded_corners_lite.inc.js", "website/stylesheets/screen.css", "website/template.html.erb", "bin/an-install", "bin/an-uninstall", "bin/playsound", "images/pass.png", "images/fail.png", "images/pending.png", "
|
12
|
+
s.files = ["autotest-notification.gemspec", "History.txt", "License.txt", "Manifest.txt", "PostInstall.txt", "README.txt", "Rakefile", "config/hoe.rb", "config/requirements.rb", "lib/autotest_notification.rb", "lib/autotest_notification/version.rb", "lib/autotest_notification/linux.rb", "lib/autotest_notification/windows.rb", "lib/autotest_notification/cygwin.rb", "lib/autotest_notification/mac.rb", "lib/autotest_notification/doom.rb", "lib/autotest_notification/buuf.rb", "script/console", "script/destroy", "script/generate", "script/txt2html", "setup.rb", "tasks/deployment.rake", "tasks/environment.rake", "tasks/website.rake", "test/test_autotest_notification.rb", "test/test_helper.rb", "test/autotest_notification/test_cygwin.rb", "test/autotest_notification/test_linux.rb", "test/autotest_notification/test_windows.rb", "test/autotest_notification/test_mac.rb", "website/index.html", "website/index.txt", "website/javascripts/rounded_corners_lite.inc.js", "website/stylesheets/screen.css", "website/template.html.erb", "bin/an-install", "bin/an-uninstall", "bin/playsound", "images/pass.png", "images/fail.png", "images/pending.png", "images/buuf/fail.png", "images/buuf/pass.png", "images/buuf/pending.png", "images/doom/doom_0.png", "images/doom/doom_1.png", "images/doom/doom_2.png", "images/doom/doom_3.png", "images/doom/doom_4.png", "images/doom/doom_5.png", "images/doom/doom_6.png", "sounds/doom/0.wav", "sounds/doom/1.wav", "sounds/doom/2.wav", "sounds/doom/3.wav", "sounds/doom/4.wav", "sounds/doom/5.wav", "sounds/doom/6.wav"]
|
15
13
|
s.has_rdoc = true
|
16
14
|
s.homepage = %q{http://github.com/carlosbrando/autotest-notification/}
|
17
15
|
s.post_install_message = %q{
|
@@ -27,9 +25,23 @@ To turn off:
|
|
27
25
|
s.rdoc_options = ["--main", "README.txt"]
|
28
26
|
s.require_paths = ["lib"]
|
29
27
|
s.rubyforge_project = %q{autotest-notification}
|
30
|
-
s.rubygems_version = %q{1.
|
28
|
+
s.rubygems_version = %q{1.3.0}
|
31
29
|
s.summary = %q{This gem set the autotest (ZenTest) to send messages to software as Growl, LibNotify, and Snarl, displaying a window with the results.}
|
32
30
|
s.test_files = ["test/autotest_notification/test_cygwin.rb", "test/autotest_notification/test_linux.rb", "test/autotest_notification/test_mac.rb", "test/autotest_notification/test_windows.rb", "test/test_autotest_notification.rb", "test/test_helper.rb"]
|
33
31
|
|
34
|
-
s.
|
32
|
+
if s.respond_to? :specification_version then
|
33
|
+
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
34
|
+
s.specification_version = 2
|
35
|
+
|
36
|
+
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
37
|
+
s.add_runtime_dependency(%q<ZenTest>, [">= 3.9.2"])
|
38
|
+
s.add_development_dependency(%q<hoe>, [">= 1.7.0"])
|
39
|
+
else
|
40
|
+
s.add_dependency(%q<ZenTest>, [">= 3.9.2"])
|
41
|
+
s.add_dependency(%q<hoe>, [">= 1.7.0"])
|
42
|
+
end
|
43
|
+
else
|
44
|
+
s.add_dependency(%q<ZenTest>, [">= 3.9.2"])
|
45
|
+
s.add_dependency(%q<hoe>, [">= 1.7.0"])
|
46
|
+
end
|
35
47
|
end
|
data/bin/an-install
CHANGED
@@ -18,7 +18,9 @@ OPTIONS = {
|
|
18
18
|
:path => '~',
|
19
19
|
:speaking => false,
|
20
20
|
:doom => false,
|
21
|
-
:
|
21
|
+
:sticky => false,
|
22
|
+
:pending => false,
|
23
|
+
:buuf => false
|
22
24
|
}
|
23
25
|
MANDATORY_OPTIONS = %w( )
|
24
26
|
|
@@ -43,10 +45,18 @@ BANNER
|
|
43
45
|
opts.on("-d", "--doom",
|
44
46
|
"Special Doom Edition.",
|
45
47
|
"Only for Mac.") { |OPTIONS[:doom]| OPTIONS[:doom] = true }
|
48
|
+
|
49
|
+
opts.on("-b", "--buuf",
|
50
|
+
"Special Buuf Images.",
|
51
|
+
"For all platforms") { |OPTIONS[:buuf]| }
|
46
52
|
|
47
53
|
opts.on("--pending",
|
48
|
-
"Shows a different image when there are no errors/failures
|
49
|
-
"Only for Mac.") { |OPTIONS[:pending]| OPTIONS[:pending] = true }
|
54
|
+
"Shows a different image when there are no errors/failures",
|
55
|
+
"but there are pending specs. Only for Mac.") { |OPTIONS[:pending]| OPTIONS[:pending] = true }
|
56
|
+
|
57
|
+
opts.on("--sticky",
|
58
|
+
"Keep notification on screen in case of errros/failures or pending specs.",
|
59
|
+
"Only for Mac.") { |OPTIONS[:sticky]| OPTIONS[:sticky] = true }
|
50
60
|
|
51
61
|
opts.on("-h", "--help",
|
52
62
|
"Show this help message.") { puts opts; exit }
|
@@ -72,7 +82,9 @@ f.write "# ~.autotest\n"
|
|
72
82
|
f.write "require 'autotest_notification'\n"
|
73
83
|
f.write("SPEAKING = #{OPTIONS[:speaking]}\n")
|
74
84
|
f.write("DOOM_EDITION = #{OPTIONS[:doom]}\n")
|
85
|
+
f.write("BUUF = #{OPTIONS[:buuf]}\n")
|
75
86
|
f.write("PENDING = #{OPTIONS[:pending]}\n")
|
87
|
+
f.write("STICKY = #{OPTIONS[:sticky]}\n")
|
76
88
|
f.close
|
77
89
|
|
78
90
|
puts "\nAs from now all tests will be notified automatically."
|
data/config/hoe.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
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, Thiago Pradi, Ozéias Sant'ana"
|
4
|
-
EMAIL = "
|
3
|
+
AUTHOR = "Carlos Brando, Rodrigo Urubatan, Alexandre da Silva, Carlos Júnior, Davis Zanetti Cabral, Marcos Tapajós, Thiago Pradi, Ozéias Sant'ana, Samuel Flores, Diego Carrion"
|
4
|
+
EMAIL = "autotest-notification@carlosbrando.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
|
7
7
|
RUBYFORGE_PROJECT = nil # 'autotestnotific' # The unix name for your project
|
Binary file
|
Binary file
|
Binary file
|
@@ -1,4 +1,4 @@
|
|
1
|
-
module AutotestNotification
|
1
|
+
module AutotestNotification
|
2
2
|
class Doom
|
3
3
|
class << self
|
4
4
|
def image(total, failures)
|
@@ -7,12 +7,12 @@ module AutotestNotification
|
|
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
|
-
|
10
|
+
|
11
11
|
case RUBY_PLATFORM
|
12
12
|
when /darwin/
|
13
13
|
`#{File.expand_path(File.dirname(__FILE__) + "/../../bin/")}/playsound #{sound_file}`
|
14
14
|
when /linux/
|
15
|
-
system("/usr/bin/mplayer #{sound_file}")
|
15
|
+
system("/usr/bin/mplayer #{sound_file} > /dev/null 2> /dev/null")
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
@@ -21,5 +21,5 @@ module AutotestNotification
|
|
21
21
|
percent = failures.zero? ? 0 : ((5 * failures) / total) + 1
|
22
22
|
end
|
23
23
|
end
|
24
|
-
end
|
24
|
+
end
|
25
25
|
end
|
@@ -4,12 +4,13 @@ module AutotestNotification
|
|
4
4
|
|
5
5
|
class << self
|
6
6
|
|
7
|
-
def notify(title, msg, img, total = 1, failures = 0,
|
8
|
-
system "growlnotify -n autotest --image #{img} -p #{
|
7
|
+
def notify(title, msg, img, total = 1, failures = 0, priority = 0)
|
8
|
+
system "growlnotify -n autotest --image #{img} #{'-s ' if ((failures > 0) and STICKY)}-p #{priority} -m '#{msg}' -t #{title}"
|
9
9
|
say(total, failures) if SPEAKING
|
10
10
|
end
|
11
11
|
|
12
12
|
def say(total, failures)
|
13
|
+
|
13
14
|
if failures > 0
|
14
15
|
DOOM_EDITION ? Doom.play_sound(total, failures) : system("say #{failures} test#{'s' unless failures == 1} failed.")
|
15
16
|
@last_test_failed = true
|
@@ -1,10 +1,10 @@
|
|
1
1
|
$:.unshift(File.dirname(__FILE__))
|
2
|
-
%w{ linux mac windows cygwin doom }.each { |x| require "autotest_notification/#{x}" }
|
2
|
+
%w{ linux mac windows cygwin doom buuf }.each { |x| require "autotest_notification/#{x}" }
|
3
3
|
|
4
4
|
module AutotestNotification
|
5
5
|
IMAGES_DIRECTORY = File.expand_path(File.dirname(__FILE__) + "/../images/")
|
6
|
-
SUCCESS_IMAGE = "#{IMAGES_DIRECTORY}/pass.png"
|
7
|
-
FAIL_IMAGE = "#{IMAGES_DIRECTORY}/fail.png"
|
6
|
+
SUCCESS_IMAGE = "#{IMAGES_DIRECTORY}/pass.png";
|
7
|
+
FAIL_IMAGE = "#{IMAGES_DIRECTORY}/fail.png";
|
8
8
|
PENDING_IMAGE = "#{IMAGES_DIRECTORY}/pending.png"
|
9
9
|
|
10
10
|
EXPIRATION_IN_SECONDS = 3
|
@@ -31,9 +31,9 @@ module AutotestNotification
|
|
31
31
|
if @failures > 0 || @errors > 0
|
32
32
|
notify "FAIL", msg, FAIL_IMAGE, @tests + @examples, @failures + @errors, 2
|
33
33
|
elsif PENDING && @pendings > 0
|
34
|
-
notify "Pending", msg, PENDING_IMAGE, @tests + @examples, @failures + @errors,
|
34
|
+
notify "Pending", msg, PENDING_IMAGE, @tests + @examples, @failures + @errors, 1
|
35
35
|
else
|
36
|
-
notify "Pass", msg, SUCCESS_IMAGE, @tests + @examples
|
36
|
+
notify "Pass", msg, SUCCESS_IMAGE, @tests + @examples, 0, -2
|
37
37
|
end
|
38
38
|
|
39
39
|
puts "\e[#{code}m#{'=' * 80}\e[0m\n\n"
|
@@ -41,15 +41,16 @@ module AutotestNotification
|
|
41
41
|
end
|
42
42
|
|
43
43
|
class << self
|
44
|
-
def notify(title, msg, img = SUCCESS_IMAGE, total = 1, failures = 0,
|
44
|
+
def notify(title, msg, img = SUCCESS_IMAGE, total = 1, failures = 0, priority = 0)
|
45
45
|
|
46
46
|
img = Doom.image(total, failures) if DOOM_EDITION
|
47
|
+
img = Buuf.image(title.downcase) if BUUF
|
47
48
|
|
48
49
|
case RUBY_PLATFORM
|
49
50
|
when /linux/
|
50
51
|
Linux.notify(title, msg, img, total, failures)
|
51
52
|
when /darwin/
|
52
|
-
Mac.notify(title, msg, img, total, failures,
|
53
|
+
Mac.notify(title, msg, img, total, failures, priority)
|
53
54
|
when /cygwin/
|
54
55
|
Cygwin.notify(title, msg, img)
|
55
56
|
when /mswin/
|
@@ -4,23 +4,24 @@ class TestLinux < Test::Unit::TestCase
|
|
4
4
|
|
5
5
|
def setup
|
6
6
|
turn_methods_public AutotestNotification::Linux
|
7
|
+
AutotestNotification.const_set :DOOM_EDITION, false
|
8
|
+
AutotestNotification.const_set :SPEAKING, false
|
9
|
+
AutotestNotification.const_set :STICKY, false
|
10
|
+
AutotestNotification.const_set :BUUF, false
|
7
11
|
end
|
8
12
|
|
9
13
|
def test_notify_when_use_notify_without_speak
|
10
|
-
Object.const_set :SPEAKING, false
|
11
14
|
AutotestNotification::Linux.expects(:has_notify?).returns(true)
|
12
15
|
verify_notify(:notify_send)
|
13
16
|
end
|
14
17
|
|
15
18
|
def test_notify_when_use_zenity_without_speak
|
16
|
-
Object.const_set :SPEAKING, false
|
17
19
|
AutotestNotification::Linux.expects(:has_notify?).returns(false)
|
18
20
|
AutotestNotification::Linux.expects(:has_zenity?).returns(true)
|
19
21
|
verify_notify(:zenity)
|
20
22
|
end
|
21
23
|
|
22
24
|
def test_notify_when_use_kdialog_without_speak
|
23
|
-
Object.const_set :SPEAKING, false
|
24
25
|
AutotestNotification::Linux.expects(:has_notify?).returns(false)
|
25
26
|
AutotestNotification::Linux.expects(:has_zenity?).returns(false)
|
26
27
|
AutotestNotification::Linux.expects(:has_kdialog?).returns(true)
|
@@ -28,14 +29,14 @@ class TestLinux < Test::Unit::TestCase
|
|
28
29
|
end
|
29
30
|
|
30
31
|
def test_notify_when_use_notify_with_speak
|
31
|
-
|
32
|
+
AutotestNotification.const_set :SPEAKING, true
|
32
33
|
AutotestNotification::Linux.expects(:has_notify?).returns(true)
|
33
34
|
AutotestNotification::Linux.expects(:system).with("/usr/bin/espeak '1 test failed'")
|
34
35
|
verify_notify(:notify_send)
|
35
36
|
end
|
36
37
|
|
37
38
|
def test_notify_when_use_zenity_with_speak
|
38
|
-
|
39
|
+
AutotestNotification.const_set :SPEAKING, true
|
39
40
|
AutotestNotification::Linux.expects(:has_notify?).returns(false)
|
40
41
|
AutotestNotification::Linux.expects(:has_zenity?).returns(true)
|
41
42
|
AutotestNotification::Linux.expects(:system).with("/usr/bin/espeak '1 test failed'")
|
@@ -43,7 +44,7 @@ class TestLinux < Test::Unit::TestCase
|
|
43
44
|
end
|
44
45
|
|
45
46
|
def test_notify_when_use_kdialog_with_speak
|
46
|
-
|
47
|
+
AutotestNotification.const_set :SPEAKING, true
|
47
48
|
AutotestNotification::Linux.expects(:has_notify?).returns(false)
|
48
49
|
AutotestNotification::Linux.expects(:has_zenity?).returns(false)
|
49
50
|
AutotestNotification::Linux.expects(:has_kdialog?).returns(true)
|
@@ -85,8 +86,6 @@ class TestLinux < Test::Unit::TestCase
|
|
85
86
|
|
86
87
|
def verify_notify(method)
|
87
88
|
AutotestNotification::Linux.expects(method).returns("title", "msg", "image", 1)
|
88
|
-
AutotestNotification::Linux.notify("title", "msg", "image",1)
|
89
|
+
AutotestNotification::Linux.notify("title", "msg", "image", 1, 1)
|
89
90
|
end
|
90
|
-
|
91
|
-
end
|
92
|
-
|
91
|
+
end
|
@@ -1,24 +1,42 @@
|
|
1
1
|
require File.dirname(__FILE__) + '/../test_helper.rb'
|
2
2
|
|
3
3
|
class TestMac < Test::Unit::TestCase
|
4
|
+
|
5
|
+
def setup
|
6
|
+
AutotestNotification.const_set :DOOM_EDITION, false
|
7
|
+
AutotestNotification.const_set :SPEAKING, false
|
8
|
+
AutotestNotification.const_set :STICKY, false
|
9
|
+
AutotestNotification.const_set :BUUF, false
|
10
|
+
end
|
4
11
|
|
5
12
|
def test_notify_without_voice
|
6
|
-
|
7
|
-
AutotestNotification::Mac.expects(:system).with("growlnotify -n autotest --image image -p 0 -m 'msg' title")
|
13
|
+
AutotestNotification.const_set :SPEAKING, false
|
14
|
+
AutotestNotification::Mac.expects(:system).with("growlnotify -n autotest --image image -p 0 -m 'msg' -t title")
|
8
15
|
AutotestNotification::Mac.notify("title", "msg", "image", 1)
|
9
16
|
end
|
10
17
|
|
11
18
|
def test_notify_with_voice
|
12
|
-
|
13
|
-
AutotestNotification::Mac.expects(:system).with("growlnotify -n autotest --image image -p 0 -m 'msg' title")
|
19
|
+
AutotestNotification.const_set :SPEAKING, true
|
20
|
+
AutotestNotification::Mac.expects(:system).with("growlnotify -n autotest --image image -p 0 -m 'msg' -t title")
|
14
21
|
AutotestNotification::Mac.expects(:system).with("say 1 test failed.")
|
15
|
-
AutotestNotification::Mac.notify("title", "msg", "image", 1)
|
22
|
+
AutotestNotification::Mac.notify("title", "msg", "image", 1, 1)
|
16
23
|
end
|
17
24
|
|
18
25
|
def test_notify_with_pending
|
19
|
-
|
20
|
-
AutotestNotification::Mac.expects(:system).with("growlnotify -n autotest --image image -p 0 -m 'msg' title")
|
26
|
+
AutotestNotification.const_set :PENDING, true
|
27
|
+
AutotestNotification::Mac.expects(:system).with("growlnotify -n autotest --image image -p 0 -m 'msg' -t title")
|
21
28
|
AutotestNotification::Mac.notify("title", "msg", "image", 1)
|
22
29
|
end
|
23
|
-
|
24
|
-
|
30
|
+
|
31
|
+
def test_notify_with_sticky
|
32
|
+
AutotestNotification.const_set :STICKY, true
|
33
|
+
AutotestNotification::Mac.expects(:system).with("growlnotify -n autotest --image image -s -p 0 -m 'msg' -t title")
|
34
|
+
AutotestNotification::Mac.notify("title", "msg", "image", 1, 1)
|
35
|
+
end
|
36
|
+
|
37
|
+
def test_notify_with_buuf
|
38
|
+
AutotestNotification.const_set :BUUF, true
|
39
|
+
AutotestNotification::Mac.expects(:system).with("growlnotify -n autotest --image image -p 0 -m 'msg' -t title")
|
40
|
+
AutotestNotification::Mac.notify("title", "msg", "image", 1, 1)
|
41
|
+
end
|
42
|
+
end
|
@@ -3,10 +3,16 @@ require File.dirname(__FILE__) + '/test_helper.rb'
|
|
3
3
|
class TestAutotestNotification < Test::Unit::TestCase
|
4
4
|
|
5
5
|
def setup
|
6
|
-
@title
|
7
|
-
@msg
|
8
|
-
@image
|
9
|
-
@
|
6
|
+
@title = "title"
|
7
|
+
@msg = "message"
|
8
|
+
@image = "image"
|
9
|
+
@priority = 0
|
10
|
+
@total = 0
|
11
|
+
@failures = 0
|
12
|
+
|
13
|
+
%w( DOOM_EDITION SPEAKING STICKY BUUF ).each do |c|
|
14
|
+
AutotestNotification.const_set(c.to_sym, false) unless AutotestNotification.const_defined?(c.to_sym)
|
15
|
+
end
|
10
16
|
end
|
11
17
|
|
12
18
|
def test_notify_when_os_is_cygwin
|
@@ -20,19 +26,19 @@ class TestAutotestNotification < Test::Unit::TestCase
|
|
20
26
|
end
|
21
27
|
|
22
28
|
def test_notify_when_os_is_linux
|
23
|
-
AutotestNotification::Linux.expects(:notify).with(@title, @msg, @image
|
29
|
+
AutotestNotification::Linux.expects(:notify).with(@title, @msg, @image, @total, @failures)
|
24
30
|
verify_to("linux")
|
25
31
|
end
|
26
32
|
|
27
33
|
def test_notify_when_os_is_mac
|
28
|
-
AutotestNotification::Mac.expects(:notify).with(@title, @msg, @image, @
|
34
|
+
AutotestNotification::Mac.expects(:notify).with(@title, @msg, @image, @total, @failures, @priority)
|
29
35
|
verify_to("darwin")
|
30
36
|
end
|
31
37
|
|
32
|
-
|
38
|
+
private
|
39
|
+
|
33
40
|
def verify_to(so)
|
34
|
-
AutotestNotification.const_set
|
35
|
-
AutotestNotification.notify(@title, @msg, @image, @
|
41
|
+
AutotestNotification.const_set :RUBY_PLATFORM, so
|
42
|
+
AutotestNotification.notify(@title, @msg, @image, @total, @failures, @priority)
|
36
43
|
end
|
37
|
-
|
38
44
|
end
|
data/website/index.html
CHANGED
@@ -33,104 +33,49 @@
|
|
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.5.0</a>
|
37
37
|
</div>
|
38
|
-
<h1
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
<p><a href="http://groups.google.com/group/autotest_notification">http://groups.google.com/group/autotest_notification</a></p>
|
60
|
-
|
61
|
-
|
62
|
-
<p><span class="caps">TODO</span> – create Google Group – autotest_notification</p>
|
63
|
-
|
64
|
-
|
65
|
-
<h2>How to submit patches</h2>
|
66
|
-
|
67
|
-
|
68
|
-
<p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people’s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups">8b: Submit patch to Google Groups</a>, use the Google Group above.</p>
|
69
|
-
|
70
|
-
|
71
|
-
<p><span class="caps">TODO</span> – pick <span class="caps">SVN</span> or Git instructions</p>
|
72
|
-
|
73
|
-
|
74
|
-
<p>The trunk repository is <code>svn://rubyforge.org/var/svn/autotest_notification/trunk</code> for anonymous access.</p>
|
75
|
-
|
76
|
-
|
77
|
-
<p><span class="caps">OOOORRRR</span></p>
|
78
|
-
|
79
|
-
|
80
|
-
<p>You can fetch the source from either:</p>
|
81
|
-
|
82
|
-
|
83
|
-
<ul>
|
84
|
-
<li>rubyforge: <span class="caps">MISSING IN ACTION</span></li>
|
85
|
-
</ul>
|
86
|
-
|
87
|
-
|
88
|
-
<p><span class="caps">TODO</span> – You can not created a RubyForge project, OR have not run <code>rubyforge config</code>
|
38
|
+
<h1>&#x2192; ‘autotest_notification’</h1>
|
39
|
+
<h2>What</h2>
|
40
|
+
<h2>Installing</h2>
|
41
|
+
<p><pre class='syntax'><span class="ident">sudo</span> <span class="ident">gem</span> <span class="ident">install</span> <span class="ident">autotest_notification</span></pre></p>
|
42
|
+
<h2>The basics</h2>
|
43
|
+
<h2>Demonstration of usage</h2>
|
44
|
+
<h2>Forum</h2>
|
45
|
+
<p><a href="http://groups.google.com/group/autotest_notification">http://groups.google.com/group/autotest_notification</a></p>
|
46
|
+
<p><span class="caps">TODO</span> – create Google Group – autotest_notification</p>
|
47
|
+
<h2>How to submit patches</h2>
|
48
|
+
<p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people’s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups">8b: Submit patch to Google Groups</a>, use the Google Group above.</p>
|
49
|
+
<p><span class="caps">TODO</span> – pick <span class="caps">SVN</span> or Git instructions</p>
|
50
|
+
<p>The trunk repository is <code>svn://rubyforge.org/var/svn/autotest_notification/trunk</code> for anonymous access.</p>
|
51
|
+
<p><span class="caps">OOOORRRR</span></p>
|
52
|
+
<p>You can fetch the source from either:</p>
|
53
|
+
<ul>
|
54
|
+
<li>rubyforge: <span class="caps">MISSING</span> IN <span class="caps">ACTION</span></li>
|
55
|
+
</ul>
|
56
|
+
<p><span class="caps">TODO</span> – You can not created a RubyForge project, OR have not run <code>rubyforge config</code><br />
|
89
57
|
yet to refresh your local rubyforge data with this projects’ id information.</p>
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
<p>Or you can hack website/index.txt and make it all go away!!</p>
|
96
|
-
|
97
|
-
|
98
|
-
<ul>
|
58
|
+
<p>When you do this, this message will magically disappear!</p>
|
59
|
+
<p>Or you can hack website/index.txt and make it all go away!!</p>
|
60
|
+
<ul>
|
99
61
|
<li>github: <a href="http://github.com/GITHUB_USERNAME/autotest_notification/tree/master">http://github.com/GITHUB_USERNAME/autotest_notification/tree/master</a></li>
|
100
|
-
|
101
|
-
|
102
|
-
|
62
|
+
</ul>
|
103
63
|
<pre>git clone git://github.com/GITHUB_USERNAME/autotest_notification.git</pre>
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
<ul>
|
64
|
+
<p><span class="caps">TODO</span> – add “github_username: username” to ~/.rubyforge/user-config.yml and newgem will reuse it for future projects.</p>
|
65
|
+
<ul>
|
109
66
|
<li>gitorious: <a href="git://gitorious.org/autotest_notification/mainline.git">git://gitorious.org/autotest_notification/mainline.git</a></li>
|
110
|
-
|
111
|
-
|
112
|
-
|
67
|
+
</ul>
|
113
68
|
<pre>git clone git://gitorious.org/autotest_notification/mainline.git</pre>
|
114
|
-
|
115
|
-
<h3>Build and test instructions</h3>
|
116
|
-
|
117
|
-
|
69
|
+
<h3>Build and test instructions</h3>
|
118
70
|
<pre>cd autotest_notification
|
119
71
|
rake test
|
120
72
|
rake install_gem</pre>
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
<p>This code is free to use under the terms of the <span class="caps">MIT</span> license.</p>
|
126
|
-
|
127
|
-
|
128
|
-
<h2>Contact</h2>
|
129
|
-
|
130
|
-
|
131
|
-
<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>
|
73
|
+
<h2>License</h2>
|
74
|
+
<p>This code is free to use under the terms of the <span class="caps">MIT</span> license.</p>
|
75
|
+
<h2>Contact</h2>
|
76
|
+
<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>
|
132
77
|
<p class="coda">
|
133
|
-
<a href="FIXME email">FIXME full name</a>,
|
78
|
+
<a href="FIXME email">FIXME full name</a>, 5th October 2008<br>
|
134
79
|
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
135
80
|
</p>
|
136
81
|
</div>
|
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.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Brando
|
@@ -12,12 +12,13 @@ authors:
|
|
12
12
|
- "Marcos Tapaj\xC3\xB3s"
|
13
13
|
- Thiago Pradi
|
14
14
|
- "Oz\xC3\xA9ias Sant'ana"
|
15
|
-
-
|
15
|
+
- Samuel Flores
|
16
|
+
- Diego Carrion
|
16
17
|
autorequire:
|
17
18
|
bindir: bin
|
18
19
|
cert_chain: []
|
19
20
|
|
20
|
-
date: 2008-
|
21
|
+
date: 2008-10-09 00:00:00 -07:00
|
21
22
|
default_executable:
|
22
23
|
dependencies:
|
23
24
|
- !ruby/object:Gem::Dependency
|
@@ -29,9 +30,18 @@ dependencies:
|
|
29
30
|
- !ruby/object:Gem::Version
|
30
31
|
version: 3.9.2
|
31
32
|
version:
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: hoe
|
35
|
+
version_requirement:
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.7.0
|
41
|
+
version:
|
32
42
|
description: This gem set the autotest (ZenTest) to send messages to software as Growl, LibNotify, and Snarl, displaying a window with the results.
|
33
43
|
email:
|
34
|
-
-
|
44
|
+
- autotest-notification@carlosbrando.com
|
35
45
|
executables:
|
36
46
|
- an-install
|
37
47
|
- an-uninstall
|
@@ -46,6 +56,7 @@ extra_rdoc_files:
|
|
46
56
|
- README.txt
|
47
57
|
- website/index.txt
|
48
58
|
files:
|
59
|
+
- autotest-notification.gemspec
|
49
60
|
- History.txt
|
50
61
|
- License.txt
|
51
62
|
- Manifest.txt
|
@@ -61,6 +72,7 @@ files:
|
|
61
72
|
- lib/autotest_notification/cygwin.rb
|
62
73
|
- lib/autotest_notification/mac.rb
|
63
74
|
- lib/autotest_notification/doom.rb
|
75
|
+
- lib/autotest_notification/buuf.rb
|
64
76
|
- script/console
|
65
77
|
- script/destroy
|
66
78
|
- script/generate
|
@@ -86,7 +98,9 @@ files:
|
|
86
98
|
- images/pass.png
|
87
99
|
- images/fail.png
|
88
100
|
- images/pending.png
|
89
|
-
-
|
101
|
+
- images/buuf/fail.png
|
102
|
+
- images/buuf/pass.png
|
103
|
+
- images/buuf/pending.png
|
90
104
|
- images/doom/doom_0.png
|
91
105
|
- images/doom/doom_1.png
|
92
106
|
- images/doom/doom_2.png
|