memcached_store 0.12.0 → 0.12.2

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: 171a18683c77797d79f6c336d29904a50120607b
4
- data.tar.gz: 3b2dc285bb4064f3b73dd620174934527a03cf5a
3
+ metadata.gz: b7cb13f1cc454bf71c061f837588ac6e4a2491e4
4
+ data.tar.gz: 801c6e36101b25e48d480a060bf4cd747d3bab2d
5
5
  SHA512:
6
- metadata.gz: 52711d0a3a25db301f523fb90b097392d653965876d93d24e80cedc542526b345f825a1e61a32d116a94a963024aebdf36264a076712f64841977836138cc467
7
- data.tar.gz: d6dbb652bc7fc0b58ee187ca023e512723daa77095aa8333f78af6dc14345d8f120250d0fd88801763555cb2582aa05429f08bb7b1b4ac886dee04d0f2d5d013
6
+ metadata.gz: e97ed092fed5e249f804ccb08d35409a60a721f746c0ade6f5f2229a26d359b682f2d1f6a77a091684ebbfce92302c33c60f36386be9029347b99d8fc532b87f
7
+ data.tar.gz: a4c1a588f96fa0b16acb021b3a6666ccdbd6bb6ff52f27425390ea6e81ce8e9a86dd4a156437b43c57613a3e1a07b83bc87e976282e9b5cc7faaa20ffc8e2aa8
@@ -52,10 +52,12 @@ module ActiveSupport
52
52
  keys_to_names = Hash[names.map{|name| [escape_key(namespaced_key(name, options)), name]}]
53
53
  values = {}
54
54
 
55
- if raw_values = @data.get_multi(keys_to_names.keys, :raw => true)
56
- raw_values.each do |key, value|
57
- entry = deserialize_entry(value)
58
- values[keys_to_names[key]] = entry.value unless entry.expired?
55
+ instrument(:read_multi, names, options) do
56
+ if raw_values = @data.get_multi(keys_to_names.keys, :raw => true)
57
+ raw_values.each do |key, value|
58
+ entry = deserialize_entry(value)
59
+ values[keys_to_names[key]] = entry.value unless entry.expired?
60
+ end
59
61
  end
60
62
  end
61
63
  values
@@ -66,13 +68,14 @@ module ActiveSupport
66
68
 
67
69
  def cas(name, options = nil)
68
70
  options = merged_options(options)
69
- options.merge!(:raw => true)
70
71
  key = namespaced_key(name, options)
71
72
 
72
- @data.cas(key, expiration(options), true) do |raw_value|
73
- entry = deserialize_entry(raw_value)
74
- value = yield entry.value
75
- serialize_entry(Entry.new(value, options), options)
73
+ instrument(:cas, name, options) do
74
+ @data.cas(key, expiration(options), options[:raw]) do |raw_value|
75
+ entry = deserialize_entry(raw_value)
76
+ value = yield entry.value
77
+ serialize_entry(Entry.new(value, options), options)
78
+ end
76
79
  end
77
80
  rescue *NONFATAL_EXCEPTIONS => e
78
81
  @data.log_exception(e)
@@ -82,17 +85,18 @@ module ActiveSupport
82
85
  def cas_multi(*names)
83
86
  options = names.extract_options!
84
87
  options = merged_options(options)
85
- options.merge!(:raw => true)
86
88
  keys_to_names = Hash[names.map{|name| [escape_key(namespaced_key(name, options)), name]}]
87
89
 
88
- @data.cas(keys_to_names.keys, expiration(options), true) do |raw_values|
89
- values = {}
90
- raw_values.each do |key, raw_value|
91
- entry = deserialize_entry(raw_value)
92
- values[keys_to_names[key]] = entry.value unless entry.expired?
90
+ instrument(:cas_multi, names, options) do
91
+ @data.cas(keys_to_names.keys, expiration(options), options[:raw]) do |raw_values|
92
+ values = {}
93
+ raw_values.each do |key, raw_value|
94
+ entry = deserialize_entry(raw_value)
95
+ values[keys_to_names[key]] = entry.value unless entry.expired?
96
+ end
97
+ values = yield values
98
+ Hash[values.map{|name, value| [escape_key(namespaced_key(name, options)), serialize_entry(Entry.new(value, options), options)]}]
93
99
  end
94
- values = yield values
95
- Hash[values.map{|name, value| [escape_key(namespaced_key(name, options)), serialize_entry(Entry.new(value, options), options)]}]
96
100
  end
97
101
  rescue *NONFATAL_EXCEPTIONS => e
98
102
  @data.log_exception(e)
@@ -120,11 +124,11 @@ module ActiveSupport
120
124
  end
121
125
 
122
126
  def clear(options = nil)
123
- @data.flush_all
127
+ instrument(:clear, options) { @data.flush_all }
124
128
  end
125
129
 
126
130
  def stats
127
- @data.stats
131
+ instrument(:stats) { @data.stats }
128
132
  end
129
133
 
130
134
  def exist?(*args)
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module MemcachedStore
3
- VERSION = "0.12.0"
3
+ VERSION = "0.12.2"
4
4
  end
@@ -0,0 +1 @@
1
+ # use default config
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.0
4
+ version: 0.12.2
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: 2014-05-09 00:00:00.000000000 Z
14
+ date: 2014-05-22 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: activesupport
@@ -133,6 +133,7 @@ files:
133
133
  - lib/memcached_store/memcached_safety.rb
134
134
  - lib/memcached_store/version.rb
135
135
  - memcached_store.gemspec
136
+ - shipit.rubygems.yml
136
137
  - test/test_helper.rb
137
138
  - test/test_memcached_safety.rb
138
139
  - test/test_memcached_snappy_store.rb