memcached-seanl 0.19.5.2 → 0.19.5.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,5 @@
1
+ v0.19.5.3. Maybe use correct rescue syntax?
2
+
1
3
  v0.19.5.2. Remove artificial error
2
4
 
3
5
  v0.19.5.1. Test that I'm really using the right module
@@ -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
- rescue NotFound
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, NotFound
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, NotFound # Just in case of binary protocol implementation bugs
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, NotFound
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, NotFound
115
+ rescue Memcached::NotStored
116
+ rescue Memcached::NotFound
110
117
  end
111
118
 
112
119
  alias :flush_all :flush
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{memcached-seanl}
5
- s.version = "0.19.5.2"
5
+ s.version = "0.19.5.3"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Sean Lynch"]
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: 199
4
+ hash: 197
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 19
9
9
  - 5
10
- - 2
11
- version: 0.19.5.2
10
+ - 3
11
+ version: 0.19.5.3
12
12
  platform: ruby
13
13
  authors:
14
14
  - Sean Lynch