bunny_burrow 1.3.0 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bunny_burrow/base.rb +16 -2
- data/lib/bunny_burrow/version.rb +1 -1
- 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: 875fa3769a4986196e033217a87b72f0decd5ae0
|
4
|
+
data.tar.gz: 3b508c34cf4ef0581d92e5a4d685630c4b0ff61b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 13db4d5b1ff5c5ff2e0ff5531acf74d485086fbd8aaf8fc5a4f12db29e9d18f0c70fb68d1f35ce63da39ea42e77238911206cd6c250f27d364577357856530e1
|
7
|
+
data.tar.gz: d018628ca76ef82ede2f415ac659c005416020fc7a1811f72802df186372fee619791645c05d5b131fed30694c29b82faee4901e0aaeeaf1fc82b7028ceac777
|
data/lib/bunny_burrow/base.rb
CHANGED
@@ -8,7 +8,17 @@ module BunnyBurrow
|
|
8
8
|
STATUS_SERVER_ERROR = 'server_error'
|
9
9
|
|
10
10
|
class Base
|
11
|
-
attr_accessor
|
11
|
+
attr_accessor(
|
12
|
+
:rabbitmq_url,
|
13
|
+
:rabbitmq_exchange,
|
14
|
+
:rabbitmq_connection,
|
15
|
+
:logger,
|
16
|
+
:log_prefix,
|
17
|
+
:verify_peer,
|
18
|
+
:timeout,
|
19
|
+
:log_request,
|
20
|
+
:log_response
|
21
|
+
)
|
12
22
|
|
13
23
|
alias_method :verify_peer?, :verify_peer
|
14
24
|
alias_method :log_request?, :log_request
|
@@ -19,15 +29,19 @@ module BunnyBurrow
|
|
19
29
|
@log_response = false
|
20
30
|
@timeout = 60
|
21
31
|
@verify_peer = true
|
32
|
+
@own_connection = true
|
22
33
|
|
23
34
|
yield self if block_given?
|
35
|
+
|
36
|
+
@connection = @rabbitmq_connection
|
37
|
+
@own_connection = @connection.nil?
|
24
38
|
end
|
25
39
|
|
26
40
|
def shutdown
|
27
41
|
return if @shutdown
|
28
42
|
log 'Shutting down'
|
29
43
|
channel.close
|
30
|
-
connection.close
|
44
|
+
connection.close if @own_connection
|
31
45
|
@shutdown = true
|
32
46
|
end
|
33
47
|
|
data/lib/bunny_burrow/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bunny_burrow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vericity
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-08-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|