kvmultiplex 0.1.7 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/kvmultiplex.gemspec +1 -0
- data/lib/kvmultiplex/multiplexer.rb +4 -1
- data/lib/kvmultiplex/providers/memory.rb +3 -3
- data/lib/kvmultiplex/version.rb +1 -1
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 329461507efb6ab3f1d07f5d7b599520fa0646d2
|
4
|
+
data.tar.gz: 93d4d423675cb670fa8bdddf31057742f7aaa0f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 397a7c3b416e45caae362be476fa12c9284db74193c17b6320084a6f2f85c816b43697dea9f497efe53e666ea853f1654177b52147ea560e95d8ae6993f29d60
|
7
|
+
data.tar.gz: fa1e8941497c7236360cdb429b41b9d3d114e945b22ad2ebef831413036ad5cb0d3fbdac9c9c04a1317546aacf90a5a2dea643085de40ee5647e88945cf0fa8a
|
data/kvmultiplex.gemspec
CHANGED
@@ -48,7 +48,10 @@ module KVMultiplex
|
|
48
48
|
logger.warn "No providers for '#{full_key.inspect}'."
|
49
49
|
nil
|
50
50
|
else
|
51
|
-
ret =
|
51
|
+
ret =
|
52
|
+
providers.lazy
|
53
|
+
.map { |provider| provider.get(subkey, full_key) }
|
54
|
+
.find { |v| !v.nil? }
|
52
55
|
logger.warn "No values found for '#{full_key.inspect}'." if ret.nil?
|
53
56
|
|
54
57
|
ret
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require "kvmultiplex/provider"
|
2
2
|
|
3
|
-
require "json
|
3
|
+
require "multi_json" # because Chef uses json 1.8.old-as-heck
|
4
4
|
require "deep_merge"
|
5
5
|
|
6
6
|
module KVMultiplex
|
@@ -16,12 +16,12 @@ module KVMultiplex
|
|
16
16
|
|
17
17
|
def get(subkey, _full_key)
|
18
18
|
v = @contents[get_content_key(subkey)]
|
19
|
-
v.nil? ? v :
|
19
|
+
v.nil? ? v : MultiJson.load(v)
|
20
20
|
end
|
21
21
|
|
22
22
|
def set(subkey, _full_key, value)
|
23
23
|
# do NOT use JSON.generate here; it's unsafe in environments that pull json 1.8.6
|
24
|
-
@contents[get_content_key(subkey)] = value.nil? ? nil : value
|
24
|
+
@contents[get_content_key(subkey)] = value.nil? ? nil : MultiJson.dump(value)
|
25
25
|
value
|
26
26
|
end
|
27
27
|
|
data/lib/kvmultiplex/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kvmultiplex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ed Ropple
|
@@ -94,6 +94,20 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '1.1'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: multi_json
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '1'
|
104
|
+
type: :runtime
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1'
|
97
111
|
description:
|
98
112
|
email:
|
99
113
|
- ed@edropple.com
|