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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e919fbbb65cdfd2bf721443236c77fab4efff9eb9487a3497284124b2e5e409b
4
- data.tar.gz: 9a65fb540e29e2e7bbb194145f4f2f6504a6817596bfd414b6103bc904c04227
3
+ metadata.gz: 26ff10b9f32cb399a27355db6209d933957bedc5def7e5671bc8491aee0e9114
4
+ data.tar.gz: b60fcf186f22a116013d17628bd53056505e1cf9fc392ced60b9072e86a95e20
5
5
  SHA512:
6
- metadata.gz: 00144ff816e03af78ccdeba339b3911bca4fc538ac197dc31dc88a7a4767e46ec42a31c46e33cdcf2d46bd6b1a53eea89e9f646c3d32aa70035f8c6e2d1fea7d
7
- data.tar.gz: 6520432d7d7b75c5b6fb12667b825073ace04b26326aac856209ae53a93c8c1e6d67926f7d424fa14256670af5361307562640cfe6f29c19885158cc440c64fd
6
+ metadata.gz: 977cad8b272aed6334f68ccec5b861262a5fc1a2729b3f86bcb36097278fc5da9837c95f434328c3d421aafcaac3eba2c2b04c6429f20f1d40a324c1e82ab607
7
+ data.tar.gz: 45f5e777113518ca666417a38e0df124760aaf64d5d0624de16b8b8be03b8c835c5d77e838341e79d90c0564f842975f6adf28a40a3b3bea8faa090ddc51813c
@@ -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
- Metrics/LineLength:
17
+ Layout/LineLength:
18
18
  Max: 100
19
19
 
20
20
  Metrics/ClassLength:
@@ -1,14 +1,16 @@
1
1
  language: ruby
2
2
  cache: bundler
3
3
  rvm:
4
- - 2.3.8
5
- - 2.4.6
6
- - 2.5.5
7
- - 2.6.3
8
- - jruby-9.2.8.0
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: jruby-9.2.8.0
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
@@ -22,3 +22,4 @@ Redis Session Store authors
22
22
  - Sergey Nebolsin
23
23
  - Anton Kolodii
24
24
  - Peter Karman
25
+ - Zach Margolis
@@ -4,6 +4,10 @@
4
4
 
5
5
  ## [Unreleased]
6
6
 
7
+ ## [0.11.2] - 2020-07-22
8
+ ### Changed
9
+ - Silence deprecation warning when using with redis gem v4.2+
10
+
7
11
  ## [0.11.1] - 2019-08-22
8
12
  ### Changed
9
13
  - Remove the `has_rdoc` parameter from the `.gemspec` file as it has been deprecated.
@@ -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.1'.freeze
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
- redis.exists(prefixed(value))
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)
@@ -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', '>= 3'
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.1
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: 2019-08-22 00:00:00.000000000 Z
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.0.6
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.