stapfen 2.0.1 → 2.0.2

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.
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
@@ -1,5 +1,8 @@
1
1
  # Changes to Stapfen
2
2
 
3
+ ## 2.0.2
4
+
5
+ * Fix for unreceive handling
3
6
 
4
7
  ## 2.0.1
5
8
 
data/Gemfile CHANGED
@@ -9,7 +9,6 @@ gem 'stomp', '>= 1.2.14'
9
9
  group :development do
10
10
  gem 'rake'
11
11
  gem 'rspec', '~> 2.11'
12
- gem 'guard-rspec'
13
12
  gem 'pry'
14
13
  gem 'debugger', :platform => :mri
15
14
  gem 'debugger-pry', :platform => :mri
@@ -1,3 +1,3 @@
1
1
  module Stapfen
2
- VERSION = '2.0.1'
2
+ VERSION = '2.0.2'
3
3
  end
@@ -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.delete(sym) if headers.has_key? sym
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
- it 'should raise an error if no block is passed' do
118
- expect {
119
- worker.consume 'jms.queue.lol'
120
- }.to raise_error(Stapfen::ConsumeError)
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.1
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-10-21 00:00:00.000000000 Z
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.8.25
64
+ rubygems_version: 2.1.10
74
65
  signing_key:
75
- specification_version: 3
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
data/Guardfile DELETED
@@ -1,9 +0,0 @@
1
- # A sample Guardfile
2
- # More info at https://github.com/guard/guard#readme
3
-
4
- guard 'rspec' do
5
- watch(%r{^spec/.+_spec\.rb$})
6
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
7
- watch('spec/spec_helper.rb') { "spec" }
8
- end
9
-