multiple_man 0.5.11 → 0.5.13
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/multiple_man/connection.rb +6 -2
- data/lib/multiple_man/version.rb +1 -1
- data/spec/connection_spec.rb +1 -1
- data/spec/routing_key_spec.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 10e7776ff5f12168fa8984908248adbfc9b5217c
|
4
|
+
data.tar.gz: 13d0b1dc30ebc18767f44c0289130878711291f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6bdb87677e72708e57454f741b437775b564e45ffc7f01d5de40843f0b8516e616007eae9ce3c8976cf3818ed3d8a750d90c6209eef36a3d209c45fc144c9af
|
7
|
+
data.tar.gz: f1518798dd88109dce33f893229171fb9e6bbae538a9097497c6d60cbf3271be17bc623ec621960c50c13fc58de49a0873c520976ae8a04dd58df5d84f2f55db
|
@@ -21,10 +21,14 @@ module MultipleMan
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def self.connect
|
24
|
-
channel =
|
24
|
+
channel = nil
|
25
|
+
connection = self.connection
|
26
|
+
@mutex.synchronize do
|
27
|
+
channel = connection.create_channel
|
28
|
+
end
|
25
29
|
yield new(channel) if block_given?
|
26
30
|
ensure
|
27
|
-
channel.close if channel
|
31
|
+
channel.close if channel && channel.open?
|
28
32
|
end
|
29
33
|
|
30
34
|
attr_reader :topic
|
data/lib/multiple_man/version.rb
CHANGED
data/spec/connection_spec.rb
CHANGED
@@ -3,7 +3,7 @@ require 'spec_helper'
|
|
3
3
|
describe MultipleMan::Connection do
|
4
4
|
|
5
5
|
let(:mock_bunny) { double(Bunny) }
|
6
|
-
let(:mock_channel) { double(Bunny::Channel, close: nil) }
|
6
|
+
let(:mock_channel) { double(Bunny::Channel, close: nil, open?: true, topic: nil) }
|
7
7
|
|
8
8
|
describe "connect" do
|
9
9
|
it "should open a connection and a channel" do
|
data/spec/routing_key_spec.rb
CHANGED
@@ -40,7 +40,7 @@ describe MultipleMan::RoutingKey do
|
|
40
40
|
end
|
41
41
|
|
42
42
|
describe "operation=" do
|
43
|
-
[:create, :update, :destroy, :"#"].each do |op|
|
43
|
+
[:create, :update, :destroy, :"#", "create"].each do |op|
|
44
44
|
it "should allow #{op}" do
|
45
45
|
rk = described_class.new(Object)
|
46
46
|
rk.operation = op
|
@@ -48,7 +48,7 @@ describe MultipleMan::RoutingKey do
|
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
-
["new", nil, ""
|
51
|
+
["new", nil, ""].each do |op|
|
52
52
|
it "should not allow #{op}" do
|
53
53
|
rk = described_class.new(Object)
|
54
54
|
expect { rk.operation = op }.to raise_error
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: multiple_man
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.13
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Brunner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-09-
|
11
|
+
date: 2014-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|