stapfen 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/CHANGES.md +3 -0
- data/Gemfile +0 -1
- data/lib/stapfen/version.rb +1 -1
- data/lib/stapfen/worker.rb +1 -1
- data/spec/worker_spec.rb +18 -6
- metadata +5 -14
- data/Guardfile +0 -9
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZmQzNmFhNTgxODI5ZTM1ZTQ4NTJkYzg4NTRhNmY5N2ZlOGZjMWM4OQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
OTQ0OGI2NjE5MmY3ZDAyMzU0Yzc2M2IyYjljNGE0NDNjYjUzMTkzYg==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
N2U5NDc0Y2UxOGNkZjY1NDcxMzg2ZDM5ZTg5NjMyZDY2YjkxYmFlMmZlNzQw
|
10
|
+
MDA1OThiOTYxZDBiZDU3N2MyY2FhZWEzMGQxYTQ4NTY1NzE1OWJiMGQxZTg4
|
11
|
+
ZDU1ODUyZTI4ZmEwMTE4MzIyOTg4ZjcwMDZmMTIxZTJhMGU2OGQ=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
ODg5Y2EzMjBmNDY5MjI3NmI5Mzg0N2VlMjIyNDk5MGFkNzg0ZTVmMzk1MTEy
|
14
|
+
ZDI3MjRmNTgxNjFiMmU1NWI3NmQ0YjkzODQ4MWRiN2ViYjczNzdmNGU2ZmIy
|
15
|
+
NjEyYTZlZmJlODhmZTJlNDMyOTE0NDE2NTQ4MTdjZWJkY2U0MzA=
|
data/CHANGES.md
CHANGED
data/Gemfile
CHANGED
data/lib/stapfen/version.rb
CHANGED
data/lib/stapfen/worker.rb
CHANGED
@@ -173,7 +173,7 @@ module Stapfen
|
|
173
173
|
self.class.consumers.each do |name, headers, block|
|
174
174
|
unreceive_headers = {}
|
175
175
|
[:max_redeliveries, :dead_letter_queue].each do |sym|
|
176
|
-
unreceive_headers[sym] = headers
|
176
|
+
unreceive_headers[sym] = headers[sym] if headers.has_key? sym
|
177
177
|
end
|
178
178
|
|
179
179
|
# We're taking each block and turning it into a method so that we can
|
data/spec/worker_spec.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'spec_helper'
|
2
|
-
|
2
|
+
require 'stapfen/client/stomp'
|
3
3
|
|
4
4
|
describe Stapfen::Worker do
|
5
5
|
subject(:worker) { described_class.new }
|
@@ -114,10 +114,12 @@ describe Stapfen::Worker do
|
|
114
114
|
end
|
115
115
|
|
116
116
|
describe 'consume' do
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
117
|
+
context 'if no block is passed' do
|
118
|
+
it 'should raise an error if no block is passed' do
|
119
|
+
expect {
|
120
|
+
worker.consume 'jms.queue.lol'
|
121
|
+
}.to raise_error(Stapfen::ConsumeError)
|
122
|
+
end
|
121
123
|
end
|
122
124
|
|
123
125
|
context 'with just a queue name' do
|
@@ -140,6 +142,7 @@ describe Stapfen::Worker do
|
|
140
142
|
c.stub(:connect)
|
141
143
|
c.stub(:can_unreceive? => true)
|
142
144
|
c.stub(:runloop)
|
145
|
+
c.stub(:unreceive)
|
143
146
|
c
|
144
147
|
end
|
145
148
|
|
@@ -150,10 +153,12 @@ describe Stapfen::Worker do
|
|
150
153
|
m
|
151
154
|
end
|
152
155
|
|
153
|
-
|
154
156
|
before :each do
|
155
157
|
Stapfen::Client::Stomp.stub(:new).and_return(client)
|
156
158
|
|
159
|
+
# Clear any old consumers out
|
160
|
+
worker.consumers = []
|
161
|
+
|
157
162
|
# Get a subscription? Call the message handler block.
|
158
163
|
client.stub(:subscribe) do |name, headers, &block|
|
159
164
|
block.call(message)
|
@@ -198,6 +203,13 @@ describe Stapfen::Worker do
|
|
198
203
|
worker.consume(name, raw_headers) {|msg| false }
|
199
204
|
worker.new.run
|
200
205
|
end
|
206
|
+
it 'should not remove the unreceive headers from the consumer' do
|
207
|
+
worker.consume(name, raw_headers) {|msg| false}
|
208
|
+
worker.new.run
|
209
|
+
|
210
|
+
expect(worker.consumers.last[1][:dead_letter_queue]).to eql unrec_headers[:dead_letter_queue]
|
211
|
+
expect(worker.consumers.last[1][:max_redeliveries]).to eql unrec_headers[:max_redeliveries]
|
212
|
+
end
|
201
213
|
end
|
202
214
|
context 'on a successfully handled message' do
|
203
215
|
it 'should not unreceive' do
|
metadata
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stapfen
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
5
|
-
prerelease:
|
4
|
+
version: 2.0.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- R. Tyler Croy
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date: 2013-
|
11
|
+
date: 2013-11-12 00:00:00.000000000 Z
|
13
12
|
dependencies: []
|
14
13
|
description: A simple gem for writing good basic STOMP workers
|
15
14
|
email:
|
@@ -21,7 +20,6 @@ files:
|
|
21
20
|
- .gitignore
|
22
21
|
- CHANGES.md
|
23
22
|
- Gemfile
|
24
|
-
- Guardfile
|
25
23
|
- LICENSE.txt
|
26
24
|
- README.md
|
27
25
|
- Rakefile
|
@@ -46,33 +44,26 @@ files:
|
|
46
44
|
- stapfen.gemspec
|
47
45
|
homepage: ''
|
48
46
|
licenses: []
|
47
|
+
metadata: {}
|
49
48
|
post_install_message:
|
50
49
|
rdoc_options: []
|
51
50
|
require_paths:
|
52
51
|
- lib
|
53
52
|
required_ruby_version: !ruby/object:Gem::Requirement
|
54
|
-
none: false
|
55
53
|
requirements:
|
56
54
|
- - ! '>='
|
57
55
|
- !ruby/object:Gem::Version
|
58
56
|
version: '0'
|
59
|
-
segments:
|
60
|
-
- 0
|
61
|
-
hash: -1242747643436314961
|
62
57
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
63
|
-
none: false
|
64
58
|
requirements:
|
65
59
|
- - ! '>='
|
66
60
|
- !ruby/object:Gem::Version
|
67
61
|
version: '0'
|
68
|
-
segments:
|
69
|
-
- 0
|
70
|
-
hash: -1242747643436314961
|
71
62
|
requirements: []
|
72
63
|
rubyforge_project:
|
73
|
-
rubygems_version: 1.
|
64
|
+
rubygems_version: 2.1.10
|
74
65
|
signing_key:
|
75
|
-
specification_version:
|
66
|
+
specification_version: 4
|
76
67
|
summary: A simple gem for writing good basic STOMP workers
|
77
68
|
test_files:
|
78
69
|
- spec/client/jms_spec.rb
|