rabid_mq 0.1.22 → 0.1.23

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: 77316673580b1fcbcda3d34cc610a95a86871e49
4
- data.tar.gz: f391f7774af20723fbd251f2466f517fd60c6280
3
+ metadata.gz: 0e6d7f9a66f1021b62566a5d08c381c4f9e3e520
4
+ data.tar.gz: 99530c2af0769be39639e84f37cfa86d69aee0fd
5
5
  SHA512:
6
- metadata.gz: 19db599917191c3e3c9c9bcf5fb06c578eb337090095773e5c61e89a28ef539a925435107f3d6fdd48f9e3e30eb06ab608872bf80f8fe6c482147bee9e04987f
7
- data.tar.gz: 0dbfd307d0a9d91a91990c4722a38cd658d7d63bea6c090b2762609987da621df0d89c6e2ca53f53b085c2877f1dbee2c8bbcb5bb9a0fd46ba67704491c100bc
6
+ metadata.gz: ac00ddb153ac2b5b96cb0224e292b8275fdb97256d97c57b150f90356d12f97f5d821e2fefaffd0f372b8216eaf836cf6d879642bb9f51d4ebe910f3abf37209
7
+ data.tar.gz: 9c203b29c8ded1d89f90378430ca4053dca97733803f7a7fa2277e887e24a5c86ee8eefaf64f74ca162c86100ece39b69a7dac7fb2d03b9b11fa9725fd741c31
@@ -18,7 +18,7 @@ module RabidMQ
18
18
 
19
19
  included do
20
20
  class << self
21
- attr_reader :amqp_queue, :amqp_exchange
21
+ attr_reader :amqp_queue, :amqp_exchange, :routing_key
22
22
 
23
23
  def amqp(queue, exchange, exclusive: false, routing_key: '#')
24
24
  self.queue_name queue, exclusive: exclusive
@@ -43,14 +43,14 @@ module RabidMQ
43
43
  # end
44
44
  #
45
45
  def exchange(topic, **options)
46
- @amqp_exchange = RabidMQ.topic_exchange name_with_env(topic), options
46
+ @amqp_exchange = RabidMQ.topic_exchange name_with_env(topic), **options
47
47
  end
48
48
 
49
- def bind(exchange=@amqp_exchange, routing_key: @routing_key, **options)
49
+ def bind(exchange=amqp_exchange, routing_key: routing_key, **options)
50
50
  amqp_queue.bind(exchange, routing_key: routing_key, **options)
51
51
  end
52
52
 
53
- delegate :subscribe, to: :bind
53
+ delegate :subscribe, to: :amqp_queue
54
54
  delegate :channel, to: ::RabidMQ
55
55
  delegate :queue, to: :channel
56
56
  delegate :name_with_env, to: ::RabidMQ
@@ -18,7 +18,9 @@ module RabidMQ
18
18
  self.class.amqp_broadcast *args, **options
19
19
  end
20
20
 
21
- alias_method :broadcast, :amqp_broadcast
21
+ unless method_defined? :broadcast
22
+ alias_method :broadcast, :amqp_broadcast
23
+ end
22
24
 
23
25
  class << self
24
26
  def amqp_broadcast(topic, payload, routing_key: self.default_amqp_routing_key)
@@ -28,7 +30,9 @@ module RabidMQ
28
30
  Rails.logger.error e.message
29
31
  end
30
32
 
31
- alias_method :broadcast, :amqp_broadcast
33
+ unless method_defined? :broadcast
34
+ alias_method :broadcast, :amqp_broadcast
35
+ end
32
36
 
33
37
  def default_amqp_routing_key
34
38
  self.name.underscore.gsub(/\//, '.')
@@ -46,14 +50,14 @@ module RabidMQ
46
50
 
47
51
  # Get a channel with the Bunny::Session
48
52
  def channel
49
- @channel ||= connect.create_channel
53
+ @channel ||= amqp_connect.create_channel
50
54
  rescue Bunny::ChannelAlreadyClosed => e
51
55
  @channel = nil
52
56
  channel
53
57
  end
54
58
 
55
59
  # Start a new connection
56
- def connect
60
+ def amqp_connect
57
61
  connection.tap do |c|
58
62
  c.start
59
63
  end
@@ -1,3 +1,3 @@
1
1
  module RabidMQ
2
- VERSION = "0.1.22"
2
+ VERSION = "0.1.23"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rabid_mq
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.22
4
+ version: 0.1.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyrone Wilson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-02-13 00:00:00.000000000 Z
11
+ date: 2018-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny