redis-rack 2.1.2 → 2.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/Gemfile +3 -2
- data/lib/rack/session/redis.rb +4 -4
- data/lib/redis/rack/connection.rb +5 -1
- data/lib/redis/rack/version.rb +1 -1
- data/redis-rack.gemspec +1 -1
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8fe2b21455a3af95982db86314846abed8b97be35712009a6c720b1fe8a0e3f
|
4
|
+
data.tar.gz: 99c15862e3d1e7c1d16d460da299fcc0dc551a606ce9731710f153f51f3b6196
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ef8ef0c5c0286d5df01ee90df055e19ef90969f11b0568a681e64f1955558837584504c5a1b62c8cfc5e7b6fead33cdfa39741f8048ecf787457cb85c7910e6d
|
7
|
+
data.tar.gz: e3f5a9642b8f50e9da6cc05f9387d7acca8245bd702e8f795690b383b6fe253ec037ab930e68a282c37e32f139956e00e6a9a5137dae5957cb03e332cfe057a4
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.7.1
|
data/Gemfile
CHANGED
data/lib/rack/session/redis.rb
CHANGED
@@ -24,7 +24,7 @@ module Rack
|
|
24
24
|
loop do
|
25
25
|
sid = generate_sid
|
26
26
|
first = with do |c|
|
27
|
-
[*c.setnx(sid.private_id, 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
|
@@ -44,9 +44,9 @@ module Rack
|
|
44
44
|
end
|
45
45
|
end
|
46
46
|
|
47
|
-
def write_session(req, sid, new_session, options)
|
47
|
+
def write_session(req, sid, new_session, options = {})
|
48
48
|
with_lock(req, false) do
|
49
|
-
with { |c| c.set
|
49
|
+
with { |c| c.set(sid.private_id, new_session, options.to_hash) }
|
50
50
|
sid
|
51
51
|
end
|
52
52
|
end
|
@@ -65,7 +65,7 @@ module Rack
|
|
65
65
|
@default_options.fetch(:threadsafe, true)
|
66
66
|
end
|
67
67
|
|
68
|
-
def with_lock(req, default=nil)
|
68
|
+
def with_lock(req, default = nil)
|
69
69
|
@mutex.lock if req.multithread? && threadsafe?
|
70
70
|
yield
|
71
71
|
rescue Errno::ECONNREFUSED
|
@@ -1,6 +1,8 @@
|
|
1
1
|
class Redis
|
2
2
|
module Rack
|
3
3
|
class Connection
|
4
|
+
POOL_KEYS = %i[pool pool_size pool_timeout].freeze
|
5
|
+
|
4
6
|
def initialize(options = {})
|
5
7
|
@options = options
|
6
8
|
@store = options[:redis_store]
|
@@ -24,7 +26,9 @@ class Redis
|
|
24
26
|
end
|
25
27
|
|
26
28
|
def pooled?
|
27
|
-
|
29
|
+
return @pooled if defined?(@pooled)
|
30
|
+
|
31
|
+
@pooled = POOL_KEYS.any? { |key| @options.key?(key) }
|
28
32
|
end
|
29
33
|
|
30
34
|
def pool
|
data/lib/redis/rack/version.rb
CHANGED
data/redis-rack.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.add_runtime_dependency 'redis-store', ['< 2', '>= 1.2']
|
21
21
|
s.add_runtime_dependency 'rack', '>= 2.0.8', '< 3'
|
22
22
|
|
23
|
-
s.add_development_dependency 'rake', '
|
23
|
+
s.add_development_dependency 'rake', '>= 12.3.3'
|
24
24
|
s.add_development_dependency 'bundler', '> 1', '< 3'
|
25
25
|
s.add_development_dependency 'mocha', '~> 0.14.0'
|
26
26
|
s.add_development_dependency 'minitest', '~> 5'
|
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.1.
|
4
|
+
version: 2.1.4
|
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: 2022-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: redis-store
|
@@ -54,16 +54,16 @@ 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
|
@@ -157,7 +157,7 @@ homepage: http://redis-store.org/redis-rack
|
|
157
157
|
licenses:
|
158
158
|
- MIT
|
159
159
|
metadata: {}
|
160
|
-
post_install_message:
|
160
|
+
post_install_message:
|
161
161
|
rdoc_options: []
|
162
162
|
require_paths:
|
163
163
|
- lib
|
@@ -173,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
173
173
|
version: '0'
|
174
174
|
requirements: []
|
175
175
|
rubygems_version: 3.1.2
|
176
|
-
signing_key:
|
176
|
+
signing_key:
|
177
177
|
specification_version: 4
|
178
178
|
summary: Redis Store for Rack
|
179
179
|
test_files:
|