redis-activesupport-with-cas 0.0.4 → 0.0.5
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/active_support/cache/redis_store_with_cas.rb +18 -14
- data/redis-activesupport-with-cas.gemspec +1 -1
- 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: 51478907da551d80b99fd916ee09cfd4bd28ef1d
|
4
|
+
data.tar.gz: fc86d7e4e941850438d2c467d2aa054d63102d39
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e602c8bb53052b03f784b1a558cd2ea5bb4429acdee26ecd5478adbc63bcff11ec501992cec3a171dc2287185313851d44b252ebfe8ff0a917ffe10fd331e0b5
|
7
|
+
data.tar.gz: 7ffa3ba6aaa11d394d90417b04834b62398a5d5bb8cdd6ba5cedb2edee9550b77e9a5f0b259bc1e5f8f51054652a09c74729d90280dca588a58207ce93eb2d0f
|
@@ -13,10 +13,12 @@ module ActiveSupport
|
|
13
13
|
key = normalize_key(name, options)
|
14
14
|
instrument(:cas, name, options) do
|
15
15
|
ttl = cas_expiration options
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
16
|
+
with do |c|
|
17
|
+
c.cas(key,ttl) do |entry|
|
18
|
+
value = yield entry.value
|
19
|
+
break true if read_only
|
20
|
+
options[:raw].present? ? value : Entry.new(value, options)
|
21
|
+
end
|
20
22
|
end
|
21
23
|
end
|
22
24
|
end
|
@@ -29,17 +31,19 @@ module ActiveSupport
|
|
29
31
|
keys_to_names = Hash[names.map { |name| [normalize_key(name, options), name] }]
|
30
32
|
|
31
33
|
instrument(:cas_multi, names, options) do
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
34
|
+
with do |c|
|
35
|
+
c.cas_multi(*(keys_to_names.keys), {:expires_in => cas_expiration(options)}) do |raw_values|
|
36
|
+
values = {}
|
37
|
+
raw_values.each do |key, entry|
|
38
|
+
values[keys_to_names[key]] = entry.value unless entry.expired?
|
39
|
+
end
|
40
|
+
values = yield values
|
41
|
+
break true if read_only
|
42
|
+
mapped_values = values.map do |name,value|
|
43
|
+
[normalize_key(name, options),options[:raw].present? ? value : Entry.new(value, options)]
|
44
|
+
end
|
45
|
+
Hash[mapped_values]
|
41
46
|
end
|
42
|
-
Hash[mapped_values]
|
43
47
|
end
|
44
48
|
true
|
45
49
|
end
|
@@ -3,7 +3,7 @@ $:.push File.expand_path('../lib', __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = 'redis-activesupport-with-cas'
|
6
|
-
s.version = '0.0.
|
6
|
+
s.version = '0.0.5'
|
7
7
|
s.authors = ['Rajko Albrecht']
|
8
8
|
s.email = ['ral@alwins-world.de']
|
9
9
|
s.homepage = 'https://git.alwin-it.de/alwin/redis-activesupport-with-cas'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis-activesupport-with-cas
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rajko Albrecht
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis
|