redis-rack 2.0.5 → 2.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/auto-assign-issues.yml +2 -0
- data/.ruby-version +1 -0
- data/.travis.yml +17 -10
- data/CHANGELOG.md +246 -0
- data/CODEOWNERS +1 -0
- data/Gemfile +3 -0
- data/lib/rack/session/redis.rb +24 -15
- data/lib/redis/rack/connection.rb +5 -1
- data/lib/redis/rack/version.rb +1 -2
- data/redis-rack.gemspec +3 -7
- data/test/rack/session/redis_test.rb +14 -8
- data/test/redis/rack/connection_test.rb +17 -0
- metadata +26 -48
- data/Appraisals +0 -7
- data/gemfiles/rack_1.gemfile +0 -7
- data/gemfiles/rack_2.gemfile +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 5f2e06d541ce7ff62d7050dc3191e5b975209c558de584ad5f9a5d09d3e837c8
|
4
|
+
data.tar.gz: fe1d5072ca29a096a1e2ee2ea14c6b7cbf1282326c929a499bf90a0e30be51e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c01e59a29fe6c2d589f7650de251facffbf49915bc91cda3bbf9b1cbabd6b03b574e1d509aea580af214e5aa5d9a395bbc8f6e74359768cc22548de403e47621
|
7
|
+
data.tar.gz: f997ed68a47b214def068eb0ef0d8788af496523da9347dda26022df640dd6375d24a6407d3d6a9f72713c8b2811e28048dc2daf2b0ef493b1ff9e6bcde86235
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.7.1
|
data/.travis.yml
CHANGED
@@ -1,16 +1,23 @@
|
|
1
1
|
language: ruby
|
2
|
-
script:
|
2
|
+
script: bundle exec rake
|
3
3
|
rvm:
|
4
|
-
- 2.2
|
5
|
-
- 2.3
|
4
|
+
- 2.2
|
5
|
+
- 2.3
|
6
|
+
- 2.4
|
7
|
+
- 2.5
|
8
|
+
- 2.6
|
9
|
+
- 2.7
|
6
10
|
- ruby-head
|
7
11
|
- jruby-head
|
8
|
-
|
9
12
|
matrix:
|
10
13
|
allow_failures:
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
- rvm: jruby-head
|
15
|
+
- rvm: ruby-head
|
16
|
+
deploy:
|
17
|
+
provider: rubygems
|
18
|
+
api_key:
|
19
|
+
secure: VTosVmCdLWUGK8KyzovYri7ySfd7fACtfL8MClEBBHnI+m2cLCpmtCJ7Z1X7z9BXlj974EDaF8V9iRKzfksXIf8aaPfVQw9AW94fLJZbfSB8YGOGyNbPu9YECoZQB1aZ2lw9s/aEdfwCbmqizO/fYpG3YoPKJdm1ZJpNOFR37Xk=
|
20
|
+
gem: redis-rack
|
21
|
+
on:
|
22
|
+
tags: true
|
23
|
+
repo: redis-store/redis-rack
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,246 @@
|
|
1
|
+
v2.1.0 (2020-01-13)
|
2
|
+
--------------------------------------------------------------------------------
|
3
|
+
|
4
|
+
* Update version to v2.1.0 final
|
5
|
+
Tom Scott
|
6
|
+
|
7
|
+
* Test against most recent versions of Ruby
|
8
|
+
Tom Scott
|
9
|
+
|
10
|
+
* Update gemspec to remove rubyforge_project
|
11
|
+
|
12
|
+
It is deprecated or removed already
|
13
|
+
|
14
|
+
Original warning message:
|
15
|
+
Gem::Specification#rubyforge_project= is deprecated with no replacement. It will be removed on or after 2019-12-01.
|
16
|
+
PikachuEXE
|
17
|
+
|
18
|
+
* back tests to original state
|
19
|
+
Alexey Vasiliev
|
20
|
+
|
21
|
+
* Fix redis-rack for rack 2.0.8, small improvements
|
22
|
+
Alexey Vasiliev
|
23
|
+
|
24
|
+
* Fix redis-rack for rack 2.0.8, fix generate_unique_sid
|
25
|
+
Alexey Vasiliev
|
26
|
+
|
27
|
+
* Fix redis-rack for rack 2.0.8
|
28
|
+
Alexey Vasiliev
|
29
|
+
|
30
|
+
* v2.1.0.pre: Update Rack Session API, drop support for Rack 1.0
|
31
|
+
Tom Scott
|
32
|
+
|
33
|
+
v2.0.6
|
34
|
+
--------------------------------------------------------------------------------
|
35
|
+
|
36
|
+
* v2.0.6: Prevent Connection Pool from passing nil options
|
37
|
+
Tom Scott
|
38
|
+
|
39
|
+
* Make bundler dependency more permissive to support future ruby versions
|
40
|
+
Tom Scott
|
41
|
+
|
42
|
+
* Drop support for Rack v1
|
43
|
+
Tom Scott
|
44
|
+
|
45
|
+
* Update Rack::Session API Compatibility
|
46
|
+
|
47
|
+
The latest version of Rack [deprecated subclassing Rack::Session::ID](https://github.com/rack/rack/blob/master/lib/rack/session/abstract/id.rb#L412-L419),
|
48
|
+
replacing it instead with `Rack::Session::Persisted`. Update the method
|
49
|
+
implementations in this gem to support the new API. Shoutouts to @onk
|
50
|
+
for actually writing this code, we're pulling it in from his fork.
|
51
|
+
Tom Scott
|
52
|
+
|
53
|
+
* Automatically assign issues to @tubbo when they are created
|
54
|
+
Tom Scott
|
55
|
+
|
56
|
+
* Automatically release to RubyGems when new tags are pushed to GitHub
|
57
|
+
Tom Scott
|
58
|
+
|
59
|
+
* Raise Error when `:redis_store` is Incorrect Type
|
60
|
+
|
61
|
+
Passing an object that isn't a `Redis::Store` into the session storage
|
62
|
+
configuration can cause errors when methods are called with more
|
63
|
+
arguments than the default Redis client can handle. These additional
|
64
|
+
arguments are used by `Rack::Session::Redis` to configure the key
|
65
|
+
namespace and TTL globally in the main configuration, and pass them down
|
66
|
+
to `Redis::Store` to be appended to the key. An `ArgumentError` will now
|
67
|
+
be thrown when a `:redis_store` is of a type that isn't a `Redis::Store`
|
68
|
+
(or a subclass thereof).
|
69
|
+
|
70
|
+
Resolves #46
|
71
|
+
Tom Scott
|
72
|
+
|
73
|
+
* Add code owners
|
74
|
+
Tom Scott
|
75
|
+
|
76
|
+
* Do not provide nil values for missing connection pool options
|
77
|
+
|
78
|
+
Fixes #44
|
79
|
+
Jake Goulding
|
80
|
+
|
81
|
+
v2.0.5
|
82
|
+
--------------------------------------------------------------------------------
|
83
|
+
|
84
|
+
* v2.0.5 release
|
85
|
+
Tom Scott
|
86
|
+
|
87
|
+
* add spec to validate blank sessions are not stored in redis
|
88
|
+
mstruve
|
89
|
+
|
90
|
+
* dont store a blank session in redis
|
91
|
+
mstruve
|
92
|
+
|
93
|
+
* Add documentation for options
|
94
|
+
Daniel M Barlow
|
95
|
+
|
96
|
+
v2.0.4
|
97
|
+
--------------------------------------------------------------------------------
|
98
|
+
|
99
|
+
* Release 2.0.4
|
100
|
+
Tom Scott
|
101
|
+
|
102
|
+
* Remove .ruby-version
|
103
|
+
Tom Scott
|
104
|
+
|
105
|
+
* Remove rake, appraisal from gemspec executables
|
106
|
+
|
107
|
+
The contents of the bin directory are binstubs to assist development.
|
108
|
+
They are not intended to be shipped with the gem itself. This commit
|
109
|
+
updates the gemspec to ensure that they are not exposed to rubygems as
|
110
|
+
executables for redis-rack, which will fix conflicts with the legitimate
|
111
|
+
rake and appraisal executables provided by those other gems.
|
112
|
+
Matt Brictson
|
113
|
+
|
114
|
+
v2.0.3
|
115
|
+
--------------------------------------------------------------------------------
|
116
|
+
|
117
|
+
* v2.0.3: Avoid mutex locking with global option
|
118
|
+
Tom Scott
|
119
|
+
|
120
|
+
* Restore default_options in #generate_unique_sid
|
121
|
+
Tom Scott
|
122
|
+
|
123
|
+
* Refactor connection_pool code
|
124
|
+
|
125
|
+
Adds a `Redis::Rack::Connection` object for handling the instantiation
|
126
|
+
of a `Redis::Store` or a `ConnectionPool` if pool configuration is
|
127
|
+
given. Restores the purpose of `Rack::Session::Redis` to only implement
|
128
|
+
the session ID abstract API provided by Rack.
|
129
|
+
Tom Scott
|
130
|
+
|
131
|
+
* Rename :use_global_lock option to :threadsafe to match Rails
|
132
|
+
Garrett Thornburg
|
133
|
+
|
134
|
+
* Use mocha mocks to assert the mutex is never locked
|
135
|
+
Garrett Thornburg
|
136
|
+
|
137
|
+
* Allow redis-store v1.4
|
138
|
+
Shane O'Grady
|
139
|
+
|
140
|
+
* Create a :use_global_lock option that avoids the global lock
|
141
|
+
Garrett Thornburg
|
142
|
+
|
143
|
+
* Rake task for running all tests on all gem versions
|
144
|
+
Tom Scott
|
145
|
+
|
146
|
+
* Install Appraisal so we can test against multiple versions of Rack
|
147
|
+
Tom Scott
|
148
|
+
|
149
|
+
v2.0.2
|
150
|
+
--------------------------------------------------------------------------------
|
151
|
+
|
152
|
+
* v2.0.2: Resolve regression forcing Rack 2.x and above
|
153
|
+
Tom Scott
|
154
|
+
|
155
|
+
v2.0.1
|
156
|
+
--------------------------------------------------------------------------------
|
157
|
+
|
158
|
+
* v2.0.1: Relax gem dependencies
|
159
|
+
Tom Scott
|
160
|
+
|
161
|
+
* smoothen redis-store dependency
|
162
|
+
Mathieu Jobin
|
163
|
+
|
164
|
+
* Drop support for Rubinius 1.9 mode
|
165
|
+
|
166
|
+
1.9.x is EOL in MRI Ruby Land, and Rubinius 1.9 mode isn't really used
|
167
|
+
much anymore. This should make the builds pass again.
|
168
|
+
Tom Scott
|
169
|
+
|
170
|
+
* Update README.md (#20)
|
171
|
+
Nicolas
|
172
|
+
|
173
|
+
* Remove jruby 1.9 mode from the build matrix
|
174
|
+
Tom Scott
|
175
|
+
|
176
|
+
* Remove test because why
|
177
|
+
Tom Scott
|
178
|
+
|
179
|
+
v2.0.0
|
180
|
+
--------------------------------------------------------------------------------
|
181
|
+
|
182
|
+
* v2.0: Drop support for Ruby below 2.2 (thanks @connorshea)
|
183
|
+
|
184
|
+
Fixes #17, major shoutouts to @connorshea for getting this off the
|
185
|
+
ground. This also edits the CI config to drop support for older Ruby
|
186
|
+
versions.
|
187
|
+
Tom Scott
|
188
|
+
|
189
|
+
* Fix gem dependency versions
|
190
|
+
Tom Scott
|
191
|
+
|
192
|
+
* v2.0.0.pre Add support for Rails 5 and Rack 2.
|
193
|
+
Tom Scott
|
194
|
+
|
195
|
+
* v2.0.0: Upgrade to Rack 2.0
|
196
|
+
|
197
|
+
This release includes some backwards-incompatible changes that pertain
|
198
|
+
to Rails' upgrade to Rack 2.x.
|
199
|
+
Tom Scott
|
200
|
+
|
201
|
+
* Update README
|
202
|
+
Tom Scott
|
203
|
+
|
204
|
+
* Fix readme
|
205
|
+
Tom Scott
|
206
|
+
|
207
|
+
* travis.yml add Ruby 2.3.0
|
208
|
+
shiro16
|
209
|
+
|
210
|
+
* add 2.1 and 2.2 rubies to travis
|
211
|
+
Marc Roberts
|
212
|
+
|
213
|
+
* Remove support for Ruby 1.9
|
214
|
+
Marc Roberts
|
215
|
+
|
216
|
+
* Loosen dependancy on Rack to allow 1.5 and 2.x
|
217
|
+
|
218
|
+
Rails 5 beta requires Rack 2.x and this gem is unusable unless can use Rack 2.x
|
219
|
+
Marc Roberts
|
220
|
+
|
221
|
+
* Update README.md
|
222
|
+
Ryan Bigg
|
223
|
+
|
224
|
+
* add support for ConnectionPool
|
225
|
+
Roman Usherenko
|
226
|
+
|
227
|
+
* Introduce redis_store option (closes #1)
|
228
|
+
Kurakin Alexander
|
229
|
+
|
230
|
+
* Atomically lock session id and implement skip support.
|
231
|
+
W. Andrew Loe III
|
232
|
+
|
233
|
+
v1.5.0
|
234
|
+
------
|
235
|
+
|
236
|
+
* Enable CI
|
237
|
+
Luca Guidi
|
238
|
+
|
239
|
+
* Update README.md
|
240
|
+
Luca Guidi
|
241
|
+
|
242
|
+
* Moved back from jodosha/redis-store
|
243
|
+
Luca Guidi
|
244
|
+
|
245
|
+
* Moved
|
246
|
+
Luca Guidi
|
data/CODEOWNERS
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
* @tubbo
|
data/Gemfile
CHANGED
data/lib/rack/session/redis.rb
CHANGED
@@ -5,7 +5,7 @@ require 'redis/rack/connection'
|
|
5
5
|
|
6
6
|
module Rack
|
7
7
|
module Session
|
8
|
-
class Redis < Abstract::
|
8
|
+
class Redis < Abstract::PersistedSecure
|
9
9
|
attr_reader :mutex
|
10
10
|
|
11
11
|
DEFAULT_OPTIONS = Abstract::ID::DEFAULT_OPTIONS.merge(
|
@@ -24,18 +24,18 @@ module Rack
|
|
24
24
|
loop do
|
25
25
|
sid = generate_sid
|
26
26
|
first = with do |c|
|
27
|
-
[*c.setnx(sid, session, @default_options)].first
|
27
|
+
[*c.setnx(sid.private_id, session, @default_options.to_hash)].first
|
28
28
|
end
|
29
29
|
break sid if [1, true].include?(first)
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
def
|
34
|
-
if
|
33
|
+
def find_session(req, sid)
|
34
|
+
if req.session.options[:skip]
|
35
35
|
[generate_sid, {}]
|
36
36
|
else
|
37
|
-
with_lock(
|
38
|
-
unless sid and session =
|
37
|
+
with_lock(req, [nil, {}]) do
|
38
|
+
unless sid and session = get_session_with_fallback(sid)
|
39
39
|
session = {}
|
40
40
|
sid = generate_unique_sid(session)
|
41
41
|
end
|
@@ -44,16 +44,19 @@ module Rack
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
-
def
|
48
|
-
with_lock(
|
49
|
-
with { |c| c.set
|
50
|
-
|
47
|
+
def write_session(req, sid, new_session, options = {})
|
48
|
+
with_lock(req, false) do
|
49
|
+
with { |c| c.set(sid.private_id, new_session, options.to_hash) }
|
50
|
+
sid
|
51
51
|
end
|
52
52
|
end
|
53
53
|
|
54
|
-
def
|
55
|
-
with_lock(
|
56
|
-
with
|
54
|
+
def delete_session(req, sid, options)
|
55
|
+
with_lock(req) do
|
56
|
+
with do |c|
|
57
|
+
c.del(sid.public_id)
|
58
|
+
c.del(sid.private_id)
|
59
|
+
end
|
57
60
|
generate_sid unless options[:drop]
|
58
61
|
end
|
59
62
|
end
|
@@ -62,8 +65,8 @@ module Rack
|
|
62
65
|
@default_options.fetch(:threadsafe, true)
|
63
66
|
end
|
64
67
|
|
65
|
-
def with_lock(
|
66
|
-
@mutex.lock if
|
68
|
+
def with_lock(req, default = nil)
|
69
|
+
@mutex.lock if req.multithread? && threadsafe?
|
67
70
|
yield
|
68
71
|
rescue Errno::ECONNREFUSED
|
69
72
|
if $VERBOSE
|
@@ -78,6 +81,12 @@ module Rack
|
|
78
81
|
def with(&block)
|
79
82
|
@conn.with(&block)
|
80
83
|
end
|
84
|
+
|
85
|
+
private
|
86
|
+
|
87
|
+
def get_session_with_fallback(sid)
|
88
|
+
with { |c| c.get(sid.private_id) || c.get(sid.public_id) }
|
89
|
+
end
|
81
90
|
end
|
82
91
|
end
|
83
92
|
end
|
@@ -9,6 +9,10 @@ class Redis
|
|
9
9
|
if @pool && !@pool.is_a?(ConnectionPool)
|
10
10
|
raise ArgumentError, "pool must be an instance of ConnectionPool"
|
11
11
|
end
|
12
|
+
|
13
|
+
if @store && !@store.is_a?(Redis::Store)
|
14
|
+
raise ArgumentError, "redis_store must be an instance of Redis::Store (currently #{@store.class.name})"
|
15
|
+
end
|
12
16
|
end
|
13
17
|
|
14
18
|
def with(&block)
|
@@ -35,7 +39,7 @@ class Redis
|
|
35
39
|
{
|
36
40
|
size: @options[:pool_size],
|
37
41
|
timeout: @options[:pool_timeout]
|
38
|
-
}
|
42
|
+
}.reject { |key, value| value.nil? }.to_h
|
39
43
|
end
|
40
44
|
end
|
41
45
|
end
|
data/lib/redis/rack/version.rb
CHANGED
data/redis-rack.gemspec
CHANGED
@@ -12,22 +12,18 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.description = %q{Redis Store for Rack applications}
|
13
13
|
s.license = 'MIT'
|
14
14
|
|
15
|
-
s.rubyforge_project = 'redis-rack'
|
16
|
-
|
17
15
|
s.files = `git ls-files`.split("\n")
|
18
16
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
19
17
|
s.executables = []
|
20
18
|
s.require_paths = ["lib"]
|
21
19
|
|
22
20
|
s.add_runtime_dependency 'redis-store', ['< 2', '>= 1.2']
|
23
|
-
s.add_runtime_dependency 'rack', '>=
|
21
|
+
s.add_runtime_dependency 'rack', '>= 2.0.8', '< 3'
|
24
22
|
|
25
|
-
s.add_development_dependency 'rake', '
|
26
|
-
s.add_development_dependency 'bundler', '
|
23
|
+
s.add_development_dependency 'rake', '>= 12.3.3'
|
24
|
+
s.add_development_dependency 'bundler', '> 1', '< 3'
|
27
25
|
s.add_development_dependency 'mocha', '~> 0.14.0'
|
28
26
|
s.add_development_dependency 'minitest', '~> 5'
|
29
|
-
s.add_development_dependency 'redis-store-testing'
|
30
27
|
s.add_development_dependency 'connection_pool', '~> 1.2.0'
|
31
|
-
s.add_development_dependency 'appraisal'
|
32
28
|
end
|
33
29
|
|
@@ -93,7 +93,7 @@ describe Rack::Session::Redis do
|
|
93
93
|
it "does not store a blank session" do
|
94
94
|
session_store = Rack::Session::Redis.new(incrementor)
|
95
95
|
sid = session_store.generate_unique_sid({})
|
96
|
-
session_store.with { |c| c.get(sid).must_be_nil }
|
96
|
+
session_store.with { |c| c.get(sid.private_id).must_be_nil }
|
97
97
|
end
|
98
98
|
|
99
99
|
it "locks the store mutex" do
|
@@ -102,7 +102,9 @@ describe Rack::Session::Redis do
|
|
102
102
|
sesion_store = Rack::Session::Redis.new(incrementor)
|
103
103
|
sesion_store.instance_variable_set(:@mutex, mutex)
|
104
104
|
was_yielded = false
|
105
|
-
|
105
|
+
request = Minitest::Mock.new
|
106
|
+
request.expect(:multithread?, true)
|
107
|
+
sesion_store.with_lock(request) { was_yielded = true}
|
106
108
|
was_yielded.must_equal(true)
|
107
109
|
end
|
108
110
|
|
@@ -118,7 +120,9 @@ describe Rack::Session::Redis do
|
|
118
120
|
sesion_store = Rack::Session::Redis.new(incrementor, :threadsafe => false)
|
119
121
|
sesion_store.instance_variable_set(:@mutex, mutex)
|
120
122
|
was_yielded = false
|
121
|
-
|
123
|
+
request = Minitest::Mock.new
|
124
|
+
request.expect(:multithread?, true)
|
125
|
+
sesion_store.with_lock(request) { was_yielded = true}
|
122
126
|
was_yielded.must_equal(true)
|
123
127
|
end
|
124
128
|
end
|
@@ -295,10 +299,11 @@ describe Rack::Session::Redis do
|
|
295
299
|
|
296
300
|
res0 = req.get("/")
|
297
301
|
session_id = (cookie = res0["Set-Cookie"])[session_match, 1]
|
298
|
-
|
302
|
+
sid = Rack::Session::SessionId.new(session_id)
|
303
|
+
ses0 = pool.with { |c| c.get(sid.private_id) }
|
299
304
|
|
300
305
|
req.get("/", "HTTP_COOKIE" => cookie)
|
301
|
-
ses1 = pool.with { |c| c.get(
|
306
|
+
ses1 = pool.with { |c| c.get(sid.private_id) }
|
302
307
|
|
303
308
|
ses1.wont_equal(ses0)
|
304
309
|
end
|
@@ -318,6 +323,7 @@ describe Rack::Session::Redis do
|
|
318
323
|
res.body.must_equal('{"counter"=>1}')
|
319
324
|
cookie = res["Set-Cookie"]
|
320
325
|
session_id = cookie[session_match, 1]
|
326
|
+
sid = Rack::Session::SessionId.new(session_id)
|
321
327
|
|
322
328
|
delta_incrementor = lambda do |env|
|
323
329
|
# emulate disconjoinment of threading
|
@@ -339,7 +345,7 @@ describe Rack::Session::Redis do
|
|
339
345
|
request.body.must_include('"counter"=>2')
|
340
346
|
end
|
341
347
|
|
342
|
-
session = pool.with { |c| c.get(
|
348
|
+
session = pool.with { |c| c.get(sid.private_id) }
|
343
349
|
session.size.must_equal(tnum+1) # counter
|
344
350
|
session['counter'].must_equal(2) # meeeh
|
345
351
|
|
@@ -356,7 +362,7 @@ describe Rack::Session::Redis do
|
|
356
362
|
request.body.must_include('"counter"=>3')
|
357
363
|
end
|
358
364
|
|
359
|
-
session = pool.with { |c| c.get(
|
365
|
+
session = pool.with { |c| c.get(sid.private_id) }
|
360
366
|
session.size.must_equal(tnum+1)
|
361
367
|
session['counter'].must_equal(3)
|
362
368
|
|
@@ -378,7 +384,7 @@ describe Rack::Session::Redis do
|
|
378
384
|
request.body.must_include('"foo"=>"bar"')
|
379
385
|
end
|
380
386
|
|
381
|
-
session = pool.with { |c| c.get(
|
387
|
+
session = pool.with { |c| c.get(sid.private_id) }
|
382
388
|
session.size.must_equal(r.size+1)
|
383
389
|
session['counter'].must_be_nil
|
384
390
|
session['foo'].must_equal('bar')
|
@@ -56,12 +56,29 @@ class Redis
|
|
56
56
|
conn.store.must_equal(store)
|
57
57
|
end
|
58
58
|
|
59
|
+
it "throws an error when provided Redis store is not the expected type" do
|
60
|
+
assert_raises ArgumentError do
|
61
|
+
Connection.new(redis_store: ::Redis.new)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
59
65
|
it "uses the specified Redis server when provided" do
|
60
66
|
conn = Connection.new(redis_server: 'redis://127.0.0.1:6380/1')
|
61
67
|
|
62
68
|
conn.pooled?.must_equal false
|
63
69
|
conn.store.to_s.must_match(/127\.0\.0\.1:6380 against DB 1$/)
|
64
70
|
end
|
71
|
+
|
72
|
+
it "does not include nil options for the connection pool" do
|
73
|
+
conn = Connection.new
|
74
|
+
conn.pool_options.must_be_empty
|
75
|
+
|
76
|
+
conn = Connection.new(pool_size: nil)
|
77
|
+
conn.pool_options.must_be_empty
|
78
|
+
|
79
|
+
conn = Connection.new(pool_timeout: nil)
|
80
|
+
conn.pool_options.must_be_empty
|
81
|
+
end
|
65
82
|
end
|
66
83
|
end
|
67
84
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis-rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Luca Guidi
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-08-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis-store
|
@@ -36,7 +36,7 @@ dependencies:
|
|
36
36
|
requirements:
|
37
37
|
- - ">="
|
38
38
|
- !ruby/object:Gem::Version
|
39
|
-
version:
|
39
|
+
version: 2.0.8
|
40
40
|
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '3'
|
@@ -46,7 +46,7 @@ dependencies:
|
|
46
46
|
requirements:
|
47
47
|
- - ">="
|
48
48
|
- !ruby/object:Gem::Version
|
49
|
-
version:
|
49
|
+
version: 2.0.8
|
50
50
|
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
52
|
version: '3'
|
@@ -54,30 +54,36 @@ dependencies:
|
|
54
54
|
name: rake
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
|
-
- - "
|
57
|
+
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
|
-
version:
|
59
|
+
version: 12.3.3
|
60
60
|
type: :development
|
61
61
|
prerelease: false
|
62
62
|
version_requirements: !ruby/object:Gem::Requirement
|
63
63
|
requirements:
|
64
|
-
- - "
|
64
|
+
- - ">="
|
65
65
|
- !ruby/object:Gem::Version
|
66
|
-
version:
|
66
|
+
version: 12.3.3
|
67
67
|
- !ruby/object:Gem::Dependency
|
68
68
|
name: bundler
|
69
69
|
requirement: !ruby/object:Gem::Requirement
|
70
70
|
requirements:
|
71
|
-
- - "
|
71
|
+
- - ">"
|
72
72
|
- !ruby/object:Gem::Version
|
73
|
-
version: '1
|
73
|
+
version: '1'
|
74
|
+
- - "<"
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '3'
|
74
77
|
type: :development
|
75
78
|
prerelease: false
|
76
79
|
version_requirements: !ruby/object:Gem::Requirement
|
77
80
|
requirements:
|
78
|
-
- - "
|
81
|
+
- - ">"
|
79
82
|
- !ruby/object:Gem::Version
|
80
|
-
version: '1
|
83
|
+
version: '1'
|
84
|
+
- - "<"
|
85
|
+
- !ruby/object:Gem::Version
|
86
|
+
version: '3'
|
81
87
|
- !ruby/object:Gem::Dependency
|
82
88
|
name: mocha
|
83
89
|
requirement: !ruby/object:Gem::Requirement
|
@@ -106,20 +112,6 @@ dependencies:
|
|
106
112
|
- - "~>"
|
107
113
|
- !ruby/object:Gem::Version
|
108
114
|
version: '5'
|
109
|
-
- !ruby/object:Gem::Dependency
|
110
|
-
name: redis-store-testing
|
111
|
-
requirement: !ruby/object:Gem::Requirement
|
112
|
-
requirements:
|
113
|
-
- - ">="
|
114
|
-
- !ruby/object:Gem::Version
|
115
|
-
version: '0'
|
116
|
-
type: :development
|
117
|
-
prerelease: false
|
118
|
-
version_requirements: !ruby/object:Gem::Requirement
|
119
|
-
requirements:
|
120
|
-
- - ">="
|
121
|
-
- !ruby/object:Gem::Version
|
122
|
-
version: '0'
|
123
115
|
- !ruby/object:Gem::Dependency
|
124
116
|
name: connection_pool
|
125
117
|
requirement: !ruby/object:Gem::Requirement
|
@@ -134,20 +126,6 @@ dependencies:
|
|
134
126
|
- - "~>"
|
135
127
|
- !ruby/object:Gem::Version
|
136
128
|
version: 1.2.0
|
137
|
-
- !ruby/object:Gem::Dependency
|
138
|
-
name: appraisal
|
139
|
-
requirement: !ruby/object:Gem::Requirement
|
140
|
-
requirements:
|
141
|
-
- - ">="
|
142
|
-
- !ruby/object:Gem::Version
|
143
|
-
version: '0'
|
144
|
-
type: :development
|
145
|
-
prerelease: false
|
146
|
-
version_requirements: !ruby/object:Gem::Requirement
|
147
|
-
requirements:
|
148
|
-
- - ">="
|
149
|
-
- !ruby/object:Gem::Version
|
150
|
-
version: '0'
|
151
129
|
description: Redis Store for Rack applications
|
152
130
|
email:
|
153
131
|
- me@lucaguidi.com
|
@@ -155,17 +133,18 @@ executables: []
|
|
155
133
|
extensions: []
|
156
134
|
extra_rdoc_files: []
|
157
135
|
files:
|
136
|
+
- ".github/auto-assign-issues.yml"
|
158
137
|
- ".gitignore"
|
138
|
+
- ".ruby-version"
|
159
139
|
- ".travis.yml"
|
160
|
-
-
|
140
|
+
- CHANGELOG.md
|
141
|
+
- CODEOWNERS
|
161
142
|
- Gemfile
|
162
143
|
- MIT-LICENSE
|
163
144
|
- README.md
|
164
145
|
- Rakefile
|
165
146
|
- bin/appraisal
|
166
147
|
- bin/rake
|
167
|
-
- gemfiles/rack_1.gemfile
|
168
|
-
- gemfiles/rack_2.gemfile
|
169
148
|
- lib/rack/session/redis.rb
|
170
149
|
- lib/redis-rack.rb
|
171
150
|
- lib/redis/rack/connection.rb
|
@@ -178,7 +157,7 @@ homepage: http://redis-store.org/redis-rack
|
|
178
157
|
licenses:
|
179
158
|
- MIT
|
180
159
|
metadata: {}
|
181
|
-
post_install_message:
|
160
|
+
post_install_message:
|
182
161
|
rdoc_options: []
|
183
162
|
require_paths:
|
184
163
|
- lib
|
@@ -193,9 +172,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
193
172
|
- !ruby/object:Gem::Version
|
194
173
|
version: '0'
|
195
174
|
requirements: []
|
196
|
-
|
197
|
-
|
198
|
-
signing_key:
|
175
|
+
rubygems_version: 3.1.2
|
176
|
+
signing_key:
|
199
177
|
specification_version: 4
|
200
178
|
summary: Redis Store for Rack
|
201
179
|
test_files:
|
data/Appraisals
DELETED
data/gemfiles/rack_1.gemfile
DELETED