rabid_mq 0.1.39 → 0.1.40

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: '080c3a46e2615ba189a132f330266e5b60a5cdbe'
4
- data.tar.gz: 895da7b737d2e4cbb4bb7e67a546db3b265faf7a
3
+ metadata.gz: 3c85eed9d974133e85c1b85b14a7143e309349bf
4
+ data.tar.gz: 3189d8915f37de7e45119233cc80064f9b70349e
5
5
  SHA512:
6
- metadata.gz: f6de899e7137bff79584f4584c014d5f3e3989db6c6950b7aa485dfd100cb85ea58aa1af225d7c242a63c40a46cd5ca434b0ac7fa73546529439703d5b5aee30
7
- data.tar.gz: 423fcefbfd3581f63218c138d2a4d367f12bc2b3ae657bab52ff4c32437bff9c1d2894467a7334f12407ce8847ef1f5bba817cf3a26a8190fb4ecdb3fa1d0b34
6
+ metadata.gz: 43f726bb7996a87febe539b9b56f65b986d75876f96dd30343022209d7eb3e7e2855627c5c00754169180f7ac790e2a8fa45a87c3f098d3f3e2bb31cb701fbbd
7
+ data.tar.gz: '01811de6d5f15dab82f1cc40ab7c85a7b0b9b5e6b95fc5ea3890ffb03f73fc5b9bfd2186c1715b7451f42c6023411a9087b73c6e6d0911e805725caa573018bb'
@@ -20,9 +20,9 @@ module RabidMQ
20
20
  class << self
21
21
  attr_reader :amqp_queue, :amqp_exchange, :routing_key
22
22
 
23
- def amqp(queue, exchange, exclusive: false, routing_key: '#')
24
- self.queue_name queue, exclusive: exclusive
25
- self.exchange(exchange)
23
+ def amqp(queue, exchange, exclusive: false, routing_key: '#', include_environment_name: true)
24
+ self.queue_name queue, exclusive: exclusive, include_environment_name: include_environment_name
25
+ self.exchange(exchange, include_environment_name: include_environment_name)
26
26
  @routing_key = routing_key
27
27
  amqp_queue.bind(amqp_exchange, routing_key: routing_key)
28
28
  end
@@ -33,8 +33,9 @@ module RabidMQ
33
33
  # queue_name 'some.queue_name', exclusive: true
34
34
  # end
35
35
  #
36
- def queue_name(name, **options)
37
- @amqp_queue = RabidMQ.channel.queue(name_with_env(name), **options)
36
+ def queue_name(name, include_environment_name: true, **options)
37
+ resolved_name = include_environment_name ? name_with_env(name) : name
38
+ @amqp_queue = RabidMQ.channel.queue(resolved_name, **options)
38
39
  end
39
40
 
40
41
  # Use this as a macro in including classes like
@@ -43,8 +44,9 @@ module RabidMQ
43
44
  # exchange 'exchange.name'
44
45
  # end
45
46
  #
46
- def exchange(topic, **options)
47
- @amqp_exchange = RabidMQ.topic_exchange name_with_env(topic), **options
47
+ def exchange(topic, include_environment_name: true, **options)
48
+ topic_name = include_environment_name ? name_with_env(topic) : topic
49
+ @amqp_exchange = RabidMQ.topic_exchange topic_name, **options
48
50
  end
49
51
 
50
52
  def bind(exchange=amqp_exchange, routing_key: @routing_key, **options)
@@ -43,13 +43,15 @@ module RabidMQ
43
43
  end
44
44
 
45
45
  # Provide a topic exchange on demand connected to the existing channel
46
- def topic_exchange(topic, **options)
47
- channel.topic(name_with_env(topic), **options)
46
+ def topic_exchange(topic, include_environment_name: true, **options)
47
+ topic_name = include_environment_name ? name_with_env(topic) : topic
48
+ channel.topic(topic_name, **options)
48
49
  end
49
50
 
50
51
  # Provide fanout exchange
51
- def fanout_exchange(topic, **options)
52
- channel.fanout(name_with_env(topic), **options)
52
+ def fanout_exchange(topic, include_environment_name: true, **options)
53
+ topic_name = include_environment_name ? name_with_env(topic) : topic
54
+ channel.fanout(topic_name, **options)
53
55
  end
54
56
 
55
57
  def channel
@@ -1,3 +1,3 @@
1
1
  module RabidMQ
2
- VERSION = "0.1.39"
2
+ VERSION = "0.1.40"
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.39
4
+ version: 0.1.40
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-04-06 00:00:00.000000000 Z
11
+ date: 2018-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny