memcached 0.17.7 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/CHANGELOG CHANGED
@@ -1,4 +1,6 @@
1
1
 
2
+ v0.18.0. Make Memcached::Rails compatible with Rails 2.3.2 (Ian Fung).
3
+
2
4
  v0.17.7. Disable dependency tracking.
3
5
 
4
6
  v0.17.6. Again.
@@ -7,6 +7,10 @@ class Memcached
7
7
  # A legacy compatibility wrapper for the Memcached class. It has basic compatibility with the <b>memcache-client</b> API.
8
8
  class Rails < ::Memcached
9
9
 
10
+ DEFAULTS[:logger] = nil
11
+
12
+ attr_reader :logger
13
+
10
14
  alias :servers= :set_servers
11
15
 
12
16
  # See Memcached#new for details.
@@ -17,9 +21,15 @@ class Memcached
17
21
  ).flatten.compact
18
22
 
19
23
  opts[:prefix_key] ||= opts[:namespace]
24
+ @logger = opts[:logger]
25
+ logger.info { "memcached #{VERSION} #{servers.inspect}" } if logger
20
26
  super(servers, opts)
21
27
  end
22
28
 
29
+ def logger=(logger)
30
+ @logger = logger
31
+ end
32
+
23
33
  # Wraps Memcached#get so that it doesn't raise. This has the side-effect of preventing you from
24
34
  # storing <tt>nil</tt> values.
25
35
  def get(key, raw=false)
@@ -27,6 +37,12 @@ class Memcached
27
37
  rescue NotFound
28
38
  end
29
39
 
40
+ # Alternative to #get. Accepts a key and an optional options hash supporting the single option
41
+ # :raw.
42
+ def read(key, options = {})
43
+ get(key, options[:raw])
44
+ end
45
+
30
46
  # Wraps Memcached#cas so that it doesn't raise. Doesn't set anything if no value is present.
31
47
  def cas(key, ttl=@default_ttl, raw=false, &block)
32
48
  super(key, ttl, !raw, &block)
@@ -45,6 +61,12 @@ class Memcached
45
61
  super(key, value, ttl, !raw)
46
62
  end
47
63
 
64
+ # Alternative to #set. Accepts a key, value, and an optional options hash supporting the
65
+ # options :raw and :ttl.
66
+ def write(key, value, options = {})
67
+ set(key, value, options[:ttl] || @default_ttl, options[:raw])
68
+ end
69
+
48
70
  # Wraps Memcached#add so that it doesn't raise.
49
71
  def add(key, value, ttl=@default_ttl, raw=false)
50
72
  super(key, value, ttl, !raw)
data/memcached.gemspec CHANGED
@@ -2,12 +2,12 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{memcached}
5
- s.version = "0.17.7"
5
+ s.version = "0.18.0"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Evan Weaver"]
9
9
  s.cert_chain = ["/Users/eweaver/p/configuration/gem_certificates/evan_weaver-original-public_cert.pem"]
10
- s.date = %q{2009-11-30}
10
+ s.date = %q{2010-02-04}
11
11
  s.description = %q{An interface to the libmemcached C client.}
12
12
  s.email = %q{}
13
13
  s.extensions = ["ext/extconf.rb"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memcached
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.7
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Evan Weaver
@@ -30,7 +30,7 @@ cert_chain:
30
30
  yZ0=
31
31
  -----END CERTIFICATE-----
32
32
 
33
- date: 2009-11-30 00:00:00 -08:00
33
+ date: 2010-02-04 00:00:00 -08:00
34
34
  default_executable:
35
35
  dependencies: []
36
36
 
metadata.gz.sig CHANGED
Binary file