test-unit-notify 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +3 -2
- data/README.md +37 -0
- data/Rakefile +3 -3
- data/doc/text/news.md +64 -0
- data/lib/test/unit/notify.rb +48 -21
- data/lib/test/unit/notify/version.rb +9 -0
- metadata +37 -58
- data/README.textile +0 -43
- data/doc/text/news.textile +0 -52
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1c9d92d5a6547a086c53bcee1e9ddd6346a55ce7
|
4
|
+
data.tar.gz: bf3b8b2108d1ca127e712054ba85b0d6c9371922
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4b41f3f696e0341cd2da406c5efcde74947e3b10fd640bddd2b9fbac0a26f2648af0cd07ccf1ada781f518ad8fbea6ea6d4f662ffef7633c50b639802427bd6f
|
7
|
+
data.tar.gz: 525c143a55835cb6f83ee7319e09826342c294e32a78c587147f7e4984f81bdb030cd1a9b138557969c1a43ef6dccb645c8f5c3b34fcd8e1c347dc4538ab4f2c
|
data/.yardopts
CHANGED
data/README.md
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# test-unit-notify
|
2
|
+
|
3
|
+
[Homepage](https://test-unit.github.io/#test-unit-notify)
|
4
|
+
|
5
|
+
## DESCRIPTION
|
6
|
+
|
7
|
+
test-unit-notify - A test result notify extension for test-unit.
|
8
|
+
|
9
|
+
## FEATURES
|
10
|
+
|
11
|
+
* This provides test result notification support.
|
12
|
+
|
13
|
+
## INSTALL
|
14
|
+
|
15
|
+
% sudo gem install test-unit-notify
|
16
|
+
|
17
|
+
## USAGE
|
18
|
+
|
19
|
+
require 'test/unit/notify'
|
20
|
+
|
21
|
+
It adds `--notify` to command line option.
|
22
|
+
|
23
|
+
% ruby test/test_my_class.rb --notify
|
24
|
+
|
25
|
+
See screenshot/notify-on-gnome.png for example on GNOME.
|
26
|
+
|
27
|
+
## LICENSE
|
28
|
+
|
29
|
+
LGPLv2.1 or later. See doc/text/lgpl.txt for details.
|
30
|
+
|
31
|
+
(Kouhei Sutou has a right to change the license including
|
32
|
+
contributed patches.)
|
33
|
+
|
34
|
+
## AUTHORS
|
35
|
+
|
36
|
+
* Kouhei Sutou: program
|
37
|
+
* Mayu & Co.: kinotan icons: http://cocooooooon.com/kinotan/
|
data/Rakefile
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# -*- ruby -*-
|
2
2
|
|
3
|
-
require
|
3
|
+
require "pathname"
|
4
4
|
|
5
5
|
base_dir = Pathname(__FILE__).dirname.expand_path
|
6
6
|
test_unit_dir = (base_dir.parent + "test-unit").expand_path
|
@@ -10,11 +10,11 @@ lib_dir = base_dir + "lib"
|
|
10
10
|
$LOAD_PATH.unshift(test_unit_lib_dir.to_s)
|
11
11
|
$LOAD_PATH.unshift(lib_dir.to_s)
|
12
12
|
|
13
|
-
require
|
13
|
+
require "test/unit/notify"
|
14
14
|
|
15
15
|
require "yard"
|
16
16
|
require "packnga"
|
17
|
-
require
|
17
|
+
require "rubygems"
|
18
18
|
require "bundler/gem_helper"
|
19
19
|
|
20
20
|
helper = Bundler::GemHelper.new(base_dir)
|
data/doc/text/news.md
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
# News
|
2
|
+
|
3
|
+
## 1.0.2 - 2014-07-13 {#version-1-0-2}
|
4
|
+
|
5
|
+
### Improvements
|
6
|
+
|
7
|
+
* Supported Windows. You need to install
|
8
|
+
[Growl for Windows](http://www.growlforwindows.com/).
|
9
|
+
[GitHub#3] [Patch by Arikui]
|
10
|
+
|
11
|
+
### Thanks
|
12
|
+
|
13
|
+
* Arikui
|
14
|
+
|
15
|
+
## 1.0.1 - 2013-04-02 {#version-1-0-1}
|
16
|
+
|
17
|
+
### Changes
|
18
|
+
|
19
|
+
* Renamed COPYING to lgpl.
|
20
|
+
|
21
|
+
### Fixes
|
22
|
+
|
23
|
+
* Added missing files to the gem package.
|
24
|
+
|
25
|
+
## 1.0.0 - 2013-03-28 {#version-1-0-0}
|
26
|
+
|
27
|
+
### Improvements
|
28
|
+
|
29
|
+
* Stopped to register auto test run.
|
30
|
+
* Added application name to notification.
|
31
|
+
* Removed warnings.
|
32
|
+
|
33
|
+
## 0.3.0 - 2011-04-15 {#version-0-3-0}
|
34
|
+
|
35
|
+
### Improvements
|
36
|
+
|
37
|
+
* Added kinotan for omission. [Mayu & Co.]
|
38
|
+
* Added kinotan for error. [Mayu & Co.]
|
39
|
+
|
40
|
+
## 0.2.1 - 2011-02-10 {#version-0-2-1}
|
41
|
+
|
42
|
+
### Improvements
|
43
|
+
|
44
|
+
* Supported Ruby 1.9.
|
45
|
+
|
46
|
+
## 0.2.0 - 2011-02-10 {#version-0-2-0}
|
47
|
+
|
48
|
+
### Improvements
|
49
|
+
|
50
|
+
* Supported Mac OS X by growlnotify.
|
51
|
+
|
52
|
+
## 0.1.0 - 2010-11-25 {#version-0-1-0}
|
53
|
+
|
54
|
+
### Improvements
|
55
|
+
|
56
|
+
* Added Test::Unit::Notify.enable=.
|
57
|
+
|
58
|
+
### Changes
|
59
|
+
|
60
|
+
* Changed license: Ruby's -> LGPLv2 or later.
|
61
|
+
|
62
|
+
## 0.0.1 - 2010-07-17 {#version-0-0-1}
|
63
|
+
|
64
|
+
Birthday!
|
data/lib/test/unit/notify.rb
CHANGED
@@ -13,9 +13,10 @@
|
|
13
13
|
# You should have received a copy of the GNU Lesser General Public License
|
14
14
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
15
15
|
|
16
|
-
require
|
17
|
-
require
|
18
|
-
require
|
16
|
+
require "pathname"
|
17
|
+
require "erb"
|
18
|
+
require "test/unit/autorunner"
|
19
|
+
require "test/unit/notify/version"
|
19
20
|
|
20
21
|
module Test
|
21
22
|
module Unit
|
@@ -32,22 +33,18 @@ module Test
|
|
32
33
|
end
|
33
34
|
|
34
35
|
module Notify
|
35
|
-
# test-unit-notify version number formatted as
|
36
|
-
# "#\{MAJOR}.#\{MINOR}.#\{MICRO}".
|
37
|
-
VERSION = "1.0.1"
|
38
|
-
|
39
36
|
class << self
|
40
37
|
@@enable = nil
|
41
38
|
|
42
39
|
# Enables test result notification by default. It
|
43
|
-
# can be disabled by
|
40
|
+
# can be disabled by `--no-notify` command line
|
44
41
|
# option.
|
45
42
|
def enable
|
46
43
|
@@enable = true
|
47
44
|
end
|
48
45
|
|
49
46
|
# Disables test result notification by default. It
|
50
|
-
# can be disabled by
|
47
|
+
# can be disabled by `--notify` command line option.
|
51
48
|
def disable
|
52
49
|
@@enable = false
|
53
50
|
end
|
@@ -112,10 +109,12 @@ module Test
|
|
112
109
|
message = h(parameters[:message])
|
113
110
|
icon = parameters[:icon]
|
114
111
|
|
115
|
-
command_line = [
|
116
|
-
|
117
|
-
|
118
|
-
|
112
|
+
command_line = [
|
113
|
+
@command,
|
114
|
+
"--app-name", title,
|
115
|
+
"--expire-time", expire_time.to_s,
|
116
|
+
"--urgency", urgency,
|
117
|
+
]
|
119
118
|
command_line.concat(["--icon", icon.to_s]) if icon
|
120
119
|
command_line << title
|
121
120
|
command_line << message
|
@@ -135,9 +134,11 @@ module Test
|
|
135
134
|
message = parameters[:message]
|
136
135
|
image = parameters[:icon]
|
137
136
|
|
138
|
-
command_line = [
|
139
|
-
|
140
|
-
|
137
|
+
command_line = [
|
138
|
+
@command,
|
139
|
+
"--priority", priority,
|
140
|
+
"--message", message,
|
141
|
+
]
|
141
142
|
command_line.concat(["--image", image.to_s]) if image
|
142
143
|
command_line << title
|
143
144
|
system(*command_line)
|
@@ -156,9 +157,33 @@ module Test
|
|
156
157
|
end
|
157
158
|
end
|
158
159
|
|
160
|
+
# @private
|
161
|
+
class GrowlnotifyForWindows < NotifyCommand
|
162
|
+
def initialize
|
163
|
+
@command = "growlnotify.exe"
|
164
|
+
end
|
165
|
+
|
166
|
+
URGENCIES = {
|
167
|
+
"critical" => 2,
|
168
|
+
}
|
169
|
+
|
170
|
+
URGENCIES.default = 0
|
171
|
+
|
172
|
+
def run(parameters)
|
173
|
+
priority = URGENCIES[parameters[:urgency]]
|
174
|
+
title = parameters[:title]
|
175
|
+
message = parameters[:message]
|
176
|
+
image = parameters[:icon]
|
177
|
+
command_line = [@command, "/t:#{title}", "/p:#{priority}"]
|
178
|
+
command_line << "/i:#{image.to_s}" if image
|
179
|
+
command_line << message
|
180
|
+
system(*command_line)
|
181
|
+
end
|
182
|
+
end
|
183
|
+
|
159
184
|
class Notifier
|
160
185
|
class << self
|
161
|
-
# @return [Boolean] return
|
186
|
+
# @return [Boolean] return `true` if test result notification
|
162
187
|
# is available.
|
163
188
|
def available?
|
164
189
|
not command.nil?
|
@@ -171,7 +196,7 @@ module Test
|
|
171
196
|
|
172
197
|
# @private
|
173
198
|
def commands
|
174
|
-
[NotifySend.new, Growlnotify.new]
|
199
|
+
[NotifySend.new, Growlnotify.new, GrowlnotifyForWindows.new]
|
175
200
|
end
|
176
201
|
end
|
177
202
|
|
@@ -202,9 +227,11 @@ module Test
|
|
202
227
|
command = self.class.command
|
203
228
|
return if command.nil?
|
204
229
|
|
205
|
-
title = "%s [%g%%] (%gs)" % [
|
206
|
-
|
207
|
-
|
230
|
+
title = "%s [%g%%] (%gs)" % [
|
231
|
+
@result.status,
|
232
|
+
@result.pass_percentage,
|
233
|
+
elapsed_time,
|
234
|
+
]
|
208
235
|
parameters = {
|
209
236
|
:expire_time => 5,
|
210
237
|
:icon => guess_suitable_icon,
|
metadata
CHANGED
@@ -1,169 +1,148 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: test-unit-notify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Kouhei Sutou
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-07-13 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: test-unit
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 2.4.9
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 2.4.9
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: bundler
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: rake
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - ">="
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: yard
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - ">="
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '0'
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - ">="
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '0'
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: packnga
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - ">="
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: '0'
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
80
|
+
- - ">="
|
92
81
|
- !ruby/object:Gem::Version
|
93
82
|
version: '0'
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
|
-
name:
|
84
|
+
name: kramdown
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
|
-
- -
|
87
|
+
- - ">="
|
100
88
|
- !ruby/object:Gem::Version
|
101
89
|
version: '0'
|
102
90
|
type: :development
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
|
-
- -
|
94
|
+
- - ">="
|
108
95
|
- !ruby/object:Gem::Version
|
109
96
|
version: '0'
|
110
|
-
description:
|
111
|
-
|
97
|
+
description: |
|
98
|
+
A test result notify extension for test-unit.
|
112
99
|
This provides test result notification support.
|
113
|
-
|
114
|
-
'
|
115
100
|
email:
|
116
101
|
- kou@clear-code.com
|
117
102
|
executables: []
|
118
103
|
extensions: []
|
119
104
|
extra_rdoc_files: []
|
120
105
|
files:
|
121
|
-
-
|
122
|
-
- Rakefile
|
106
|
+
- ".yardopts"
|
123
107
|
- Gemfile
|
124
|
-
- .
|
125
|
-
-
|
126
|
-
- data/icons/kinotan/pending.png
|
127
|
-
- data/icons/kinotan/omission.png
|
108
|
+
- README.md
|
109
|
+
- Rakefile
|
128
110
|
- data/icons/kinotan/default.png
|
129
111
|
- data/icons/kinotan/error.png
|
112
|
+
- data/icons/kinotan/failure.png
|
113
|
+
- data/icons/kinotan/omission.png
|
130
114
|
- data/icons/kinotan/pass.png
|
131
|
-
-
|
132
|
-
- screenshot/notify-on-gnome.png
|
133
|
-
- lib/test/unit/notify.rb
|
134
|
-
- lib/test-unit-notify.rb
|
115
|
+
- data/icons/kinotan/pending.png
|
135
116
|
- doc/text/lgpl.txt
|
136
|
-
- doc/text/news.
|
137
|
-
|
117
|
+
- doc/text/news.md
|
118
|
+
- lib/test-unit-notify.rb
|
119
|
+
- lib/test/unit/notify.rb
|
120
|
+
- lib/test/unit/notify/version.rb
|
121
|
+
- screenshot/notify-on-gnome.png
|
122
|
+
- screenshot/notify-on-mac-os-x.png
|
123
|
+
homepage: https://github.com/test-unit/test-unit-notify
|
138
124
|
licenses:
|
139
125
|
- LGPLv2.1 or later
|
126
|
+
metadata: {}
|
140
127
|
post_install_message:
|
141
128
|
rdoc_options: []
|
142
129
|
require_paths:
|
143
130
|
- lib
|
144
131
|
required_ruby_version: !ruby/object:Gem::Requirement
|
145
|
-
none: false
|
146
132
|
requirements:
|
147
|
-
- -
|
133
|
+
- - ">="
|
148
134
|
- !ruby/object:Gem::Version
|
149
135
|
version: '0'
|
150
|
-
segments:
|
151
|
-
- 0
|
152
|
-
hash: 3021372341095621153
|
153
136
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
154
|
-
none: false
|
155
137
|
requirements:
|
156
|
-
- -
|
138
|
+
- - ">="
|
157
139
|
- !ruby/object:Gem::Version
|
158
140
|
version: '0'
|
159
|
-
segments:
|
160
|
-
- 0
|
161
|
-
hash: 3021372341095621153
|
162
141
|
requirements: []
|
163
|
-
rubyforge_project:
|
164
|
-
rubygems_version:
|
142
|
+
rubyforge_project:
|
143
|
+
rubygems_version: 2.2.2
|
165
144
|
signing_key:
|
166
|
-
specification_version:
|
167
|
-
summary: A test result notify extension for
|
145
|
+
specification_version: 4
|
146
|
+
summary: A test result notify extension for test-unit.
|
168
147
|
test_files: []
|
169
148
|
has_rdoc:
|
data/README.textile
DELETED
@@ -1,43 +0,0 @@
|
|
1
|
-
h1. Test::Unit::Notify
|
2
|
-
|
3
|
-
"Homepage":http://rubyforge.org/projects/test-unit/
|
4
|
-
|
5
|
-
h2. DESCRIPTION
|
6
|
-
|
7
|
-
test-unit-notify - A test result notify extension for Test::Unit.
|
8
|
-
|
9
|
-
h2. FEATURES
|
10
|
-
|
11
|
-
* This provides test result notification support.
|
12
|
-
|
13
|
-
h2. INSTALL
|
14
|
-
|
15
|
-
<pre>
|
16
|
-
% sudo gem install test-unit-notify
|
17
|
-
</pre>
|
18
|
-
|
19
|
-
h2. USAGE
|
20
|
-
|
21
|
-
<pre>
|
22
|
-
require 'test/unit/notify'
|
23
|
-
</pre>
|
24
|
-
|
25
|
-
It adds '--notify' to command line option.
|
26
|
-
|
27
|
-
<pre>
|
28
|
-
% ruby test/test_my_class.rb --notify
|
29
|
-
</pre>
|
30
|
-
|
31
|
-
See screenshot/notify-on-gnome.png for example on GNOME.
|
32
|
-
|
33
|
-
h2. LICENSE
|
34
|
-
|
35
|
-
LGPLv2.1 or later. See doc/text/lgpl.txt for details.
|
36
|
-
|
37
|
-
(Kouhei Sutou has a right to change the license including
|
38
|
-
contributed patches.)
|
39
|
-
|
40
|
-
h2. AUTHORS
|
41
|
-
|
42
|
-
* Kouhei Sutou: program
|
43
|
-
* Mayu & Co.: kinotan icons: http://cocooooooon.com/kinotan/
|
data/doc/text/news.textile
DELETED
@@ -1,52 +0,0 @@
|
|
1
|
-
h1. News
|
2
|
-
|
3
|
-
h2(#1-0-1). 1.0.1 - 2013-04-02
|
4
|
-
|
5
|
-
h3. Changes
|
6
|
-
|
7
|
-
* Renamed COPYING to lgpl.
|
8
|
-
|
9
|
-
h3. Fixes
|
10
|
-
|
11
|
-
* Added missing files to the gem package.
|
12
|
-
|
13
|
-
h2(#1-0-0). 1.0.0 - 2013-03-28
|
14
|
-
|
15
|
-
h3. Improvements
|
16
|
-
|
17
|
-
* Stopped to register auto test run.
|
18
|
-
* Added application name to notification.
|
19
|
-
* Removed warnings.
|
20
|
-
|
21
|
-
h2(#0-3-0). 0.3.0 - 2011-04-15
|
22
|
-
|
23
|
-
h3. Improvements
|
24
|
-
|
25
|
-
* Added kinotan for omission. [Mayu & Co.]
|
26
|
-
* Added kinotan for error. [Mayu & Co.]
|
27
|
-
|
28
|
-
h2(#0-2-1). 0.2.1 - 2011-02-10
|
29
|
-
|
30
|
-
h3. Improvements
|
31
|
-
|
32
|
-
* Supported Ruby 1.9.
|
33
|
-
|
34
|
-
h2(#0-2-0). 0.2.0 - 2011-02-10
|
35
|
-
|
36
|
-
h3. Improvements
|
37
|
-
|
38
|
-
* Supported Mac OS X by growlnotify.
|
39
|
-
|
40
|
-
h2(#0-1-0). 0.1.0 - 2010-11-25
|
41
|
-
|
42
|
-
h3. Improvements
|
43
|
-
|
44
|
-
* Added Test::Unit::Notify.enable=.
|
45
|
-
|
46
|
-
h3. Changes
|
47
|
-
|
48
|
-
* Changed license: Ruby's -> LGPLv2 or later.
|
49
|
-
|
50
|
-
h2(#0-0-1). 0.0.1 - 2010-07-17
|
51
|
-
|
52
|
-
Birthday!
|