redis-store-rails2-compat 1.1.4 → 1.1.4.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -27,11 +27,7 @@ module ActiveSupport
27
27
  end
28
28
 
29
29
  def write(name, value, options = nil)
30
- options = merged_options(options)
31
- instrument(:write, name, options) do |payload|
32
- entry = options[:raw].present? ? value : Entry.new(value, options)
33
- write_entry(namespaced_key(name, options), entry, options)
34
- end
30
+ write_entry(name, value, options)
35
31
  end
36
32
 
37
33
  # Delete objects for matched keys.
@@ -39,17 +35,18 @@ module ActiveSupport
39
35
  # Example:
40
36
  # cache.del_matched "rab*"
41
37
  def delete_matched(matcher, options = nil)
42
- options = merged_options(options)
43
- instrument(:delete_matched, matcher.inspect) do
44
- matcher = key_matcher(matcher, options)
45
- begin
46
- !(keys = @data.keys(matcher)).empty? && @data.del(*keys)
47
- rescue Errno::ECONNREFUSED => e
48
- false
49
- end
38
+ matcher = key_matcher(matcher, options)
39
+ begin
40
+ !(keys = @data.keys(matcher)).empty? && @data.del(*keys)
41
+ rescue Errno::ECONNREFUSED => e
42
+ false
50
43
  end
51
44
  end
52
45
 
46
+ def read(name, options=nil)
47
+ read_multi(name)[name]
48
+ end
49
+
53
50
  # Reads multiple keys from the cache using a single call to the
54
51
  # servers for all keys. Options can be passed in the last argument.
55
52
  #
@@ -89,9 +86,7 @@ module ActiveSupport
89
86
  # cache.increment "rabbit"
90
87
  # cache.read "rabbit", :raw => true # => "1"
91
88
  def increment(key, amount = 1)
92
- instrument(:increment, key, :amount => amount) do
93
- @data.incrby key, amount
94
- end
89
+ @data.incrby key, amount
95
90
  end
96
91
 
97
92
  # Decrement a key in the store
@@ -116,16 +111,12 @@ module ActiveSupport
116
111
  # cache.decrement "rabbit"
117
112
  # cache.read "rabbit", :raw => true # => "-1"
118
113
  def decrement(key, amount = 1)
119
- instrument(:decrement, key, :amount => amount) do
120
- @data.decrby key, amount
121
- end
114
+ @data.decrby key, amount
122
115
  end
123
116
 
124
117
  # Clear all the data from the store.
125
118
  def clear
126
- instrument(:clear, nil, nil) do
127
- @data.flushdb
128
- end
119
+ @data.flushdb
129
120
  end
130
121
 
131
122
  def stats
@@ -146,10 +137,7 @@ module ActiveSupport
146
137
  end
147
138
 
148
139
  def read_entry(key, options)
149
- entry = @data.get key, options
150
- if entry
151
- entry.is_a?(ActiveSupport::Cache::Entry) ? entry : ActiveSupport::Cache::Entry.new(entry)
152
- end
140
+ @data.get key, options
153
141
  rescue Errno::ECONNREFUSED => e
154
142
  nil
155
143
  end
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "redis-store-rails2-compat"
7
- spec.version = '1.1.4'
7
+ spec.version = '1.1.4.2'
8
8
  spec.authors = ["Kimmo Lehto"]
9
9
  spec.email = ["kimmo.lehto@gmail.com"]
10
10
  spec.description = %q{Bring back the rails2 compatibility from redis-store 1.0.0.1 to 1.1.x}
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-store-rails2-compat
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 67
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
9
  - 4
10
- version: 1.1.4
10
+ - 2
11
+ version: 1.1.4.2
11
12
  platform: ruby
12
13
  authors:
13
14
  - Kimmo Lehto
@@ -15,7 +16,7 @@ autorequire:
15
16
  bindir: bin
16
17
  cert_chain: []
17
18
 
18
- date: 2014-05-21 00:00:00 Z
19
+ date: 2014-06-02 00:00:00 Z
19
20
  dependencies:
20
21
  - !ruby/object:Gem::Dependency
21
22
  version_requirements: &id001 !ruby/object:Gem::Requirement