double_write_cache_stores 0.1.0 → 0.1.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/double_write_cache_stores/client.rb +11 -2
- data/lib/double_write_cache_stores/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b323db56658c76a974a6e08f1771fa507c224919
|
4
|
+
data.tar.gz: c554ab823e39f6f067d7d367dacc99b2d7d936dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f4f434b4b4206bb75cde73768a11ead8a69e5fabb02246827e07a08684dbfea0cc088a8018aa5e3da5752c1cc4f1fe26f3a36f5f208b4c7ce22bdafbb2bcc49d
|
7
|
+
data.tar.gz: 8d2972a12e7b2a0c3c10af369b6860d311f698a4b86675150a4fb0d2ec113c77e60588a9fa2965de90276f1b4c4a937cccba6bcd074adffa17a2037915d1441d
|
@@ -27,7 +27,7 @@ class DoubleWriteCacheStores::Client
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def []=(key, value)
|
30
|
-
|
30
|
+
write_cache_store key, value
|
31
31
|
end
|
32
32
|
|
33
33
|
def set(key, value, options = nil)
|
@@ -76,8 +76,17 @@ class DoubleWriteCacheStores::Client
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def set_or_write_method_call cache_store, key, value, options
|
79
|
-
if cache_store.
|
79
|
+
if cache_store.is_a? Padrino::Cache::LegacyStore
|
80
|
+
if options && options[:expires_in]
|
81
|
+
options[:expires] = options[:expires_in].to_i
|
82
|
+
options[:expires_in] = nil
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
if cache_store.respond_to?(:[]=) && options.nil?
|
80
87
|
cache_store[key] = value
|
88
|
+
elsif cache_store.respond_to? :store
|
89
|
+
cache_store.store key, value, options
|
81
90
|
elsif cache_store.respond_to? :set
|
82
91
|
cache_store.set key, value, options
|
83
92
|
elsif cache_store.respond_to? :write
|