memcached-seanl 0.19.5.2 → 0.19.5.3
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.
- data/CHANGELOG +2 -0
- data/lib/memcached/rails.rb +17 -10
- data/memcached-seanl.gemspec +1 -1
- metadata +3 -3
data/CHANGELOG
CHANGED
data/lib/memcached/rails.rb
CHANGED
@@ -34,7 +34,7 @@ class Memcached
|
|
34
34
|
# storing <tt>nil</tt> values.
|
35
35
|
def get(key, raw=false)
|
36
36
|
super(key, !raw)
|
37
|
-
rescue NotFound
|
37
|
+
rescue Memcached::NotFound
|
38
38
|
end
|
39
39
|
|
40
40
|
# Alternative to #get. Accepts a key and an optional options hash supporting the single option
|
@@ -46,7 +46,11 @@ class Memcached
|
|
46
46
|
# Wraps Memcached#cas so that it doesn't raise. Doesn't set anything if no value is present.
|
47
47
|
def cas(key, ttl=@default_ttl, raw=false, &block)
|
48
48
|
super(key, ttl, !raw, &block)
|
49
|
-
|
49
|
+
true
|
50
|
+
rescue Memcached::NotFound
|
51
|
+
false
|
52
|
+
rescue Memcached::NotStored
|
53
|
+
false
|
50
54
|
end
|
51
55
|
|
52
56
|
alias :compare_and_swap :cas
|
@@ -60,7 +64,8 @@ class Memcached
|
|
60
64
|
def set(key, value, ttl=@default_ttl, raw=false)
|
61
65
|
super(key, value, ttl, !raw)
|
62
66
|
true
|
63
|
-
rescue NotStored
|
67
|
+
rescue Memcached::NotStored
|
68
|
+
rescue Memcached::NotFound
|
64
69
|
false
|
65
70
|
end
|
66
71
|
|
@@ -68,45 +73,47 @@ class Memcached
|
|
68
73
|
# options :raw and :ttl.
|
69
74
|
def write(key, value, options = {})
|
70
75
|
set(key, value, options[:ttl] || @default_ttl, options[:raw])
|
71
|
-
true
|
72
76
|
end
|
73
77
|
|
74
78
|
# Wraps Memcached#add so that it doesn't raise.
|
75
79
|
def add(key, value, ttl=@default_ttl, raw=false)
|
76
80
|
super(key, value, ttl, !raw)
|
77
81
|
"STORED\r\n" # This causes me physical pain.
|
78
|
-
rescue NotStored
|
82
|
+
rescue Memcached::NotStored
|
83
|
+
rescue Memcached::NotFound # Just in case of binary protocol implementation bugs
|
79
84
|
"NOT STORED\r\n"
|
80
85
|
end
|
81
86
|
|
82
87
|
# Wraps Memcached#delete so that it doesn't raise.
|
83
88
|
def delete(key, expiry=0)
|
84
89
|
super(key)
|
85
|
-
rescue NotFound
|
90
|
+
rescue Memcached::NotFound
|
86
91
|
end
|
87
92
|
|
88
93
|
# Wraps Memcached#incr so that it doesn't raise.
|
89
94
|
def incr(*args)
|
90
95
|
super
|
91
|
-
rescue NotFound
|
96
|
+
rescue Memcached::NotFound
|
92
97
|
end
|
93
98
|
|
94
99
|
# Wraps Memcached#decr so that it doesn't raise.
|
95
100
|
def decr(*args)
|
96
101
|
super
|
97
|
-
rescue NotFound
|
102
|
+
rescue Memcached::NotFound
|
98
103
|
end
|
99
104
|
|
100
105
|
# Wraps Memcached#append so that it doesn't raise.
|
101
106
|
def append(*args)
|
102
107
|
super
|
103
|
-
rescue NotStored
|
108
|
+
rescue Memcached::NotStored
|
109
|
+
rescue Memcached::NotFound
|
104
110
|
end
|
105
111
|
|
106
112
|
# Wraps Memcached#prepend so that it doesn't raise.
|
107
113
|
def prepend(*args)
|
108
114
|
super
|
109
|
-
rescue NotStored
|
115
|
+
rescue Memcached::NotStored
|
116
|
+
rescue Memcached::NotFound
|
110
117
|
end
|
111
118
|
|
112
119
|
alias :flush_all :flush
|
data/memcached-seanl.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: memcached-seanl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 197
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 19
|
9
9
|
- 5
|
10
|
-
-
|
11
|
-
version: 0.19.5.
|
10
|
+
- 3
|
11
|
+
version: 0.19.5.3
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Sean Lynch
|