autotest-growl 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/CHANGELOG.txt +5 -0
  2. data/README.rdoc +10 -1
  3. data/lib/autotest/growl.rb +16 -9
  4. metadata +28 -13
data/CHANGELOG.txt CHANGED
@@ -1,3 +1,8 @@
1
+ == 0.2.4 2010-04-28
2
+
3
+ * 1 minor improvement
4
+ * Add support for sticky error notifications (Ben Ritcey)
5
+
1
6
  == 0.2.3 2010-03-03
2
7
 
3
8
  * 1 minor improvement
data/README.rdoc CHANGED
@@ -112,13 +112,21 @@ All tests have passed", add the following to your ~/.autotest:
112
112
 
113
113
  Autotest::Growl::hide_label = true
114
114
 
115
- === One Notifications per Run
115
+ === One Notification per Run
116
116
 
117
117
  Allow only one test and one feature notification per run by adding the
118
118
  following to your ~/.autotest:
119
119
 
120
120
  Autotest::Growl::one_notification_per_run = true
121
121
 
122
+ === Make Failure and Error Notifications Sticky
123
+
124
+ If you don't want to miss any failure or error notifications while you
125
+ get a cup of coffee, make them stay on your display until you explicitly
126
+ click them away. Simply add the following to your ~/.autotest:
127
+
128
+ Autotest::Growl::sticky_failure_notifications = true
129
+
122
130
  === Show Modified Files
123
131
 
124
132
  Add the following to your ~/.autotest if you would like to receive a Growl
@@ -189,6 +197,7 @@ Thanks to the following folks who have contributed to this project:
189
197
  * J. Edward Dewyea
190
198
  * Martin Vielsmaier
191
199
  * Charles Roper
200
+ * Ben Ritcey
192
201
 
193
202
  == LICENSE:
194
203
 
@@ -24,6 +24,7 @@ module Autotest::Growl
24
24
 
25
25
  @@remote_notification = false
26
26
  @@one_notification_per_run = false
27
+ @@sticky_failure_notifications = false
27
28
  @@clear_terminal = true
28
29
  @@hide_label = false
29
30
  @@show_modified_files = false
@@ -41,6 +42,12 @@ module Autotest::Growl
41
42
  @@one_notification_per_run = boolean
42
43
  end
43
44
 
45
+ ##
46
+ # Whether to make failure and error notifications sticky.
47
+ def self.sticky_failure_notifications=(boolean)
48
+ @@sticky_failure_notifications = boolean
49
+ end
50
+
44
51
  ##
45
52
  # Whether to clear the terminal before running tests (default) or not.
46
53
  def self.clear_terminal=(boolean)
@@ -71,19 +78,19 @@ module Autotest::Growl
71
78
 
72
79
  ##
73
80
  # Display a message through Growl.
74
- def self.growl(title, message, icon, priority=0, stick="")
81
+ def self.growl(title, message, icon, priority=0, sticky=false)
75
82
  growl = File.join(GEM_PATH, 'growl', 'growlnotify')
76
83
  image = File.join(@@image_dir, "#{icon}.png")
77
84
  case Config::CONFIG['host_os']
78
85
  when /mac os|darwin/i
79
- options = "-w -n Autotest --image '#{image}' -p #{priority} -m '#{message}' '#{title}' #{stick}"
86
+ options = "-w -n Autotest --image '#{image}' -p #{priority} -m '#{message}' '#{title}' #{'-s' if sticky}"
80
87
  options << " -H localhost" if @@remote_notification
