evrone-common-amqp 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b7026b69a2227f3adc9eef4d6cfd39ff0ec764ce
|
4
|
+
data.tar.gz: 8811dd3fd48a5e75384d7491334e3ba7db904f8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03a5921a1d9b900c30a4448caef99e68c6ecbd508f23cbe4422bb6e7c185d680bad891d92b64102f29ae95f77d2934e9219229fee75ba0ee386f2669262cbefa
|
7
|
+
data.tar.gz: 90b0697c2a69f25e70e5719b500f66566c9ac41e6bc8101d8dc01d7ca08b2c104d94c060440869990ac3ba80467adc8b7760b1e1edcf4289b92a45e9cd0a1da1
|
@@ -29,6 +29,15 @@ module Evrone
|
|
29
29
|
@@classes
|
30
30
|
end
|
31
31
|
|
32
|
+
def consumer_name
|
33
|
+
@consumer_name ||= begin
|
34
|
+
id = Thread.current[:consumer_id]
|
35
|
+
name = self.class.consumer_name.dup
|
36
|
+
name << ".#{id}" if id
|
37
|
+
name
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
32
41
|
module ClassMethods
|
33
42
|
|
34
43
|
include Common::AMQP::Consumer::Configuration
|
@@ -29,8 +29,22 @@ describe Evrone::Common::AMQP::Consumer do
|
|
29
29
|
|
30
30
|
subject { consumer_class }
|
31
31
|
|
32
|
-
its(:consumer_name) { should eq 'evrone.test' }
|
33
32
|
its(:config) { should be_an_instance_of(Evrone::Common::AMQP::Config) }
|
33
|
+
its(:consumer_name) { should eq 'test_consumer' }
|
34
|
+
|
35
|
+
context "instance consumer_name" do
|
36
|
+
subject { consumer.consumer_name }
|
37
|
+
|
38
|
+
it { should eq 'test_consumer' }
|
39
|
+
|
40
|
+
context "when Thread.current has key :consumer_id" do
|
41
|
+
before do
|
42
|
+
mock(Thread.current).[](:consumer_id){ '99' }
|
43
|
+
end
|
44
|
+
it { should eq 'test_consumer.99' }
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
34
48
|
|
35
49
|
context "model" do
|
36
50
|
subject { consumer_class.model }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: evrone-common-amqp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitry Galinsky
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-10-
|
11
|
+
date: 2013-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|