redis-session-store 0.11.1 → 0.11.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -3
- data/.travis.yml +8 -6
- data/AUTHORS.md +1 -0
- data/CHANGELOG.md +4 -0
- data/lib/redis-session-store.rb +12 -2
- data/redis-session-store.gemspec +1 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26ff10b9f32cb399a27355db6209d933957bedc5def7e5671bc8491aee0e9114
|
4
|
+
data.tar.gz: b60fcf186f22a116013d17628bd53056505e1cf9fc392ced60b9072e86a95e20
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 977cad8b272aed6334f68ccec5b861262a5fc1a2729b3f86bcb36097278fc5da9837c95f434328c3d421aafcaac3eba2c2b04c6429f20f1d40a324c1e82ab607
|
7
|
+
data.tar.gz: 45f5e777113518ca666417a38e0df124760aaf64d5d0624de16b8b8be03b8c835c5d77e838341e79d90c0564f842975f6adf28a40a3b3bea8faa090ddc51813c
|
data/.rubocop.yml
CHANGED
@@ -4,17 +4,17 @@ AllCops:
|
|
4
4
|
- 'Rakefile'
|
5
5
|
- 'vendor/**/*'
|
6
6
|
|
7
|
-
FileName:
|
7
|
+
Naming/FileName:
|
8
8
|
Enabled: false
|
9
9
|
|
10
|
-
DoubleNegation:
|
10
|
+
Style/DoubleNegation:
|
11
11
|
Enabled: false
|
12
12
|
|
13
13
|
Metrics/BlockLength:
|
14
14
|
Exclude:
|
15
15
|
- 'spec/**/*.rb'
|
16
16
|
|
17
|
-
|
17
|
+
Layout/LineLength:
|
18
18
|
Max: 100
|
19
19
|
|
20
20
|
Metrics/ClassLength:
|
data/.travis.yml
CHANGED
@@ -1,14 +1,16 @@
|
|
1
1
|
language: ruby
|
2
2
|
cache: bundler
|
3
3
|
rvm:
|
4
|
-
- 2.3
|
5
|
-
- 2.4
|
6
|
-
- 2.5
|
7
|
-
- 2.6
|
8
|
-
-
|
4
|
+
- 2.3
|
5
|
+
- 2.4
|
6
|
+
- 2.5
|
7
|
+
- 2.6
|
8
|
+
- ruby-head
|
9
|
+
- jruby-9.2.9.0
|
9
10
|
matrix:
|
10
11
|
allow_failures:
|
11
|
-
- rvm:
|
12
|
+
- rvm: ruby-head
|
13
|
+
- rvm: jruby-9.2.9.0
|
12
14
|
notifications:
|
13
15
|
email: false
|
14
16
|
deploy:
|
data/AUTHORS.md
CHANGED
data/CHANGELOG.md
CHANGED
data/lib/redis-session-store.rb
CHANGED
@@ -3,7 +3,7 @@ require 'redis'
|
|
3
3
|
# Redis session storage for Rails, and for Rails only. Derived from
|
4
4
|
# the MemCacheStore code, simply dropping in Redis instead.
|
5
5
|
class RedisSessionStore < ActionDispatch::Session::AbstractStore
|
6
|
-
VERSION = '0.11.
|
6
|
+
VERSION = '0.11.2'.freeze
|
7
7
|
# Rails 3.1 and beyond defines the constant elsewhere
|
8
8
|
unless defined?(ENV_SESSION_OPTIONS_KEY)
|
9
9
|
ENV_SESSION_OPTIONS_KEY = if Rack.release.split('.').first.to_i > 1
|
@@ -67,7 +67,7 @@ class RedisSessionStore < ActionDispatch::Session::AbstractStore
|
|
67
67
|
|
68
68
|
!!(
|
69
69
|
value && !value.empty? &&
|
70
|
-
|
70
|
+
key_exists?(value)
|
71
71
|
)
|
72
72
|
rescue Errno::ECONNREFUSED, Redis::CannotConnectError => e
|
73
73
|
on_redis_down.call(e, env, value) if on_redis_down
|
@@ -75,6 +75,16 @@ class RedisSessionStore < ActionDispatch::Session::AbstractStore
|
|
75
75
|
true
|
76
76
|
end
|
77
77
|
|
78
|
+
def key_exists?(value)
|
79
|
+
if redis.respond_to?(:exists?)
|
80
|
+
# added in redis gem v4.2
|
81
|
+
redis.exists?(prefixed(value))
|
82
|
+
else
|
83
|
+
# older method, will return an integer starting in redis gem v4.3
|
84
|
+
redis.exists(prefixed(value))
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
78
88
|
def verify_handlers!
|
79
89
|
%w(on_redis_down on_session_load_error).each do |h|
|
80
90
|
next unless (handler = public_send(h)) && !handler.respond_to?(:call)
|
data/redis-session-store.gemspec
CHANGED
@@ -15,7 +15,7 @@ Gem::Specification.new do |gem|
|
|
15
15
|
gem.version = File.read('lib/redis-session-store.rb')
|
16
16
|
.match(/^ VERSION = '(.*)'/)[1]
|
17
17
|
|
18
|
-
gem.add_runtime_dependency 'actionpack', '
|
18
|
+
gem.add_runtime_dependency 'actionpack', '~> 3'
|
19
19
|
gem.add_runtime_dependency 'redis', '>= 3', '< 5'
|
20
20
|
|
21
21
|
gem.add_development_dependency 'fakeredis', '~> 0.5'
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: redis-session-store
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.11.
|
4
|
+
version: 0.11.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mathias Meyer
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '3'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '3'
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -147,7 +147,7 @@ homepage: https://github.com/roidrage/redis-session-store
|
|
147
147
|
licenses:
|
148
148
|
- MIT
|
149
149
|
metadata: {}
|
150
|
-
post_install_message:
|
150
|
+
post_install_message:
|
151
151
|
rdoc_options: []
|
152
152
|
require_paths:
|
153
153
|
- lib
|
@@ -162,8 +162,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
162
162
|
- !ruby/object:Gem::Version
|
163
163
|
version: '0'
|
164
164
|
requirements: []
|
165
|
-
rubygems_version: 3.
|
166
|
-
signing_key:
|
165
|
+
rubygems_version: 3.1.2
|
166
|
+
signing_key:
|
167
167
|
specification_version: 4
|
168
168
|
summary: A drop-in replacement for e.g. MemCacheStore to store Rails sessions (and
|
169
169
|
Rails sessions only) in Redis.
|