81
88
  system %(#{growl} #{options} &)
82
89
  when /linux|bsd/i
83
90
  system %(notify-send "#{title}" "#{message}" -i #{image} -t 5000)
84
91
  when /windows|mswin|mingw/i
85
92
  growl += '.com'
86
- system %(#{growl} #{message.inspect} /a:"Autotest" /r:"Autotest" /n:"Autotest" /i:"#{image}" /p:#{priority} /t:"#{title}")
93
+ system %(#{growl} #{message.inspect} /a:"Autotest" /r:"Autotest" /n:"Autotest" /i:"#{image}" /p:#{priority} /t:"#{title}" /s:#{sticky})
87
94
  else
88
95
  raise "#{Config::CONFIG['host_os']} is not supported by autotest-growl (feel free to submit a patch)"
89
96
  end
@@ -120,15 +127,15 @@ module Autotest::Growl
120
127
  case result.framework
121
128
  when 'test-unit'
122
129
  if result.has?('test-error')
123
- growl @label + 'Cannot run some unit tests.', "#{result.get('test-error')} in #{result.get('test')}", 'error', 2
130
+ growl @label + 'Cannot run some unit tests.', "#{result.get('test-error')} in #{result.get('test')}", 'error', 2, @@sticky_failure_notifications
124
131
  elsif result.has?('test-failed')
125
- growl @label + 'Some unit tests failed.', "#{result['test-failed']} of #{result.get('test-assertion')} in #{result.get('test')} failed", 'failed', 2
132
+ growl @label + 'Some unit tests failed.', "#{result['test-failed']} of #{result.get('test-assertion')} in #{result.get('test')} failed", 'failed', 2, @@sticky_failure_notifications
126
133
  else
127
134
  growl @label + 'All unit tests passed.', "#{result.get('test-assertion')} in #{result.get('test')}", 'passed', -2
128
135
  end
129
136
  when 'rspec'
130
137
  if result.has?('example-failed')
131
- growl @label + 'Some RSpec examples failed.', "#{result['example-failed']} of #{result.get('example')} failed", 'failed', 2
138
+ growl @label + 'Some RSpec examples failed.', "#{result['example-failed']} of #{result.get('example')} failed", 'failed', 2, @@sticky_failure_notifications
132
139
  elsif result.has?('example-pending')
133
140
  growl @label + 'Some RSpec examples are pending.', "#{result['example-pending']} of #{result.get('example')} pending", 'pending', -1
134
141
  else
@@ -136,7 +143,7 @@ module Autotest::Growl
136
143
  end
137
144
  end
138
145
  else
139
- growl @label + 'Could not run tests.', '', 'error', 2
146
+ growl @label + 'Could not run tests.', '', 'error', 2, @@sticky_failure_notifications
140
147
  end
141
148
  @ran_tests = true
142
149
  end
@@ -159,7 +166,7 @@ module Autotest::Growl
159
166
  elsif result.has?('scenario-failed') || result.has?('step-failed')
160
167
  explanation << "#{result['scenario-failed']} of #{result.get('scenario')} failed" if result['scenario-failed']
161
168
  explanation << "#{result['step-failed']} of #{result.get('step')} failed" if result['step-failed']
162
- growl @label + 'Some Cucumber scenarios failed.', "#{explanation.join("\n")}", 'failed', 2
169
+ growl @label + 'Some Cucumber scenarios failed.', "#{explanation.join("\n")}", 'failed', 2, @@sticky_failure_notifications
163
170
  elsif result.has?('scenario-pending') || result.has?('step-pending')
164
171
  explanation << "#{result['scenario-pending']} of #{result.get('scenario')} pending" if result['scenario-pending']
165
172
  explanation << "#{result['step-pending']} of #{result.get('step')} pending" if result['step-pending']
@@ -169,7 +176,7 @@ module Autotest::Growl
169
176
  end
170
177
  end
171
178
  else
172
- growl @label + 'Could not run features.', '', 'error', 2
179
+ growl @label + 'Could not run features.', '', 'error', 2, @@sticky_failure_notifications
173
180
  end
174
181
  @ran_features = true
175
182
  end
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: autotest-growl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 2
8
+ - 4
9
+ version: 0.2.4
5
10
  platform: ruby
6
11
  authors:
7
12
  - Sven Schwyn
@@ -9,29 +14,37 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-03-03 00:00:00 +01:00
17
+ date: 2010-04-28 00:00:00 +02:00
13
18
  default_executable:
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: rspec
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 1
29
+ - 3
30
+ - 0
23
31
  version: 1.3.0
24
- version:
32
+ type: :development
33
+ version_requirements: *id001
25
34
  - !ruby/object:Gem::Dependency
26
35
  name: autotest
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
30
38
  requirements:
31
39
  - - ">="
32
40
  - !ruby/object:Gem::Version
41
+ segments:
42
+ - 4
43
+ - 2
44
+ - 4
33
45
  version: 4.2.4
34
- version:
46
+ type: :runtime
47
+ version_requirements: *id002
35
48
  description: This gem aims to improve support for Growl notifications by autotest.
36
49
  email: ruby@bitcetera.com
37
50
  executables: []
@@ -91,18 +104,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
91
104
  requirements:
92
105
  - - ">="
93
106
  - !ruby/object:Gem::Version
107
+ segments:
108
+ - 0
94
109
  version: "0"
95
- version:
96
110
  required_rubygems_version: !ruby/object:Gem::Requirement
97
111
  requirements:
98
112
  - - ">="
99
113
  - !ruby/object:Gem::Version
114
+ segments:
115
+ - 0
100
116
  version: "0"
101
- version:
102
117
  requirements: []
103
118
 
104
119
  rubyforge_project:
105
- rubygems_version: 1.3.5
120
+ rubygems_version: 1.3.6
106
121
  signing_key:
107
122
  specification_version: 3
108
123
  summary: Growl notification support for autotest.