adapter-memcached 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,3 +1,4 @@
1
+ log
1
2
  pkg/*
2
3
  *.gem
3
4
  .bundle
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- adapter-memcached (1.0)
5
- adapter (~> 0.5)
4
+ adapter-memcached (0.5.2)
5
+ adapter (~> 0.5.1)
6
6
  memcached (~> 1.0.2)
7
7
 
8
8
  GEM
@@ -29,7 +29,7 @@ PLATFORMS
29
29
 
30
30
  DEPENDENCIES
31
31
  activesupport (~> 3)
32
- adapter (~> 0.5)
32
+ adapter (~> 0.5.1)
33
33
  adapter-memcached!
34
34
  i18n (= 0.5.0)
35
35
  log_buddy (~> 0.5.0)
@@ -22,7 +22,7 @@ module Adapter
22
22
  end
23
23
 
24
24
  def lock(name, options={}, &block)
25
- key = name.to_s
25
+ key = key_for(name)
26
26
  start = Time.now
27
27
  lock_acquired = false
28
28
  expiration = options.fetch(:expiration, 1)
@@ -43,13 +43,12 @@ module Adapter
43
43
  begin
44
44
  yield
45
45
  ensure
46
- delete(key)
46
+ begin
47
+ client.delete(key)
48
+ rescue ::Memcached::NotFound
49
+ end
47
50
  end
48
51
  end
49
-
50
- def key_for(key)
51
- [super].pack("m").strip
52
- end
53
52
  end
54
53
  end
55
54
 
@@ -1,5 +1,5 @@
1
1
  module Adapter
2
2
  module Memcached
3
- VERSION = "0.5.1"
3
+ VERSION = "0.5.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adapter-memcached
3
3
  version: !ruby/object:Gem::Version
4
- hash: 9
4
+ hash: 15
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 1
10
- version: 0.5.1
9
+ - 2
10
+ version: 0.5.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - John Nunemaker
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-01-25 00:00:00 -05:00
18
+ date: 2011-02-05 00:00:00 -05:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -70,7 +70,6 @@ files:
70
70
  - examples/memcached.rb
71
71
  - lib/adapter/memcached.rb
72
72
  - lib/adapter/memcached/version.rb
73
- - log/test.log
74
73
  - spec/helper.rb
75
74
  - spec/memcached_spec.rb
76
75
  has_rdoc: true
data/log/test.log DELETED
@@ -1 +0,0 @@
1
- # Logfile created on Tue Jan 25 21:59:54 -0500 2011 by logger.rb