ElmerFudd 0.0.8 → 0.0.9

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: 80f2b057fa64edb8d27708145a4b151981690d09
4
- data.tar.gz: 635f9057a19bcf0a3ef9e0c047c5adf57f585a3e
3
+ metadata.gz: 8d9d2ada2ee87820d36525a99397eb2476c72179
4
+ data.tar.gz: 96dd5c76221121b4f1acdab2b7d09413919bac30
5
5
  SHA512:
6
- metadata.gz: 87eee20ecbba4b850704a6d3cc32a37a5f4da670ed788d58731a4f287c720f1257bdba616bd7d2779f6aec50f08d9792c5e57b06d12dfc5dcf3b14963f80c349
7
- data.tar.gz: b1526ae41596bed6bda730d63d323e092100601c9acd750a337cd8f18fe3fe8d0241e084d405594ffcf7088c730066e019a0b5d22e7ab45d73c991f6551741d3
6
+ metadata.gz: a1ace79990e9363063e2189a83a20bd7f93a2ac5c9f668acbee72fcff50f34738cf350edba08983f9530cff44d9e1858fc6ed35a2ec72b9342c53aeb31f28db7
7
+ data.tar.gz: 9f96a9703cf7f0ee756ef8126ac69d0a53812327a04347e666dc1f8aa1b4e4b69e33fd0ab01b962783e1608dc9d96c85019fb62093f1d9778f0d5875119472fe
data/lib/ElmerFudd.rb CHANGED
@@ -59,15 +59,15 @@ module ElmerFudd
59
59
  class Worker
60
60
  Message = Struct.new(:delivery_info, :properties, :payload, :route)
61
61
  Env = Struct.new(:channel, :logger)
62
- Route = Struct.new(:exchange_name, :routing_key, :queue_name)
62
+ Route = Struct.new(:exchange_name, :routing_keys, :queue_name)
63
63
 
64
64
  def self.handlers
65
65
  @handlers ||= []
66
66
  end
67
67
 
68
- def self.Route(queue_name, exchange_and_routing_key = {"" => queue_name})
69
- exchange, routing_key = exchange_and_routing_key.first
70
- Route.new(exchange, routing_key, queue_name)
68
+ def self.Route(queue_name, exchange_and_routing_keys = {"" => queue_name})
69
+ exchange, routing_keys = exchange_and_routing_keys.first
70
+ Route.new(exchange, routing_keys, queue_name)
71
71
  end
72
72
 
73
73
  def self.default_filters(*filters)
@@ -131,7 +131,11 @@ module ElmerFudd
131
131
 
132
132
  def queue(env)
133
133
  env.channel.queue(@route.queue_name, durable: true).tap do |queue|
134
- queue.bind(exchange(env), routing_key: @route.routing_key) unless @route.exchange_name == ""
134
+ unless @route.exchange_name == ""
135
+ Array(@route.routing_keys).each do |routing_key|
136
+ queue.bind(exchange(env), routing_key: routing_key)
137
+ end
138
+ end
135
139
  end
136
140
  end
137
141
 
@@ -187,12 +191,12 @@ module ElmerFudd
187
191
  def self.call(env, message, filters)
188
192
  call_next(env, message, filters)
189
193
  rescue Exception => e
190
- Airbrake.notify(e, parametets: {
194
+ Airbrake.notify(e, parameters: {
191
195
  payload: message.payload,
192
196
  queue: message.route.queue_name,
193
197
  exchange_name: message.route.exchange_name,
194
198
  routing_key: message.delivery_info.routing_key,
195
- matched_routing_key: message.route.routing_key
199
+ matched_routing_key: message.route.routing_keys
196
200
  })
197
201
  raise
198
202
  end
@@ -1,3 +1,3 @@
1
1
  module ElmerFudd
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ElmerFudd
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrzej Sliwa
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-06-18 00:00:00.000000000 Z
12
+ date: 2014-06-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bunny