superbolt 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2702ec5e662440bb59aeded52529c4561bf09574
4
- data.tar.gz: 07bdfbf076a3ef783d0b36c5f35a603e4c2a93bc
3
+ metadata.gz: 4c1ae682e276cb88e28fe0226a34506473ef92f0
4
+ data.tar.gz: 89c3df502b1f1a8de17d411686f40412fafdb670
5
5
  SHA512:
6
- metadata.gz: fac26fd38a33473b326f2fbb44fa831b9c1aeb9e1226160a315257ed160702d6b88d43e4831881cc01918f11a57681201ce5198cb39886dd5b96a04cbe7b575b
7
- data.tar.gz: 7f4881397075fc8dfdd726b46ccb4f2d13095ddb1e13eb0f222975a4a3ecfabafefe80c28cf7375cab8c8efa4a3e42814b907ee6f3a72b3e1c094f48bfddb852
6
+ metadata.gz: 2846d21f6ffd39d49f7e93eab88c24c5baca3bd02fb7bede0e33d4d40e8eb413cb23ba973af0385fe3deb56d2314d258274f2d44da9789f7db3206fe7c513493
7
+ data.tar.gz: 47c71f8a760809c45d308bd973da1a72e154cb0ce36d4c58f368f258f84b74308de066b52817e093e6eea6f7671712e052775096e2e431fc499088d9cd18b436
@@ -55,17 +55,12 @@ module Superbolt
55
55
  end
56
56
 
57
57
  def pop
58
- messages = []
59
58
  closing do
60
- popped = false
61
- q.subscribe(:ack => false) do |delivery_info, metadata, message|
62
- next if popped
63
- messages << IncomingMessage.new(delivery_info, message, channel)
64
- popped = true
59
+ q.pop do |delivery_info, metadata, message|
60
+ message = IncomingMessage.new(delivery_info, message, channel)
61
+ message && message.parse
65
62
  end
66
63
  end
67
- message = messages.first
68
- message && message.parse
69
64
  end
70
65
 
71
66
  delegate :slice, :[],
@@ -1,3 +1,3 @@
1
1
  module Superbolt
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -22,11 +22,13 @@ describe 'Superbolt::Queue' do
22
22
 
23
23
  describe 'queue/array operations' do
24
24
  let(:message) { {hello: 'insomniacs'} }
25
+ let(:message_two) { {:hello => 'early birds'} }
25
26
  let(:decoded) { {'hello' => 'insomniacs'} }
27
+ let(:decoded_two) { {'hello' => 'early birds'} }
26
28
 
27
29
  describe '#push' do
28
30
  let(:bunny_queue) {connection.queue(name, Superbolt::Queue.default_options)}
29
-
31
+
30
32
  it "writes to the queue" do
31
33
  queue.push(message)
32
34
  queue.size.should == 1
@@ -37,7 +39,7 @@ describe 'Superbolt::Queue' do
37
39
  it "returns the message but leaves it in the queue" do
38
40
  queue.push(message)
39
41
  queue.peek.should == decoded
40
- queue.size.should == 1
42
+ queue.size.should == 1
41
43
  end
42
44
  end
43
45
 
@@ -47,6 +49,14 @@ describe 'Superbolt::Queue' do
47
49
  queue.pop.should == decoded
48
50
  queue.size.should == 0
49
51
  end
52
+
53
+ it "leaves all other messages in the queue" do
54
+ queue.push(message)
55
+ queue.push(message_two)
56
+ queue.pop
57
+ queue.size.should == 1
58
+ queue.all.should include(decoded_two)
59
+ end
50
60
  end
51
61
 
52
62
  describe '#all' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: superbolt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - socialchorus
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-13 00:00:00.000000000 Z
11
+ date: 2013-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -154,7 +154,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  version: '0'
155
155
  requirements: []
156
156
  rubyforge_project:
157
- rubygems_version: 2.0.2
157
+ rubygems_version: 2.1.5
158
158
  signing_key:
159
159
  specification_version: 4
160
160
  summary: Superbolt is a gem that makes SOA intra-app communication easy, via RabbitMQ