memcached_store 2.3.0 → 2.3.1

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
  SHA256:
3
- metadata.gz: cdd4f8408b915953e5dac445736ee15ddb7db1208acf365fdecb5a03b389a8e8
4
- data.tar.gz: 218294aa36469941f5ef0a6609d31687ead001e25c42dc1cf8b565b5e36e395c
3
+ metadata.gz: cff56eb9da5ff4283dbdb070dbcccb23fcb59c834a3a4d66e158720b0a594fe6
4
+ data.tar.gz: 306470c390a690087d0bee0628b8f35300fe8330a818d51ec391ba522f3f6441
5
5
  SHA512:
6
- metadata.gz: 774a57bfa30dd07824d9a8b4bcb394de38fea2e59a2cae280bc583dcd92d3ece84241c5bffc54162d903f0f594e7fbb50b7f54c19f56fe74744c8089af60c93d
7
- data.tar.gz: b0b35daa5e372df41f17d51c41df7daa393c441447342800e213e1333bdec1b574ed0cd3f72e2523105f56fcce73b34cf65ecceb68f30ca26d2058413b611484
6
+ metadata.gz: 4c97659aad0e6f75d89005a2b69306ca3387395b1924f92563c195c97cc812fb82187908c11c557346ec9c1e705c5140f367a0e49b2919ed43487dd4e42dc508
7
+ data.tar.gz: 7c9b0891c23dddfe4f01aba246dd187393207d4a8962f491b358f32d8e0ee83b532eca81f64e670e609d1dfffa294d9a3f22a68bced26291aaff4cbea07f8e01
@@ -1,5 +1,6 @@
1
1
  # file havily based out off https://github.com/rails/rails/blob/3-2-stable/activesupport/lib/active_support/cache/mem_cache_store.rb
2
2
  require 'digest/md5'
3
+ require 'delegate'
3
4
 
4
5
  module ActiveSupport
5
6
  module Cache
@@ -215,21 +216,21 @@ module ActiveSupport
215
216
  private
216
217
 
217
218
  if private_method_defined?(:read_serialized_entry)
218
- class LocalStore < Strategy::LocalCache::LocalStore
219
+ class DupLocalStore < DelegateClass(Strategy::LocalCache::LocalStore)
219
220
  def write_entry(_key, entry)
220
221
  if entry.is_a?(Entry)
221
- entry.dup_value!
222
+ entry.dup_value!
222
223
  end
223
224
  super
224
225
  end
225
226
 
226
227
  def fetch_entry(key)
227
- entry = @data.fetch(key) do
228
+ entry = super do
228
229
  new_entry = yield
229
230
  if entry.is_a?(Entry)
230
231
  new_entry.dup_value!
231
232
  end
232
- @data[key] = new_entry
233
+ new_entry
233
234
  end
234
235
  entry = entry.dup
235
236
 
@@ -241,12 +242,17 @@ module ActiveSupport
241
242
  end
242
243
  end
243
244
 
244
- module LocalCacheDup
245
- def with_local_cache
246
- use_temporary_local_cache(LocalStore.new) { yield }
245
+ module DupLocalCache
246
+ private
247
+
248
+ def local_cache
249
+ if local_cache = super
250
+ DupLocalStore.new(local_cache)
251
+ end
247
252
  end
248
253
  end
249
- prepend LocalCacheDup
254
+
255
+ prepend DupLocalCache
250
256
 
251
257
  def read_entry(key, **options) # :nodoc:
252
258
  deserialize_entry(read_serialized_entry(key, **options))
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module MemcachedStore
3
- VERSION = "2.3.0"
3
+ VERSION = "2.3.1"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memcached_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Camilo Lopez
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2021-07-26 00:00:00.000000000 Z
14
+ date: 2021-08-02 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport