growl-glue 1.0.1 → 1.0.2
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 +3 -0
- data/Manifest.txt +3 -2
- data/README.txt +7 -2
- data/lib/growl_glue/autotest.rb +15 -16
- data/lib/growl_glue.rb +1 -1
- data/lib/img/{fail.png → failure.png} +0 -0
- data/lib/img/pending.png +0 -0
- data/lib/img/{ok.png → success.png} +0 -0
- data.tar.gz.sig +0 -0
- metadata +5 -4
- metadata.gz.sig +0 -0
data/History.txt
CHANGED
data/Manifest.txt
CHANGED
data/README.txt
CHANGED
@@ -36,6 +36,7 @@ OS X Speech:
|
|
36
36
|
If you have *sndplay* compiled and in the path, you can have different sounds played based on test success or failure. The "location" below is optional, as it defaults to "/System/Library/Sounds":
|
37
37
|
|
38
38
|
config.sound :success => "Glass.aiff"
|
39
|
+
config.sound :pending => "Glass.aiff"
|
39
40
|
config.sound :failure => "Basso.aiff"
|
40
41
|
config.sound :location => "/System/Library/Sounds/" (optional)
|
41
42
|
|
@@ -43,18 +44,19 @@ GrowlGlue comes with success and error images it will use on test success and er
|
|
43
44
|
If you wish to supply your own, for example:
|
44
45
|
|
45
46
|
config.image :success => "~/Library/autotest/success.png"
|
47
|
+
config.image :pending => "~/Library/autotest/pending.png"
|
46
48
|
config.image :failure => "~/Library/autotest/failure.png"
|
47
49
|
|
48
50
|
By default, "Tests Passed" and "Tests Failed" will be used as the growl titles. You can supply your own, though:
|
49
51
|
|
50
|
-
config.title :success => "Love", :failure => "Hatred"
|
52
|
+
config.title :success => "Love", :failure => "Hatred", :pending => "Well, OK!"
|
51
53
|
|
52
54
|
As an example, this is what I normally use:
|
53
55
|
|
54
56
|
GrowlGlue::Autotest.initialize do |config|
|
55
57
|
|
56
58
|
config.notification :use_network_notifications => true
|
57
|
-
config.title :success => "Love", :failure => "Hate"
|
59
|
+
config.title :success => "Love", :failure => "Hate", :pending => "Keep Going!"
|
58
60
|
config.say :failure => "Something is horribly wrong!"
|
59
61
|
|
60
62
|
end
|
@@ -82,6 +84,9 @@ Please let me know (gluedtomyseat@gmail.com) if you encounter any issues. You c
|
|
82
84
|
|
83
85
|
http://github.com/oculardisaster/growl-glue/tree/master
|
84
86
|
|
87
|
+
== AUTHORS
|
88
|
+
|
89
|
+
* Collin VanDyck <gluedtomyseat@gmail.com>
|
85
90
|
|
86
91
|
== LICENSE:
|
87
92
|
|
data/lib/growl_glue/autotest.rb
CHANGED
@@ -10,10 +10,12 @@ module GrowlGlue
|
|
10
10
|
@config.sound :location => "/System/Library/Sounds/"
|
11
11
|
@config.commands :safe_growlnotify => File.join(gem_home_dir, "lib", "bin", "growl_notify.sh")
|
12
12
|
|
13
|
-
|
14
|
-
|
13
|
+
[:failure, :success, :pending].each do |status|
|
14
|
+
@config.image status => File.join(gem_home_dir, "lib", "img", "#{status}.png")
|
15
|
+
end
|
15
16
|
|
16
17
|
@config.title :success => "Tests Passed"
|
18
|
+
@config.title :pending => "Tests Passed, Some Pending"
|
17
19
|
@config.title :failure => "Tests Failed"
|
18
20
|
|
19
21
|
yield @config if block_given?
|
@@ -65,17 +67,11 @@ module GrowlGlue
|
|
65
67
|
end
|
66
68
|
end
|
67
69
|
|
68
|
-
def self.notify(title, msg, img=nil, pri=1)
|
70
|
+
def self.notify(status, title, msg, img=nil, pri=1)
|
69
71
|
with_commands do |commands|
|
70
72
|
commands << growl(title, msg, img, pri)
|
71
|
-
|
72
|
-
|
73
|
-
commands << say(@config.option(:say, :failure))
|
74
|
-
commands << sndplay(@config.option(:sound, :failure))
|
75
|
-
else
|
76
|
-
commands << say(@config.option(:say, :success))
|
77
|
-
commands << sndplay(@config.option(:sound, :success))
|
78
|
-
end
|
73
|
+
commands << say(@config.option(:say, status))
|
74
|
+
commands << sndplay(@config.option(:sound, status))
|
79
75
|
end
|
80
76
|
end
|
81
77
|
|
@@ -83,10 +79,13 @@ module GrowlGlue
|
|
83
79
|
def self.rspec_results(results)
|
84
80
|
output = results.slice(/(\d+)\s+examples?,\s*(\d+)\s+failures?(,\s*(\d+)\s+pending)?/)
|
85
81
|
if output
|
86
|
-
|
87
|
-
|
82
|
+
successes, failures, pending = *([$~[1],$~[2],$~[4]].map { |x| x.to_i })
|
83
|
+
if failures > 0
|
84
|
+
notify :failure, @config.option(:title, :failure), "#{output}", @config.option(:image, :failure), 2
|
85
|
+
elsif pending > 0
|
86
|
+
notify :pending, @config.option(:title, :pending), "#{output}", @config.option(:image, :pending)
|
88
87
|
else
|
89
|
-
notify @config.option(:title, :success), "#{output}", @config.option(:image, :success)
|
88
|
+
notify :success, @config.option(:title, :success), "#{output}", @config.option(:image, :success)
|
90
89
|
end
|
91
90
|
end
|
92
91
|
end
|
@@ -96,9 +95,9 @@ module GrowlGlue
|
|
96
95
|
output = results.slice(/(\d+)\s+tests?,\s*(\d+)\s+assertions?,\s*(\d+)\s+failures?,\s*(\d+)\s+errors?/)
|
97
96
|
if output
|
98
97
|
if (($~[3].to_i > 0) or ($~[4].to_i > 0))
|
99
|
-
notify @config.option(:title, :failure), "#{output}", @config.option(:image, :failure), 2
|
98
|
+
notify :failure, @config.option(:title, :failure), "#{output}", @config.option(:image, :failure), 2
|
100
99
|
else
|
101
|
-
notify @config.option(:title, :success), "#{output}", @config.option(:image, :success)
|
100
|
+
notify :success, @config.option(:title, :success), "#{output}", @config.option(:image, :success)
|
102
101
|
end
|
103
102
|
end
|
104
103
|
end
|
data/lib/growl_glue.rb
CHANGED
File without changes
|
data/lib/img/pending.png
ADDED
Binary file
|
File without changes
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: growl-glue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Collin VanDyck
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
jA8FHf4HdyRgbrpT6Mws7g==
|
31
31
|
-----END CERTIFICATE-----
|
32
32
|
|
33
|
-
date: 2008-07-
|
33
|
+
date: 2008-07-27 00:00:00 -04:00
|
34
34
|
default_executable:
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
@@ -65,8 +65,9 @@ files:
|
|
65
65
|
- lib/growl_glue/config.rb
|
66
66
|
- lib/growl_glue/util.rb
|
67
67
|
- lib/growl_glue.rb
|
68
|
-
- lib/img/
|
69
|
-
- lib/img/
|
68
|
+
- lib/img/failure.png
|
69
|
+
- lib/img/pending.png
|
70
|
+
- lib/img/success.png
|
70
71
|
has_rdoc: true
|
71
72
|
homepage: Simplifies Growl configuration for Autotest.
|
72
73
|
post_install_message:
|
metadata.gz.sig
CHANGED
Binary file
|