oni 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -7
- data/doc/changelog.md +5 -0
- data/lib/oni/daemon.rb +8 -3
- data/lib/oni/version.rb +1 -1
- data/spec/oni/daemon_spec.rb +14 -0
- metadata +116 -76
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
|
-
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
Y2EyNTdkYTM0ZmE1MmExMzVhNDNmNjNiNjdjM2ViMTEyYmM5ZWZkYQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YzRlODYyZTdmNjI5YThkNjBkY2ZkN2ZkMTU5NTg0OTc2ODVmMTdkZg==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
N2FjOWI4YmQ2NzQ2ZWM1OTYwMTJjMjE3ZDBhNjNjYmFjZDlkNzQ3MzQxZDQ1
|
10
|
+
Y2QzMDc1YzVmMjRkMDU4MWIwNmRhNmVmYjgxNmQ4OTJkYTFjMWMxMDFlZTM4
|
11
|
+
MmNlMTFkZGY3NTE1YmZkNmJkZWY4YjE4ZWU2NTNkOTMxMGRkMTg=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
NDRiODhjYmIwNzRlMTIzZWY2MGJiY2IxYTVjYjViMmZhMDA3YTFhNGYzN2Fm
|
14
|
+
NjNhYzMyMGM0NDIzYzFlNjAwMDk0ZDE0MWY1NzU4YjZiMGFmMjMxYmYzYmNm
|
15
|
+
ZmQ2YTVlOGE3OTJmZTQwMjk3YzAyNDNiMzZlYTdhNjg4MTVhZWU=
|
data/doc/changelog.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
# @title Changelog
|
2
2
|
# Changelog
|
3
3
|
|
4
|
+
## 2.0.1 - December 17th, 2013
|
5
|
+
|
6
|
+
* Fixed a bug where the complete() callback would be executed upon worker
|
7
|
+
failures.
|
8
|
+
|
4
9
|
## 2.0.0 - December 16th, 2013
|
5
10
|
|
6
11
|
* Error callbacks now take an optional argument that contains extra error data
|
data/lib/oni/daemon.rb
CHANGED
@@ -87,13 +87,17 @@ module Oni
|
|
87
87
|
output = run_worker(message)
|
88
88
|
end
|
89
89
|
|
90
|
-
complete(message, output, timings)
|
90
|
+
complete(message, output, timings) unless output == false
|
91
91
|
end
|
92
92
|
|
93
93
|
##
|
94
94
|
# Maps the input, runs the worker and then maps the output into something
|
95
95
|
# that the daemon can understand.
|
96
96
|
#
|
97
|
+
# If the worker's `process` method raises an error `false` is returned and
|
98
|
+
# the `complete` callback is skipped, otherwise the remapped output is
|
99
|
+
# returned.
|
100
|
+
#
|
97
101
|
# @param [Mixed] message
|
98
102
|
# @return [Mixed]
|
99
103
|
#
|
@@ -101,14 +105,15 @@ module Oni
|
|
101
105
|
mapper = create_mapper
|
102
106
|
input = mapper.map_input(message)
|
103
107
|
worker = option(:worker).new(*input)
|
108
|
+
output = false
|
104
109
|
|
105
110
|
begin
|
106
|
-
output = worker.process
|
111
|
+
output = mapper.map_output(worker.process)
|
107
112
|
rescue => error
|
108
113
|
error(error, worker.extra_error_data)
|
109
114
|
end
|
110
115
|
|
111
|
-
return
|
116
|
+
return output
|
112
117
|
end
|
113
118
|
|
114
119
|
##
|
data/lib/oni/version.rb
CHANGED
data/spec/oni/daemon_spec.rb
CHANGED
@@ -170,5 +170,19 @@ describe Oni::Daemon do
|
|
170
170
|
|
171
171
|
block.should raise_error(RuntimeError, 'example: 10')
|
172
172
|
end
|
173
|
+
|
174
|
+
example 'skip the complete() callback upon failure' do
|
175
|
+
instance = example_daemon.new
|
176
|
+
|
177
|
+
instance.option(:worker).any_instance.stub(:process) { raise 'boom' }
|
178
|
+
|
179
|
+
block = lambda { instance.process(:number => 10) }
|
180
|
+
|
181
|
+
# The complete() callback should be skipped.
|
182
|
+
instance.should_not receive(:complete)
|
183
|
+
|
184
|
+
# Regular error handling should *not* be skipped.
|
185
|
+
block.should raise_error(RuntimeError, 'boom: 10')
|
186
|
+
end
|
173
187
|
end
|
174
188
|
end
|
metadata
CHANGED
@@ -1,93 +1,134 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: oni
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
|
-
authors:
|
6
|
+
authors:
|
7
7
|
- Yorick Peterse
|
8
8
|
- Wilco van Duinkerken
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2013-12-17 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
16
15
|
name: rake
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
- !ruby/object:Gem::Version
|
23
|
-
version: "0"
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ! '>='
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0'
|
24
21
|
type: :development
|
25
|
-
version_requirements: *id001
|
26
|
-
- !ruby/object:Gem::Dependency
|
27
|
-
name: bundler
|
28
22
|
prerelease: false
|
29
|
-
|
30
|
-
requirements:
|
31
|
-
-
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ! '>='
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: bundler
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ! '>='
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
32
35
|
type: :development
|
33
|
-
version_requirements: *id003
|
34
|
-
- !ruby/object:Gem::Dependency
|
35
|
-
name: rspec
|
36
36
|
prerelease: false
|
37
|
-
|
38
|
-
requirements:
|
39
|
-
-
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ! '>='
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: rspec
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ! '>='
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
40
49
|
type: :development
|
41
|
-
version_requirements: *id004
|
42
|
-
- !ruby/object:Gem::Dependency
|
43
|
-
name: yard
|
44
50
|
prerelease: false
|
45
|
-
|
46
|
-
requirements:
|
47
|
-
-
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: yard
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ! '>='
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '0'
|
48
63
|
type: :development
|
49
|
-
version_requirements: *id005
|
50
|
-
- !ruby/object:Gem::Dependency
|
51
|
-
name: simplecov
|
52
64
|
prerelease: false
|
53
|
-
|
54
|
-
requirements:
|
55
|
-
-
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: simplecov
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ! '>='
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
56
77
|
type: :development
|
57
|
-
version_requirements: *id006
|
58
|
-
- !ruby/object:Gem::Dependency
|
59
|
-
name: kramdown
|
60
78
|
prerelease: false
|
61
|
-
|
62
|
-
requirements:
|
63
|
-
-
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ! '>='
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: kramdown
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - ! '>='
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '0'
|
64
91
|
type: :development
|
65
|
-
version_requirements: *id007
|
66
|
-
- !ruby/object:Gem::Dependency
|
67
|
-
name: ci_reporter
|
68
92
|
prerelease: false
|
69
|
-
|
70
|
-
requirements:
|
71
|
-
-
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ! '>='
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: ci_reporter
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ! '>='
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
72
105
|
type: :development
|
73
|
-
version_requirements: *id008
|
74
|
-
- !ruby/object:Gem::Dependency
|
75
|
-
name: aws-sdk
|
76
106
|
prerelease: false
|
77
|
-
|
78
|
-
requirements:
|
79
|
-
-
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ! '>='
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: aws-sdk
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ! '>='
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
80
119
|
type: :development
|
81
|
-
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
82
126
|
description: Framework for building concurrent daemons in Ruby.
|
83
127
|
email:
|
84
128
|
executables: []
|
85
|
-
|
86
129
|
extensions: []
|
87
|
-
|
88
130
|
extra_rdoc_files: []
|
89
|
-
|
90
|
-
files:
|
131
|
+
files:
|
91
132
|
- .gitignore
|
92
133
|
- .travis.yml
|
93
134
|
- .yardopts
|
@@ -120,31 +161,30 @@ files:
|
|
120
161
|
- task/tag.rake
|
121
162
|
- task/test.rake
|
122
163
|
homepage:
|
123
|
-
licenses:
|
164
|
+
licenses:
|
124
165
|
- MIT
|
125
166
|
metadata: {}
|
126
|
-
|
127
167
|
post_install_message:
|
128
168
|
rdoc_options: []
|
129
|
-
|
130
|
-
require_paths:
|
169
|
+
require_paths:
|
131
170
|
- lib
|
132
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
133
|
-
requirements:
|
134
|
-
- -
|
135
|
-
- !ruby/object:Gem::Version
|
171
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
172
|
+
requirements:
|
173
|
+
- - ! '>='
|
174
|
+
- !ruby/object:Gem::Version
|
136
175
|
version: 1.9.3
|
137
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
138
|
-
requirements:
|
139
|
-
-
|
176
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ! '>='
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
140
181
|
requirements: []
|
141
|
-
|
142
182
|
rubyforge_project:
|
143
|
-
rubygems_version: 2.1.
|
183
|
+
rubygems_version: 2.1.2
|
144
184
|
signing_key:
|
145
185
|
specification_version: 4
|
146
186
|
summary: Framework for building concurrent daemons in Ruby.
|
147
|
-
test_files:
|
187
|
+
test_files:
|
148
188
|
- spec/oni/configurable_spec.rb
|
149
189
|
- spec/oni/daemon_spec.rb
|
150
190
|
- spec/oni/daemons/sqs_spec.rb
|