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 CHANGED
@@ -1,7 +1,15 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 2a436542360d389809d0b76b7108599fbb75bfe1
4
- data.tar.gz: 778e26a13382c6f4fe71acbaeff5f1a6b3c76b99
5
- SHA512:
6
- metadata.gz: e6bd9b3db19847a9b3c52cc16e59d373290a74a2ba5c07c07004c7adb5ee9e24dbbfde99c3ccda1871591264f79e5c94634796624547f06a1749bed472673e92
7
- data.tar.gz: 665c8b07e6728aa0aee95f869338d9a910b96e5b9cfa1f313a027f0c2077c3e97e36c33077750991a208506efd4a74768d57ed571f9c4381e798abb425875cbb
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 mapper.map_output(output)
116
+ return output
112
117
  end
113
118
 
114
119
  ##
data/lib/oni/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Oni
2
- VERSION = '2.0.0'
2
+ VERSION = '2.0.1'
3
3
  end # Oni
@@ -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.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
- date: 2013-12-16 00:00:00 Z
14
- dependencies:
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
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
19
- requirements:
20
- - &id002
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
- requirement: &id003 !ruby/object:Gem::Requirement
30
- requirements:
31
- - *id002
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
- requirement: &id004 !ruby/object:Gem::Requirement
38
- requirements:
39
- - *id002
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
- requirement: &id005 !ruby/object:Gem::Requirement
46
- requirements:
47
- - *id002
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
- requirement: &id006 !ruby/object:Gem::Requirement
54
- requirements:
55
- - *id002
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
- requirement: &id007 !ruby/object:Gem::Requirement
62
- requirements:
63
- - *id002
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
- requirement: &id008 !ruby/object:Gem::Requirement
70
- requirements:
71
- - *id002
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
- requirement: &id009 !ruby/object:Gem::Requirement
78
- requirements:
79
- - *id002
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
- version_requirements: *id009
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
- - *id002
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.10
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