dalli 2.7.8 → 2.7.9

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: 2c031a1c9cb46cdd1c12b7f52d123de5edd393c8061353cb7842b3106b97d13f
4
- data.tar.gz: 43a26b17146ebb001fb073df967c5f77c04660f3f71d791c3bf67d05b9a10425
3
+ metadata.gz: 01e74b52404cfe86c17ffe33b29fb1f417fb1083a599c888f7f3ad7ec6f6b7a7
4
+ data.tar.gz: 625a2dfec7051e2a3807d21c0240bf9ad0a943fd9e22a898dacb29ad08ff8146
5
5
  SHA512:
6
- metadata.gz: 22a104d5ebc991e0a28dc44315328a4526dfa7b217284c9b7bfbc2d8b1478daf1d473541799fc46b81afac1e28d1c2f7fa10cfceaea7eb330d3a6738b061e037
7
- data.tar.gz: e03f4510b72135c59bda4c50f9737a933beb8e791b7a6baa8d1ab4909e297e3a5c73f0b2f1c879f830b92807b5b714b8a379b8e2a53921ec787ec92c458b0121
6
+ metadata.gz: 0f3a1deb5cc3fe03b898824f368a69b3a8d25e532bb81b6b7822446db4682fe863a62fa7a68c6935279a33429bd66e84c008691da23a6e02bc3ad0660c1b6660
7
+ data.tar.gz: 4ff78a2317aa690c44465a39b6559ab304724448ab4932dfb5832c759a3e8a9856c0aca72c6bc9306a2c5f9fffea6a0f2711e8add47e451aca09c5ffdf12ece4
data/History.md CHANGED
@@ -1,6 +1,12 @@
1
1
  Dalli Changelog
2
2
  =====================
3
3
 
4
+ 2.7.9
5
+ ==========
6
+ - Fix behavior for Rails 5.2+ cache_versioning (GriwMF)
7
+ - Ensure fetch provides the key to the fallback block as an argument (0exp)
8
+ - Assorted performance improvements (schneems)
9
+
4
10
  2.7.8
5
11
  ==========
6
12
  - Rails 5.2 compatibility (pbougie)
data/README.md CHANGED
@@ -66,9 +66,10 @@ dc.set('abc', 123)
66
66
  value = dc.get('abc')
67
67
  ```
68
68
 
69
- The test suite requires memcached 1.4.3+ with SASL enabled (brew install memcached --enable-sasl ; mv /usr/bin/memcached /usr/bin/memcached.old). Currently only supports the PLAIN mechanism.
69
+ The test suite requires memcached 1.4.3+ with SASL enabled (`brew install memcached --enable-sasl ; mv /usr/bin/memcached /usr/bin/memcached.old`). Currently only supports the PLAIN mechanism.
70
70
 
71
- Dalli has no runtime dependencies and never will. You can optionally install the 'kgio' gem to
71
+ Dalli has no runtime dependencies and never will. If you are using Ruby <2.3,
72
+ you can optionally install the '[kgio](https://bogomips.org/kgio/)' gem to
72
73
  give Dalli a 20-30% performance boost.
73
74
 
74
75
 
@@ -218,7 +219,7 @@ Note that Dalli does not require ActiveSupport or Rails. You can safely use it
218
219
  Helping Out
219
220
  -------------
220
221
 
221
- If you have a fix you wish to provide, please fork the code, fix in your local project and then send a pull request on github. Please ensure that you include a test which verifies your fix and update History.md with a one sentence description of your fix so you get credit as a contributor.
222
+ If you have a fix you wish to provide, please fork the code, fix in your local project and then send a pull request on github. Please ensure that you include a test which verifies your fix and update `History.md` with a one sentence description of your fix so you get credit as a contributor.
222
223
 
223
224
  We're not accepting new compressors. They are trivial to add in an initializer. See #385 (LZ4), #406 (Snappy)
224
225
 
@@ -111,7 +111,7 @@ module ActiveSupport
111
111
 
112
112
  if not_found == entry
113
113
  result = instrument_with_log(:generate, namespaced_name, options) do |payload|
114
- yield
114
+ yield(name)
115
115
  end
116
116
  write(name, result, options)
117
117
  result
@@ -346,11 +346,14 @@ module ActiveSupport
346
346
  end
347
347
  alias :normalize_key :namespaced_key
348
348
 
349
- # Expand key to be a consistent string value. Invoke +cache_key+ if
350
- # object responds to +cache_key+. Otherwise, to_param method will be
351
- # called. If the key is a Hash, then keys will be sorted alphabetically.
349
+ # Expand key to be a consistent string value. Invokes +cache_key_with_version+
350
+ # first to support Rails 5.2 cache versioning.
351
+ # Invoke +cache_key+ if object responds to +cache_key+. Otherwise, to_param method
352
+ # will be called. If the key is a Hash, then keys will be sorted alphabetically.
352
353
  def expanded_key(key) # :nodoc:
354
+ return key.cache_key_with_version.to_s if key.respond_to?(:cache_key_with_version)
353
355
  return key.cache_key.to_s if key.respond_to?(:cache_key)
356
+ original_object_id = key.object_id
354
357
 
355
358
  case key
356
359
  when Array
@@ -365,7 +368,7 @@ module ActiveSupport
365
368
 
366
369
  key = key.to_param
367
370
  if key.respond_to? :force_encoding
368
- key = key.dup
371
+ key = key.dup if key.object_id == original_object_id
369
372
  key.force_encoding('binary')
370
373
  end
371
374
  key
@@ -64,7 +64,10 @@ module Dalli
64
64
  # If a block is given, yields key/value pairs one at a time.
65
65
  # Otherwise returns a hash of { 'key' => 'value', 'key2' => 'value1' }
66
66
  def get_multi(*keys)
67
- return {} if keys.flatten.compact.empty?
67
+ check_keys = keys.flatten
68
+ check_keys.compact!
69
+
70
+ return {} if check_keys.empty?
68
71
  if block_given?
69
72
  get_multi_yielder(keys) {|k, data| yield k, data.first}
70
73
  else
@@ -292,7 +295,9 @@ module Dalli
292
295
  end
293
296
 
294
297
  def mapped_keys(keys)
295
- keys.flatten.map {|a| validate_key(a.to_s)}
298
+ keys_array = keys.flatten
299
+ keys_array.map! { |a| validate_key(a.to_s) }
300
+ keys_array
296
301
  end
297
302
 
298
303
  def make_multi_get_requests(groups)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Dalli
3
- VERSION = '2.7.8'
3
+ VERSION = '2.7.9'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dalli
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.8
4
+ version: 2.7.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter M. Goldstein
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-04-11 00:00:00.000000000 Z
12
+ date: 2018-10-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: minitest
@@ -169,7 +169,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
169
169
  version: '0'
170
170
  requirements: []
171
171
  rubyforge_project:
172
- rubygems_version: 2.7.5
172
+ rubygems_version: 2.7.6
173
173
  signing_key:
174
174
  specification_version: 4
175
175
  summary: High performance memcached client for Ruby