cucumber-notify 0.0.1 → 0.0.3
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/LICENSE.rdoc +1 -2
- data/README.md +3 -66
- data/README.rdoc +4 -38
- data/cucumber-notify.gemspec +7 -8
- data/lib/cucumber-notify.rb +1 -1
- data/lib/cucumber-notify/version.rb +1 -1
- metadata +13 -16
- data/lib/cucumber-notify/cucumber-notify.rb +0 -94
data/LICENSE.rdoc
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
== The MIT License
|
2
2
|
|
3
|
-
|
4
|
-
* Gem: Copyright (c) Pavel Argentov, 2012
|
3
|
+
Copyright (c) Pavel Argentov, 2012
|
5
4
|
|
6
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
7
6
|
a copy of this software and associated documentation files (the
|
data/README.md
CHANGED
@@ -1,68 +1,5 @@
|
|
1
|
-
#
|
1
|
+
# DEPRECATED!
|
2
2
|
|
3
|
-
This gem
|
4
|
-
<https://github.com/argent-smith/autotest-cucumber-notification/tree/gem>
|
3
|
+
This is now a meta-gem which is only delegating all functionality to ['autotest-cucumber-notification'][1] gem/module.
|
5
4
|
|
6
|
-
|
7
|
-
|
8
|
-
This is a module for autotest that will provide notification for the results of your Cucumber features.
|
9
|
-
|
10
|
-
## Requirements
|
11
|
-
|
12
|
-
1. Autotest (ZenTest) configured to run your Cucumber features
|
13
|
-
2. libnotify -- This module only works on linux with the libnotify package right now. I'll work on adding support for other notification frameworks in the future
|
14
|
-
|
15
|
-
## Using the gem
|
16
|
-
|
17
|
-
1. Install the gem:
|
18
|
-
|
19
|
-
```shell
|
20
|
-
$ gem install cucumber-notify
|
21
|
-
```
|
22
|
-
2. Edit your `.autotest` to include the module. If you downloaded it to your home folder, do something like this:
|
23
|
-
|
24
|
-
```ruby
|
25
|
-
require 'rubygems'
|
26
|
-
require 'cucumber-notify'
|
27
|
-
```
|
28
|
-
|
29
|
-
3. That's it. Just run Autotest with your Cucumber features like normal.
|
30
|
-
|
31
|
-
## Credits
|
32
|
-
|
33
|
-
The original code this gem is based upon is compiled by [Matt Buck](https://github.com/techpeace).
|
34
|
-
|
35
|
-
This is largely based on the work done by [carlosbrando](https://github.com/carlosbrando), and his work on
|
36
|
-
[the autotest-notification gem](https://github.com/carlosbrando/autotest-notification/tree/master),
|
37
|
-
many thanks to him.
|
38
|
-
|
39
|
-
The cool icons came from the [Buuf icon set](http://mattahan.deviantart.com/art/Buuf-37966044)
|
40
|
-
by [Paul Davey](http://mattahan.deviantart.com/).
|
41
|
-
|
42
|
-
## License
|
43
|
-
|
44
|
-
```
|
45
|
-
The MIT License
|
46
|
-
|
47
|
-
* Code: Copyright (c) Matt Buck, 2008 - 2012
|
48
|
-
* Gem: Copyright (c) Pavel Argentov, 2012
|
49
|
-
|
50
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
51
|
-
a copy of this software and associated documentation files (the
|
52
|
-
'Software'), to deal in the Software without restriction, including
|
53
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
54
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
55
|
-
permit persons to whom the Software is furnished to do so, subject to
|
56
|
-
the following conditions:
|
57
|
-
|
58
|
-
The above copyright notice and this permission notice shall be
|
59
|
-
included in all copies or substantial portions of the Software.
|
60
|
-
|
61
|
-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
62
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
63
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
64
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
65
|
-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
66
|
-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
67
|
-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
68
|
-
```
|
5
|
+
[1]: https://rubygems.org/gems/autotest-cucumber-notification
|
data/README.rdoc
CHANGED
@@ -1,40 +1,6 @@
|
|
1
|
-
=
|
1
|
+
= DEPRECATED!
|
2
2
|
|
3
|
-
This gem
|
4
|
-
|
3
|
+
This is now a meta-gem which is only delegating all functionality to
|
4
|
+
'autotest-cucumber-notification'
|
5
|
+
(https://rubygems.org/gems/autotest-cucumber-notification) gem/module.
|
5
6
|
|
6
|
-
The original code and documentation used in this gem can be found at https://github.com/techpeace/autotest-cucumber-notification
|
7
|
-
|
8
|
-
This is a module for autotest that will provide notification for the results of your Cucumber features.
|
9
|
-
|
10
|
-
== Requirements
|
11
|
-
|
12
|
-
1. Autotest (ZenTest) configured to run your Cucumber features
|
13
|
-
2. libnotify -- This module only works on linux with the libnotify package right now. I'll work on adding support for other notification frameworks in the future
|
14
|
-
|
15
|
-
== Using the gem
|
16
|
-
|
17
|
-
1. Install the gem:
|
18
|
-
|
19
|
-
$ gem install cucumber-notify
|
20
|
-
|
21
|
-
2. Edit your .autotest to include the module. If you downloaded it to your home folder, do something like this:
|
22
|
-
|
23
|
-
require 'rubygems'
|
24
|
-
require 'cucumber-notify'
|
25
|
-
|
26
|
-
3. That's it. Just run Autotest with your Cucumber features like normal.
|
27
|
-
|
28
|
-
== Credits
|
29
|
-
|
30
|
-
The original code this gem is based upon is compiled by Matt Buck,
|
31
|
-
https://github.com/techpeace
|
32
|
-
|
33
|
-
This is largely based on the work done by
|
34
|
-
carlosbrando, https://github.com/carlosbrando, and his work on
|
35
|
-
the autotest-notification gem,
|
36
|
-
https://github.com/carlosbrando/autotest-notification/tree/master,
|
37
|
-
many thanks to him.
|
38
|
-
|
39
|
-
The cool icons came from the Buuf icon set, http://mattahan.deviantart.com/art/Buuf-37966044
|
40
|
-
by Paul Davey http://mattahan.deviantart.com/ .
|
data/cucumber-notify.gemspec
CHANGED
@@ -5,11 +5,11 @@ require "cucumber-notify/version"
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = "cucumber-notify"
|
7
7
|
s.version = CucumberNotify::VERSION
|
8
|
-
s.authors = ["Pavel Argentov"
|
9
|
-
s.email = ["argentoff@gmail.com"
|
8
|
+
s.authors = ["Pavel Argentov"]
|
9
|
+
s.email = ["argentoff@gmail.com"]
|
10
10
|
s.homepage = "https://github.com/argent-smith/autotest-cucumber-notification/tree/gem"
|
11
|
-
s.summary = %q{
|
12
|
-
s.description = %q{This is a
|
11
|
+
s.summary = %q{DEPRECATED: use 'autotest-cucumber-notification' gem instead.}
|
12
|
+
s.description = %q{This is now a meta-gem which is only delegating all functionality to 'autotest-cucumber-notification' gem/module.}
|
13
13
|
|
14
14
|
s.extra_rdoc_files = [
|
15
15
|
"LICENSE.rdoc",
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
]
|
18
18
|
|
19
19
|
s.rdoc_options = [
|
20
|
-
'--title', '
|
20
|
+
'--title', 'DEPRECATED',
|
21
21
|
'--main', 'README.rdoc'
|
22
22
|
]
|
23
23
|
|
@@ -27,7 +27,6 @@ Gem::Specification.new do |s|
|
|
27
27
|
s.require_paths = ["lib"]
|
28
28
|
|
29
29
|
# specify any dependencies here; for example:
|
30
|
-
|
31
|
-
s.add_runtime_dependency "cucumber"
|
32
|
-
s.add_runtime_dependency "ZenTest"
|
30
|
+
s.add_development_dependency "gemcutter"
|
31
|
+
s.add_runtime_dependency "autotest-cucumber-notification"
|
33
32
|
end
|
data/lib/cucumber-notify.rb
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
require 'cucumber-notify/version'
|
2
|
-
require '
|
2
|
+
require 'autotest-cucumber-notification'
|
metadata
CHANGED
@@ -1,31 +1,30 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cucumber-notify
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Pavel Argentov
|
9
|
-
- Matt Buck
|
10
9
|
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date: 2012-01-
|
12
|
+
date: 2012-01-27 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
17
|
-
requirement: &
|
15
|
+
name: gemcutter
|
16
|
+
requirement: &342011050 !ruby/object:Gem::Requirement
|
18
17
|
none: false
|
19
18
|
requirements:
|
20
19
|
- - ! '>='
|
21
20
|
- !ruby/object:Gem::Version
|
22
21
|
version: '0'
|
23
|
-
type: :
|
22
|
+
type: :development
|
24
23
|
prerelease: false
|
25
|
-
version_requirements: *
|
24
|
+
version_requirements: *342011050
|
26
25
|
- !ruby/object:Gem::Dependency
|
27
|
-
name:
|
28
|
-
requirement: &
|
26
|
+
name: autotest-cucumber-notification
|
27
|
+
requirement: &342010830 !ruby/object:Gem::Requirement
|
29
28
|
none: false
|
30
29
|
requirements:
|
31
30
|
- - ! '>='
|
@@ -33,12 +32,11 @@ dependencies:
|
|
33
32
|
version: '0'
|
34
33
|
type: :runtime
|
35
34
|
prerelease: false
|
36
|
-
version_requirements: *
|
37
|
-
description: This is a
|
38
|
-
|
35
|
+
version_requirements: *342010830
|
36
|
+
description: This is now a meta-gem which is only delegating all functionality to
|
37
|
+
'autotest-cucumber-notification' gem/module.
|
39
38
|
email:
|
40
39
|
- argentoff@gmail.com
|
41
|
-
- github@matthewbuck.com
|
42
40
|
executables: []
|
43
41
|
extensions: []
|
44
42
|
extra_rdoc_files:
|
@@ -57,14 +55,13 @@ files:
|
|
57
55
|
- images/pending.png
|
58
56
|
- images/undefined.png
|
59
57
|
- lib/cucumber-notify.rb
|
60
|
-
- lib/cucumber-notify/cucumber-notify.rb
|
61
58
|
- lib/cucumber-notify/version.rb
|
62
59
|
homepage: https://github.com/argent-smith/autotest-cucumber-notification/tree/gem
|
63
60
|
licenses: []
|
64
61
|
post_install_message:
|
65
62
|
rdoc_options:
|
66
63
|
- --title
|
67
|
-
-
|
64
|
+
- DEPRECATED
|
68
65
|
- --main
|
69
66
|
- README.rdoc
|
70
67
|
require_paths:
|
@@ -86,6 +83,6 @@ rubyforge_project:
|
|
86
83
|
rubygems_version: 1.8.15
|
87
84
|
signing_key:
|
88
85
|
specification_version: 3
|
89
|
-
summary:
|
86
|
+
summary: ! 'DEPRECATED: use ''autotest-cucumber-notification'' gem instead.'
|
90
87
|
test_files: []
|
91
88
|
has_rdoc:
|
@@ -1,94 +0,0 @@
|
|
1
|
-
# Usage:: see README
|
2
|
-
module CucumberNotify
|
3
|
-
|
4
|
-
# Notifier configuration helpers and defaults.
|
5
|
-
class Config
|
6
|
-
|
7
|
-
class << self
|
8
|
-
attr_reader :images_directory
|
9
|
-
attr_accessor :success_image, :fail_image, :pending_image, :undefined_image, :expiration_in_seconds,
|
10
|
-
:failure, :success, :pending, :undefined, :fade_timeout
|
11
|
-
|
12
|
-
def images_directory=(path)
|
13
|
-
@images_directory = File.expand_path(path)
|
14
|
-
@success_image = "#{@images_directory}/pass.png"
|
15
|
-
@fail_image = "#{@images_directory}/fail.png"
|
16
|
-
@pending_image = "#{@images_directory}/pending.png"
|
17
|
-
@undefined_image = "#{@images_directory}/undefined.png"
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
self.images_directory = File.expand_path('../../images', File.dirname(__FILE__))
|
22
|
-
self.fade_timeout = 5000
|
23
|
-
self.failure = "Features Failure"
|
24
|
-
self.success = "Features Success"
|
25
|
-
self.pending = "Features Pending"
|
26
|
-
self.undefined = "Features Undefined"
|
27
|
-
|
28
|
-
end
|
29
|
-
|
30
|
-
Autotest.add_hook :ran_features do |at|
|
31
|
-
result = at.results.is_a?(String) ? at.results : at.results.to_s
|
32
|
-
|
33
|
-
if result
|
34
|
-
@scenarios = result[/(\d+) scenarios?/,1].to_i
|
35
|
-
@steps = result[/(\d+) steps?/,1].to_i
|
36
|
-
@scenario_stats = Hash.new
|
37
|
-
@step_stats = Hash.new
|
38
|
-
|
39
|
-
%w{ failed skipped passed pending undefined }.each do |x|
|
40
|
-
@scenario_stats.merge!({ "#{x}" => result[/\d+ scenarios?.*?(\d+) #{x}.*\)/,1].to_i })
|
41
|
-
@step_stats.merge!({ "#{x}" => result[/\d+ steps?.*?(\d+) #{x}.*\)/,1].to_i })
|
42
|
-
end
|
43
|
-
|
44
|
-
if @scenario_stats["failed"] > 0 || @step_stats["failed"] > 0
|
45
|
-
notify Config.failure, assemble_msg(@scenarios,@steps,@scenario_stats,@step_stats), Config.fail_image
|
46
|
-
elsif @scenario_stats["pending"] > 0 || @step_stats["pending"] > 0
|
47
|
-
notify Config.pending, assemble_msg(@scenarios,@steps,@scenario_stats,@step_stats), Config.pending_image
|
48
|
-
elsif @scenario_stats["undefined"] > 0 || @step_stats["undefined"] > 0
|
49
|
-
notify Config.undefined, assemble_msg(@scenarios,@steps,@scenario_stats,@step_stats), Config.undefined_image
|
50
|
-
elsif @scenario_stats["passed"] > 0 && @step_stats["passed"] > 0
|
51
|
-
notify Config.success, assemble_msg(@scenarios,@steps,@scenario_stats,@step_stats), Config.success_image
|
52
|
-
else
|
53
|
-
notify Config.failure, "Errors Ecountered", Config.fail_image
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
|
58
|
-
class << self
|
59
|
-
|
60
|
-
def notify(title, msg, img = Config.success_image)
|
61
|
-
system "notify-send -i #{img} '#{title}' '#{msg}' -t #{Config.fade_timeout}"
|
62
|
-
end
|
63
|
-
|
64
|
-
def pluralize(text, number)
|
65
|
-
"#{number} #{text}#{'s' if number != 1}"
|
66
|
-
end
|
67
|
-
|
68
|
-
def assemble_msg(scenarios, steps, scenario_stats = {}, step_stats = {})
|
69
|
-
msg = ""
|
70
|
-
if scenarios > 0
|
71
|
-
msg += "#{pluralize('scenario',scenarios)}"
|
72
|
-
msg += "\n#{stat_string(scenario_stats)}"
|
73
|
-
msg += "\n\n" if steps > 0
|
74
|
-
end
|
75
|
-
if steps > 0
|
76
|
-
msg += "#{pluralize('step',steps)}"
|
77
|
-
msg += "\n#{stat_string(step_stats)}"
|
78
|
-
end
|
79
|
-
return msg
|
80
|
-
end
|
81
|
-
|
82
|
-
def stat_string(hash)
|
83
|
-
stat_str = "("
|
84
|
-
hash.each do |key,value|
|
85
|
-
if value > 0
|
86
|
-
stat_str += "#{value} #{key},"
|
87
|
-
end
|
88
|
-
end
|
89
|
-
stat_str += ")"
|
90
|
-
stat_str.gsub!(",\)",")")
|
91
|
-
end
|
92
|
-
end
|
93
|
-
|
94
|
-
end
|