redis_buddy 0.1.4 → 0.1.5

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.
Files changed (2) hide show
  1. data/lib/redis_buddy/cache_store.rb +10 -3
  2. metadata +5 -5
@@ -10,9 +10,16 @@ module ActiveSupport
10
10
  def write(key, value, options = nil)
11
11
  super do
12
12
  method = options && options[:unless_exist] ? :set_unless_exists : :set
13
- returning @data.send(method, key, value, options) do
14
- @data.expire key, options[:expire] if options && options[:expire]
13
+
14
+ if options && options[:expire]
15
+ if info['redis_version'] <= '1.2.6'
16
+ method = :set
17
+ options = options[:expire]
18
+ else
19
+ @data.send(:setex, options[:expire], value)
20
+ end
15
21
  end
22
+ @data.send(method, key, value, options) if options.is_a?(Integer) || !options[:expire]
16
23
  end
17
24
  end
18
25
 
@@ -53,7 +60,7 @@ module ActiveSupport
53
60
  end
54
61
 
55
62
  def clear
56
- @data.flush_db
63
+ @data.flushdb
57
64
  end
58
65
 
59
66
  def info
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 4
9
- version: 0.1.4
8
+ - 5
9
+ version: 0.1.5
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ole Riesenberg
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-04-27 00:00:00 +02:00
17
+ date: 2010-05-10 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -27,8 +27,8 @@ dependencies:
27
27
  segments:
28
28
  - 1
29
29
  - 0
30
- - 6
31
- version: 1.0.6
30
+ - 7
31
+ version: 1.0.7
32
32
  type: :runtime
33
33
  version_requirements: *id001
34
34
  - !ruby/object:Gem::Dependency