double_write_cache_stores 0.0.3 → 0.0.4
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d14a5f53f7caef579a423332dffc1a8973abfe1
|
4
|
+
data.tar.gz: 5202dc0ccb089fe2a0dde67d60b18d2e1a527128
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b35d929dfac751e60978469507519524f0848d26fc9cf3f5dc59b0f4edc5ca28de4c02be98947d304f4ebedc80f2d621d3801ef8e0706da5cce3bf8f7ae90b14
|
7
|
+
data.tar.gz: 9803d72741ebff1ae00e9b347ef52d9ab96f60c70ce599e52b2bdeca83bbe182235fa519423d3c284b30d2e601d35c0afd1003571b8da10aa76ccb4c0395cdd2
|
@@ -40,7 +40,7 @@ class DoubleWriteCacheStores::Client
|
|
40
40
|
|
41
41
|
def touch(key)
|
42
42
|
result = false
|
43
|
-
read_and_write_backend = @read_and_write_store.instance_variable_get
|
43
|
+
read_and_write_backend = @read_and_write_store.instance_variable_get('@backend') || @read_and_write_store.instance_variable_get('@data')
|
44
44
|
if read_and_write_backend && read_and_write_backend.respond_to?(:touch)
|
45
45
|
result = read_and_write_backend.touch key
|
46
46
|
write_only_store_touch key
|
@@ -92,7 +92,8 @@ class DoubleWriteCacheStores::Client
|
|
92
92
|
|
93
93
|
def write_only_store_touch(key)
|
94
94
|
if @write_only_store
|
95
|
-
|
95
|
+
write_only_backend = @write_only_store.instance_variable_get('@backend') || @write_only_store.instance_variable_get('@data')
|
96
|
+
if write_only_backend
|
96
97
|
write_only_backend.touch key if write_only_backend.respond_to?(:touch)
|
97
98
|
end
|
98
99
|
end
|
@@ -67,16 +67,26 @@ describe DoubleWriteCacheStores::Client do
|
|
67
67
|
before do
|
68
68
|
support_touch_copy_cache_store.set 'touch-key', 'touch-value', :expires_in => 1.day
|
69
69
|
end
|
70
|
-
|
71
|
-
|
72
|
-
|
70
|
+
|
71
|
+
context 'Dalli::Client' do
|
72
|
+
it 'example' do
|
73
|
+
expect(support_touch_copy_cache_store.touch 'touch-key').to be true
|
74
|
+
expect(support_touch_copy_cache_store.touch 'non-set-key').to be nil
|
75
|
+
end
|
73
76
|
end
|
74
|
-
|
77
|
+
|
78
|
+
context 'ActiveSupport::Cache::DalliStore' do
|
79
|
+
let :double_write_dalli_store do
|
80
|
+
DoubleWriteCacheStores::Client.new ActiveSupport::Cache::DalliStore.new('localhost:11211', options), ActiveSupport::Cache::DalliStore.new('localhost:21211', options)
|
81
|
+
end
|
82
|
+
|
75
83
|
before do
|
76
|
-
|
84
|
+
double_write_dalli_store.set 'touch-key', 'touch-valule', :expires_in => 1.day
|
77
85
|
end
|
78
|
-
|
79
|
-
|
86
|
+
|
87
|
+
it 'example' do
|
88
|
+
expect(double_write_dalli_store.touch 'touch-key').to be true
|
89
|
+
expect(double_write_dalli_store.touch 'non-set-key').to be nil
|
80
90
|
end
|
81
91
|
end
|
82
92
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: double_write_cache_stores
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hirocaster
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|