karl-autotest-growl 0.1.3 → 0.1.4
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/autotest-growl.gemspec +1 -1
- data/lib/autotest/growl.rb +33 -17
- metadata +1 -1
data/autotest-growl.gemspec
CHANGED
data/lib/autotest/growl.rb
CHANGED
@@ -46,6 +46,11 @@ module Autotest::Growl
|
|
46
46
|
def self.show_modified_files=(boolean)
|
47
47
|
@@show_modified_files = boolean
|
48
48
|
end
|
49
|
+
|
50
|
+
def self.is_windows?
|
51
|
+
processor, platform, *rest = RUBY_PLATFORM.split("-")
|
52
|
+
platform == 'mswin32'
|
53
|
+
end
|
49
54
|
|
50
55
|
##
|
51
56
|
# Display a message through Growl.
|
@@ -53,11 +58,19 @@ module Autotest::Growl
|
|
53
58
|
growl = File.join(GEM_PATH, 'growl', 'growlnotify')
|
54
59
|
image = File.join(ENV['HOME'], '.autotest-growl', "#{icon}.png")
|
55
60
|
image = File.join(GEM_PATH, 'img', "#{icon}.png") unless File.exists?(image)
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
+
|
62
|
+
if is_windows?
|
63
|
+
growl += '.com'
|
64
|
+
cmd = "#{growl} #{message.inspect} /a:\"autotest\" /r:\"Autotest\" /n:\"Autotest\" /i:\"#{image}\" /p:#{priority} /t:\"#{title}\""
|
65
|
+
else
|
66
|
+
if @@remote_notification
|
67
|
+
cmd = "#{growl} -H localhost -n autotest --image '#{image}' -p #{priority} -m #{message.inspect} '#{title}' #{stick}"
|
68
|
+
else
|
69
|
+
cmd = "#{growl} -n autotest --image '#{image}' -p #{priority} -m #{message.inspect} '#{title}' #{stick}"
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
system cmd
|
61
74
|
end
|
62
75
|
|
63
76
|
##
|
@@ -105,18 +118,21 @@ module Autotest::Growl
|
|
105
118
|
# Growl results of Cucumber
|
106
119
|
Autotest.add_hook :ran_features do |autotest|
|
107
120
|
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
121
|
+
gist = autotest.results.grep(/\d+\s+scenario.*\)/).join(" / ").strip()
|
122
|
+
if gist == ''
|
123
|
+
growl @label + 'Cannot run scenarios.', '', 'error'
|
124
|
+
else
|
125
|
+
if gist =~ /[1-9]\d*\s+(failed)/
|
126
|
+
growl @label + 'Some scenarios have failed.', gist, 'failed'
|
127
|
+
elsif gist =~ /[1-9]\d*\s+(undefined)/
|
128
|
+
growl @label + 'Some scenarios are undefinied.', gist, 'pending'
|
129
|
+
elsif gist =~ /[1-9]\d*\s+(pending)/
|
130
|
+
growl @label + 'Some scenarios are pending.', gist, 'pending'
|
131
|
+
else
|
132
|
+
growl @label + 'All scenarios have passed.', gist, 'passed'
|
133
|
+
end
|
134
|
+
|
135
|
+
end
|
120
136
|
false
|
121
137
|
end
|
122
138
|
|