sneakers 2.3.0 → 2.3.1
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 +4 -4
- data/lib/sneakers/configuration.rb +14 -8
- data/lib/sneakers/version.rb +1 -1
- data/spec/sneakers/worker_spec.rb +3 -2
- 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: aeb60ce69dfdcd3827ba365bc9e7a2b57ea4e6b7
|
4
|
+
data.tar.gz: 5dfc47a8211dd79822bb3fe8c4ec61f51a5b6d92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36c682fb4bca53a96ea72016677c617245be8092dea6c48d612bffed0b3c2b37c4be9db6fb238b0358998b01eca64580f8706e6dd59d20a7ff4841482a825c3b
|
7
|
+
data.tar.gz: 5d3431dd0cb6b027f578c5679b2c11b175e1fc8a0caede9c37de1dcce05fbe4b417c85844da990f993d33a42f8300f1c30008ecdd44124a3af897ddf8ae31fe8
|
@@ -57,9 +57,7 @@ module Sneakers
|
|
57
57
|
|
58
58
|
def merge!(hash)
|
59
59
|
hash = hash.dup
|
60
|
-
hash =
|
61
|
-
hash = map_deprecated_exchange_options_key(hash, :exchange_arguments, :arguments)
|
62
|
-
hash = map_deprecated_exchange_options_key(hash, :durable, :durable)
|
60
|
+
hash = map_all_deprecated_options(hash)
|
63
61
|
|
64
62
|
# parse vhost from amqp if vhost is not specified explicitly, only
|
65
63
|
# if we're not given a connection to use.
|
@@ -99,16 +97,24 @@ module Sneakers
|
|
99
97
|
alias_method :inspect_without_redaction, :inspect
|
100
98
|
alias_method :inspect, :inspect_with_redaction
|
101
99
|
|
102
|
-
def
|
100
|
+
def map_all_deprecated_options(hash)
|
101
|
+
hash = map_deprecated_options_key(:exchange_options, :exchange_type, :type, true, hash)
|
102
|
+
hash = map_deprecated_options_key(:exchange_options, :exchange_arguments, :arguments, true, hash)
|
103
|
+
hash = map_deprecated_options_key(:exchange_options, :durable, :durable, false, hash)
|
104
|
+
hash = map_deprecated_options_key(:queue_options, :durable, :durable, true, hash)
|
105
|
+
hash = map_deprecated_options_key(:queue_options, :arguments, :arguments, true, hash)
|
106
|
+
hash
|
107
|
+
end
|
108
|
+
|
109
|
+
def map_deprecated_options_key(target_key, deprecated_key, key, delete_deprecated_key, hash = {})
|
103
110
|
return hash if hash[deprecated_key].nil?
|
104
|
-
hash = deep_merge({
|
105
|
-
hash
|
106
|
-
hash.delete(deprecated_key)
|
111
|
+
hash = deep_merge({ target_key => { key => hash[deprecated_key] } }, hash)
|
112
|
+
hash.delete(deprecated_key) if delete_deprecated_key
|
107
113
|
hash
|
108
114
|
end
|
109
115
|
|
110
116
|
def deep_merge(first, second)
|
111
|
-
merger = proc { |
|
117
|
+
merger = proc { |_, v1, v2| Hash === v1 && Hash === v2 ? v1.merge(v2, &merger) : v2 }
|
112
118
|
first.merge(second, &merger)
|
113
119
|
end
|
114
120
|
end
|
data/lib/sneakers/version.rb
CHANGED
@@ -117,7 +117,8 @@ class WithDeprecatedExchangeOptionsWorker
|
|
117
117
|
from_queue 'defaults',
|
118
118
|
:durable => false,
|
119
119
|
:exchange_type => :topic,
|
120
|
-
:exchange_arguments => { 'x-arg' => 'value' }
|
120
|
+
:exchange_arguments => { 'x-arg' => 'value' },
|
121
|
+
:arguments => { 'x-arg2' => 'value2' }
|
121
122
|
|
122
123
|
def work(msg)
|
123
124
|
end
|
@@ -279,7 +280,7 @@ describe Sneakers::Worker do
|
|
279
280
|
:durable => false,
|
280
281
|
:auto_delete => false,
|
281
282
|
:exclusive => false,
|
282
|
-
:arguments => {}
|
283
|
+
:arguments => { 'x-arg2' => 'value2' }
|
283
284
|
},
|
284
285
|
:hooks => {},
|
285
286
|
:handler => Sneakers::Handlers::Oneshot,
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sneakers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.3.
|
4
|
+
version: 2.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dotan Nahum
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: serverengine
|