redis-activesupport 3.2.3 → 3.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +2 -4
- data/.travis.yml +14 -0
- data/Gemfile +5 -3
- data/README.md +23 -36
- data/Rakefile +2 -6
- data/lib/active_support/cache/redis_store.rb +2 -2
- data/lib/redis/activesupport/version.rb +1 -1
- data/redis-activesupport.gemspec +17 -16
- data/test/active_support/cache/redis_store_test.rb +7 -17
- data/test/redis/activesupport/version_test.rb +2 -2
- data/test/test_helper.rb +2 -4
- metadata +63 -43
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: c39cf240b52d54b8274614a38ac685b9f5d18f64
|
4
|
+
data.tar.gz: 0a474486846baf018439c5bb07fd31098fecbe71
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 9d09811a1e9bf8e03b2c4c281aa9e54d0c9363a734814419cb79af1b2a0c0abbfeab0f635f6e412e1b3cc6ccf4325c51c3cb8c226122edf92b2f1a189489b4b6
|
7
|
+
data.tar.gz: 9859d95f3ba1aee5f4b2e2e376c887874a3ec6df900cbe81a374c70d63f5caad2645271ceab72d25ea3b3dfae3f4bd2bcad33835f07fafbed7063c513f4b5253
|
data/.gitignore
CHANGED
data/.travis.yml
ADDED
data/Gemfile
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
source
|
1
|
+
source 'https://rubygems.org'
|
2
2
|
gemspec
|
3
3
|
|
4
|
-
|
4
|
+
if ::File.directory?(gem_path = '../redis-store')
|
5
|
+
gem 'redis-store', '~> 1.1.0', path: gem_path
|
6
|
+
end
|
7
|
+
|
5
8
|
gem 'i18n'
|
6
|
-
gem 'SystemTimer', :platform => :mri_18
|
data/README.md
CHANGED
@@ -1,52 +1,39 @@
|
|
1
1
|
# Redis stores for ActiveSupport
|
2
2
|
|
3
|
-
__`redis-activesupport`__ provides a
|
3
|
+
__`redis-activesupport`__ provides a cache for __ActiveSupport__. See the main [redis-store readme](https://github.com/redis-store/redis-store) for general guidelines.
|
4
4
|
|
5
|
-
##
|
5
|
+
## Installation
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
brew install redis
|
12
|
-
|
13
|
-
### Option 2: From Source
|
14
|
-
|
15
|
-
Download and install Redis from [http://redis.io](http://redis.io/)
|
16
|
-
|
17
|
-
wget http://redis.googlecode.com/files/redis-2.4.5.tar.gz
|
18
|
-
tar -zxf redis-2.4.5.tar.gz
|
19
|
-
mv redis-2.4.5 redis
|
20
|
-
cd redis
|
21
|
-
make
|
7
|
+
```ruby
|
8
|
+
# Gemfile
|
9
|
+
gem 'redis-activesupport'
|
10
|
+
```
|
22
11
|
|
23
12
|
## Usage
|
24
13
|
|
25
|
-
|
26
|
-
gem 'redis-activesupport'
|
27
|
-
|
28
|
-
### Cache Store: Ruby on Rails
|
14
|
+
If you are using redis-store with Rails, consider using the [redis-rails gem](https://github.com/redis-store/redis-rails) instead. For standalone usage:
|
29
15
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
### Cache Store: Standalone
|
34
|
-
|
35
|
-
ActiveSupport::Cache.lookup_store :redis_store # { ... optional configuration ... }
|
36
|
-
|
37
|
-
#### Configuration
|
38
|
-
|
39
|
-
For advanced configuration options, please check the [Redis Store Wiki](https://github.com/jodosha/redis-store/wiki).
|
16
|
+
```ruby
|
17
|
+
ActiveSupport::Cache.lookup_store :redis_store # { ... optional configuration ... }
|
18
|
+
```
|
40
19
|
|
41
20
|
## Running tests
|
42
21
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
22
|
+
```shell
|
23
|
+
gem install bundler
|
24
|
+
git clone git://github.com/redis-store/redis-activesupport.git
|
25
|
+
cd redis-activesupport
|
26
|
+
git checkout -t origin/3.2.x
|
27
|
+
bundle install
|
28
|
+
bundle exec rake
|
29
|
+
```
|
47
30
|
|
48
31
|
If you are on **Snow Leopard** you have to run `env ARCHFLAGS="-arch x86_64" bundle exec rake`
|
49
32
|
|
33
|
+
## Status
|
34
|
+
|
35
|
+
[![Gem Version](https://badge.fury.io/rb/redis-activesupport.png)](http://badge.fury.io/rb/redis-activesupport) [![Build Status](https://secure.travis-ci.org/redis-store/redis-activesupport.png?branch=3.2.x)](http://travis-ci.org/jodosha/redis-activesupport?branch=3.2.x) [![Code Climate](https://codeclimate.com/github/jodosha/redis-store.png)](https://codeclimate.com/github/redis-store/redis-activesupport)
|
36
|
+
|
50
37
|
## Copyright
|
51
38
|
|
52
|
-
|
39
|
+
2009 - 2013 Luca Guidi - [http://lucaguidi.com](http://lucaguidi.com), released under the MIT license
|
data/Rakefile
CHANGED
@@ -24,7 +24,7 @@ module ActiveSupport
|
|
24
24
|
# RedisStore.new "localhost:6379/0", "localhost:6380/0"
|
25
25
|
# # => instantiate a cluster
|
26
26
|
def initialize(*addresses)
|
27
|
-
@data = ::Redis::Factory.create(addresses)
|
27
|
+
@data = ::Redis::Store::Factory.create(addresses)
|
28
28
|
super(addresses.extract_options!)
|
29
29
|
end
|
30
30
|
|
@@ -46,7 +46,7 @@ module ActiveSupport
|
|
46
46
|
matcher = key_matcher(matcher, options)
|
47
47
|
begin
|
48
48
|
!(keys = @data.keys(matcher)).empty? && @data.del(*keys)
|
49
|
-
rescue Errno::ECONNREFUSED
|
49
|
+
rescue Errno::ECONNREFUSED
|
50
50
|
false
|
51
51
|
end
|
52
52
|
end
|
data/redis-activesupport.gemspec
CHANGED
@@ -1,30 +1,31 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
$:.push File.expand_path(
|
3
|
-
require
|
2
|
+
$:.push File.expand_path('../lib', __FILE__)
|
3
|
+
require 'redis/activesupport/version'
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
|
-
s.name =
|
6
|
+
s.name = 'redis-activesupport'
|
7
7
|
s.version = Redis::ActiveSupport::VERSION
|
8
|
-
s.authors = [
|
9
|
-
s.email = [
|
10
|
-
s.homepage =
|
11
|
-
s.summary = %q{Redis store for ActiveSupport
|
12
|
-
s.description = %q{Redis store for ActiveSupport
|
8
|
+
s.authors = ['Luca Guidi']
|
9
|
+
s.email = ['me@lucaguidi.com']
|
10
|
+
s.homepage = 'http://redis-store.org/redis-activesupport'
|
11
|
+
s.summary = %q{Redis store for ActiveSupport}
|
12
|
+
s.description = %q{Redis store for ActiveSupport}
|
13
|
+
s.license = 'MIT'
|
13
14
|
|
14
|
-
s.rubyforge_project =
|
15
|
+
s.rubyforge_project = 'redis-activesupport'
|
15
16
|
|
16
17
|
s.files = `git ls-files`.split("\n")
|
17
18
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
19
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
-
s.require_paths = [
|
20
|
+
s.require_paths = ['lib']
|
20
21
|
|
21
22
|
s.add_runtime_dependency 'redis-store', '~> 1.1.0'
|
22
|
-
s.add_runtime_dependency 'activesupport', '~> 3.2.
|
23
|
+
s.add_runtime_dependency 'activesupport', '~> 3.2.0'
|
23
24
|
|
24
|
-
s.add_development_dependency 'rake',
|
25
|
-
s.add_development_dependency 'bundler',
|
26
|
-
s.add_development_dependency 'mocha',
|
27
|
-
s.add_development_dependency 'minitest',
|
28
|
-
s.add_development_dependency '
|
25
|
+
s.add_development_dependency 'rake', '~> 10'
|
26
|
+
s.add_development_dependency 'bundler', '~> 1.3'
|
27
|
+
s.add_development_dependency 'mocha', '~> 0.14.0'
|
28
|
+
s.add_development_dependency 'minitest', '~> 4.2'
|
29
|
+
s.add_development_dependency 'redis-store-testing'
|
29
30
|
end
|
30
31
|
|
@@ -43,21 +43,11 @@ describe ActiveSupport::Cache::RedisStore do
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
result.must_include("\x0FOpenStruct{\x06:\tnameI\"\nbunny\x06:\x06EF")
|
52
|
-
end
|
53
|
-
end
|
54
|
-
else
|
55
|
-
it "reads raw data" do
|
56
|
-
with_store_management do |store|
|
57
|
-
result = store.read("rabbit", :raw => true)
|
58
|
-
result.must_include("ActiveSupport::Cache::Entry")
|
59
|
-
result.must_include("\017OpenStruct{\006:\tname\"\nbunny")
|
60
|
-
end
|
46
|
+
it "reads raw data" do
|
47
|
+
with_store_management do |store|
|
48
|
+
result = store.read("rabbit", :raw => true)
|
49
|
+
result.must_include("ActiveSupport::Cache::Entry")
|
50
|
+
result.must_match("bunny")
|
61
51
|
end
|
62
52
|
end
|
63
53
|
|
@@ -165,8 +155,8 @@ describe ActiveSupport::Cache::RedisStore do
|
|
165
155
|
it "reads multiple keys" do
|
166
156
|
@store.write "irish whisky", "Jameson"
|
167
157
|
result = @store.read_multi "rabbit", "irish whisky"
|
168
|
-
result['rabbit'].
|
169
|
-
result['irish whisky'].
|
158
|
+
result['rabbit'].raw_value.must_match(@rabbit.name)
|
159
|
+
result['irish whisky'].raw_value.must_match("Jameson")
|
170
160
|
end
|
171
161
|
|
172
162
|
it "reads multiple keys and returns only the matched ones" do
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,95 +1,114 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis-activesupport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
5
|
-
prerelease:
|
4
|
+
version: 3.2.4
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Luca Guidi
|
9
|
-
- Matt Horan
|
10
8
|
autorequire:
|
11
9
|
bindir: bin
|
12
10
|
cert_chain: []
|
13
|
-
date:
|
11
|
+
date: 2013-08-29 00:00:00.000000000 Z
|
14
12
|
dependencies:
|
15
13
|
- !ruby/object:Gem::Dependency
|
16
14
|
name: redis-store
|
17
|
-
requirement:
|
18
|
-
none: false
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
19
16
|
requirements:
|
20
17
|
- - ~>
|
21
18
|
- !ruby/object:Gem::Version
|
22
19
|
version: 1.1.0
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
|
-
version_requirements:
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.1.0
|
26
27
|
- !ruby/object:Gem::Dependency
|
27
28
|
name: activesupport
|
28
|
-
requirement:
|
29
|
-
none: false
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 3.2.
|
33
|
+
version: 3.2.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements:
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ~>
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 3.2.0
|
37
41
|
- !ruby/object:Gem::Dependency
|
38
42
|
name: rake
|
39
|
-
requirement:
|
40
|
-
none: false
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
41
44
|
requirements:
|
42
45
|
- - ~>
|
43
46
|
- !ruby/object:Gem::Version
|
44
|
-
version:
|
47
|
+
version: '10'
|
45
48
|
type: :development
|
46
49
|
prerelease: false
|
47
|
-
version_requirements:
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ~>
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '10'
|
48
55
|
- !ruby/object:Gem::Dependency
|
49
56
|
name: bundler
|
50
|
-
requirement:
|
51
|
-
none: false
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
52
58
|
requirements:
|
53
59
|
- - ~>
|
54
60
|
- !ruby/object:Gem::Version
|
55
|
-
version: 1.
|
61
|
+
version: '1.3'
|
56
62
|
type: :development
|
57
63
|
prerelease: false
|
58
|
-
version_requirements:
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ~>
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '1.3'
|
59
69
|
- !ruby/object:Gem::Dependency
|
60
70
|
name: mocha
|
61
|
-
requirement:
|
62
|
-
none: false
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
63
72
|
requirements:
|
64
73
|
- - ~>
|
65
74
|
- !ruby/object:Gem::Version
|
66
|
-
version: 0.
|
75
|
+
version: 0.14.0
|
67
76
|
type: :development
|
68
77
|
prerelease: false
|
69
|
-
version_requirements:
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ~>
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.14.0
|
70
83
|
- !ruby/object:Gem::Dependency
|
71
84
|
name: minitest
|
72
|
-
requirement:
|
73
|
-
none: false
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
74
86
|
requirements:
|
75
87
|
- - ~>
|
76
88
|
- !ruby/object:Gem::Version
|
77
|
-
version: 2
|
89
|
+
version: '4.2'
|
78
90
|
type: :development
|
79
91
|
prerelease: false
|
80
|
-
version_requirements:
|
81
|
-
- !ruby/object:Gem::Dependency
|
82
|
-
name: purdytest
|
83
|
-
requirement: &70168723140620 !ruby/object:Gem::Requirement
|
84
|
-
none: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
93
|
requirements:
|
86
94
|
- - ~>
|
87
95
|
- !ruby/object:Gem::Version
|
88
|
-
version:
|
96
|
+
version: '4.2'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: redis-store-testing
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '>='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0'
|
89
104
|
type: :development
|
90
105
|
prerelease: false
|
91
|
-
version_requirements:
|
92
|
-
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '>='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
description: Redis store for ActiveSupport
|
93
112
|
email:
|
94
113
|
- me@lucaguidi.com
|
95
114
|
executables: []
|
@@ -97,6 +116,7 @@ extensions: []
|
|
97
116
|
extra_rdoc_files: []
|
98
117
|
files:
|
99
118
|
- .gitignore
|
119
|
+
- .travis.yml
|
100
120
|
- Gemfile
|
101
121
|
- MIT-LICENSE
|
102
122
|
- README.md
|
@@ -108,30 +128,30 @@ files:
|
|
108
128
|
- test/active_support/cache/redis_store_test.rb
|
109
129
|
- test/redis/activesupport/version_test.rb
|
110
130
|
- test/test_helper.rb
|
111
|
-
homepage: http://
|
112
|
-
licenses:
|
131
|
+
homepage: http://redis-store.org/redis-activesupport
|
132
|
+
licenses:
|
133
|
+
- MIT
|
134
|
+
metadata: {}
|
113
135
|
post_install_message:
|
114
136
|
rdoc_options: []
|
115
137
|
require_paths:
|
116
138
|
- lib
|
117
139
|
required_ruby_version: !ruby/object:Gem::Requirement
|
118
|
-
none: false
|
119
140
|
requirements:
|
120
|
-
- -
|
141
|
+
- - '>='
|
121
142
|
- !ruby/object:Gem::Version
|
122
143
|
version: '0'
|
123
144
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
124
|
-
none: false
|
125
145
|
requirements:
|
126
|
-
- -
|
146
|
+
- - '>='
|
127
147
|
- !ruby/object:Gem::Version
|
128
148
|
version: '0'
|
129
149
|
requirements: []
|
130
150
|
rubyforge_project: redis-activesupport
|
131
|
-
rubygems_version:
|
151
|
+
rubygems_version: 2.0.3
|
132
152
|
signing_key:
|
133
|
-
specification_version:
|
134
|
-
summary: Redis store for ActiveSupport
|
153
|
+
specification_version: 4
|
154
|
+
summary: Redis store for ActiveSupport
|
135
155
|
test_files:
|
136
156
|
- test/active_support/cache/redis_store_test.rb
|
137
157
|
- test/redis/activesupport/version_test.rb
|