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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e324322322648ba36831d902f95d7ab0b81fade2
4
- data.tar.gz: bfbc4583e291eff55a6c2b49ef939559ccbcc5f6
3
+ metadata.gz: 875fa3769a4986196e033217a87b72f0decd5ae0
4
+ data.tar.gz: 3b508c34cf4ef0581d92e5a4d685630c4b0ff61b
5
5
  SHA512:
6
- metadata.gz: 32c6eca3bd7315af7b16c8ac9934b95b8d8918b7b0f764fbee42298fde27c7fae0ddc3aabdf40ddc76fb7ab21668a30b7a224bb68f8d12ccce65f94c9960db91
7
- data.tar.gz: 1dfc63a4f568b44bdd217e3168103f66a02c7c1739439728a64874d02c82e541996775b75ce0774c225aa23ec21e7eebf3931b6a8390a610100e1c4f4b65fd6d
6
+ metadata.gz: 13db4d5b1ff5c5ff2e0ff5531acf74d485086fbd8aaf8fc5a4f12db29e9d18f0c70fb68d1f35ce63da39ea42e77238911206cd6c250f27d364577357856530e1
7
+ data.tar.gz: d018628ca76ef82ede2f415ac659c005416020fc7a1811f72802df186372fee619791645c05d5b131fed30694c29b82faee4901e0aaeeaf1fc82b7028ceac777
@@ -8,7 +8,17 @@ module BunnyBurrow
8
8
  STATUS_SERVER_ERROR = 'server_error'
9
9
 
10
10
  class Base
11
- attr_accessor :rabbitmq_url, :rabbitmq_exchange, :logger, :log_prefix, :verify_peer, :timeout, :log_request, :log_response
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
 
@@ -1,3 +1,3 @@
1
1
  module BunnyBurrow
2
- VERSION = '1.3.0'
2
+ VERSION = '1.4.0'
3
3
  end
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.3.0
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-07-08 00:00:00.000000000 Z
11
+ date: 2016-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler