memcached_store 0.12.5 → 0.12.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +1 -0
- data/lib/active_support/cache/memcached_snappy_store.rb +1 -2
- data/lib/active_support/cache/memcached_store.rb +5 -5
- data/lib/memcached_store/version.rb +1 -1
- data/test/test_memcached_snappy_store.rb +10 -2
- metadata +25 -3
- metadata.gz.sig +1 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 729f6c0fdff4c0d6de3fec9fab64f8e1064a92df
|
4
|
+
data.tar.gz: 808f3dbae00b4d70d28226fa890ba43e15ed08d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 04f15a78bd3c7e734f35ef684ad606c9fc40cb59da859e4412568cfb396aebc1c1328f931e4014ccf5c0138a83f29625b76e478a9408edd9cdf9b8ade604e5f7
|
7
|
+
data.tar.gz: dfb66071f1f0f8af513dd326a1e72832ccef03efdc8001f2e564948df493e859c7a80902b9f9d7b0566c72cfe2063086c3fd925de2199b8bfdd7e0f0ae0957d1
|
checksums.yaml.gz.sig
ADDED
Binary file
|
data.tar.gz.sig
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
�����XP�ע����|���`�m�I%--�|T���ݹ0dQLQ�J0@C�~>�T��9m�����#\47�n�V�d
|
@@ -23,8 +23,7 @@ module ActiveSupport
|
|
23
23
|
private
|
24
24
|
def serialize_entry(entry, options)
|
25
25
|
value = options[:raw] ? entry.value.to_s : Marshal.dump(entry)
|
26
|
-
|
27
|
-
Snappy.deflate(value)
|
26
|
+
[Snappy.deflate(value), true]
|
28
27
|
end
|
29
28
|
|
30
29
|
def deserialize_entry(compressed_value)
|
@@ -74,7 +74,7 @@ module ActiveSupport
|
|
74
74
|
@data.cas(key, expiration(options), cas_raw?(options)) do |raw_value|
|
75
75
|
entry = deserialize_entry(raw_value)
|
76
76
|
value = yield entry.value
|
77
|
-
serialize_entry(Entry.new(value, options), options)
|
77
|
+
serialize_entry(Entry.new(value, options), options).first
|
78
78
|
end
|
79
79
|
end
|
80
80
|
rescue *NONFATAL_EXCEPTIONS => e
|
@@ -95,7 +95,7 @@ module ActiveSupport
|
|
95
95
|
values[keys_to_names[key]] = entry.value unless entry.expired?
|
96
96
|
end
|
97
97
|
values = yield values
|
98
|
-
Hash[values.map{|name, value| [escape_key(namespaced_key(name, options)), serialize_entry(Entry.new(value, options), options)]}]
|
98
|
+
Hash[values.map{|name, value| [escape_key(namespaced_key(name, options)), serialize_entry(Entry.new(value, options), options).first]}]
|
99
99
|
end
|
100
100
|
end
|
101
101
|
rescue *NONFATAL_EXCEPTIONS => e
|
@@ -146,8 +146,8 @@ module ActiveSupport
|
|
146
146
|
def write_entry(key, entry, options) # :nodoc:
|
147
147
|
method = options && options[:unless_exist] ? :add : :set
|
148
148
|
expires_in = expiration(options)
|
149
|
-
value = serialize_entry(entry, options)
|
150
|
-
@data.send(method, escape_key(key), value, expires_in,
|
149
|
+
value, raw = serialize_entry(entry, options)
|
150
|
+
@data.send(method, escape_key(key), value, expires_in, raw)
|
151
151
|
rescue *NONFATAL_EXCEPTIONS => e
|
152
152
|
@data.log_exception(e)
|
153
153
|
false
|
@@ -182,7 +182,7 @@ module ActiveSupport
|
|
182
182
|
|
183
183
|
def serialize_entry(entry, options)
|
184
184
|
entry = entry.value.to_s if options[:raw]
|
185
|
-
entry
|
185
|
+
[entry, options[:raw]]
|
186
186
|
end
|
187
187
|
|
188
188
|
def cas_raw?(options)
|
@@ -132,9 +132,9 @@ class TestMemcachedSnappyStore < ActiveSupport::TestCase
|
|
132
132
|
end
|
133
133
|
|
134
134
|
test "cas_multi should use snappy to read and write cache entries" do
|
135
|
-
keys = %w{ one two three }
|
135
|
+
keys = %w{ one two three four }
|
136
136
|
values = keys.map{ |k| k * 10 }
|
137
|
-
update_hash = {
|
137
|
+
update_hash = Hash[keys.drop(1).map {|k| [k, k * 11] }]
|
138
138
|
|
139
139
|
keys.zip(values) { |k, v| @cache.write(k, v) }
|
140
140
|
|
@@ -144,6 +144,14 @@ class TestMemcachedSnappyStore < ActiveSupport::TestCase
|
|
144
144
|
end
|
145
145
|
assert result
|
146
146
|
assert_equal Hash[keys.zip(values)].merge(update_hash), @cache.read_multi(*keys)
|
147
|
+
|
148
|
+
update_hash.each do |key, value|
|
149
|
+
actual_cache_value = @cache.instance_variable_get(:@data).get(key, true)
|
150
|
+
serialized_entry = Snappy.inflate(actual_cache_value)
|
151
|
+
entry = Marshal.load(serialized_entry)
|
152
|
+
assert entry.is_a?(ActiveSupport::Cache::Entry)
|
153
|
+
assert_equal value, entry.value
|
154
|
+
end
|
147
155
|
end
|
148
156
|
|
149
157
|
test "cas_multi should support raw entries that don't use marshal format" do
|
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: 0.12.
|
4
|
+
version: 0.12.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Camilo Lopez
|
@@ -10,8 +10,30 @@ authors:
|
|
10
10
|
- Francis Bogsanyi
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
|
-
cert_chain:
|
14
|
-
|
13
|
+
cert_chain:
|
14
|
+
- |
|
15
|
+
-----BEGIN CERTIFICATE-----
|
16
|
+
MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MQ8wDQYDVQQDDAZhZG1p
|
17
|
+
bnMxFzAVBgoJkiaJk/IsZAEZFgdzaG9waWZ5MRMwEQYKCZImiZPyLGQBGRYDY29t
|
18
|
+
MB4XDTE0MDUxNTIwMzM0OFoXDTE1MDUxNTIwMzM0OFowPzEPMA0GA1UEAwwGYWRt
|
19
|
+
aW5zMRcwFQYK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|
34
|
+
TConQSX2BnZdhIEYW+cKzEC/bLc=
|
35
|
+
-----END CERTIFICATE-----
|
36
|
+
date: 2014-06-13 00:00:00.000000000 Z
|
15
37
|
dependencies:
|
16
38
|
- !ruby/object:Gem::Dependency
|
17
39
|
name: activesupport
|
metadata.gz.sig
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
��������Y��!c��D��jE <�v���|P���kVp�8����J��'M(��^���w���c�b���F${/�H*A ըV�v[�U�}�r�'.���^EA�Ƕ�pԛV7jF���x�l��f:S�e�g���P:ɹ-���1�g���n����X�f#��
|