redis-store 1.11.0 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b56845874e768c8ec1357c19affb5e7cdb3914d4839cd18d0e443f03b0e843e8
4
- data.tar.gz: ab3b3872974e7e6fef5992701227397dbc00e8a905d532ab031da57eb2a7ed83
3
+ metadata.gz: fcfb819e0b6306cbad6500f14fcb9a76b28d726ca3c3cded4f1a33ec8bed4111
4
+ data.tar.gz: 900584dc4bd12e867ab22903fa4dc267d64ed8dd51ae47831c3f21901bdffe9d
5
5
  SHA512:
6
- metadata.gz: 96808f1f4a574c79e2e322825e1d7c0f89265ca06db21de1d277e6d519a5c4698b495b9f9c81c3d72811280d400de8b043f15c57bb7f1a02fdf08023b3dcd673
7
- data.tar.gz: 5f6a9ca80e5c7166c003421a6942bed21996b8daa09f134e1646f47942ae086246655068b7f0108e8a710622ec96f4bf4649812d44c2c8538b484bb401a38d60
6
+ metadata.gz: 637c06ae0fc689c1273ea7599f47c6f3f6257fb9f8132b774a0a4667d47432964798fd33c612bca79ad49609c04ad39819537ee62983624a9ec16b98f924af37
7
+ data.tar.gz: aa506defdb50f8d2e7d5e393f751f9681778e7ec18fa0ccc5f289a2111d5ecd195e266cc3b0eada7373ddff6e0c25ed2b68490594a0bd8de4419ee4d5534bc60
@@ -1,6 +1,6 @@
1
1
  class Redis
2
2
  class Store < self
3
- VERSION = '1.11.0'
3
+ VERSION = '1.12.0'
4
4
 
5
5
  def self.redis_client_defined?
6
6
  # Doesn't work if declared as constant
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-store
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.0
4
+ version: 1.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luca Guidi
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-08-09 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: redis
@@ -19,7 +18,7 @@ dependencies:
19
18
  version: '4'
20
19
  - - "<"
21
20
  - !ruby/object:Gem::Version
22
- version: '6'
21
+ version: '7'
23
22
  type: :runtime
24
23
  prerelease: false
25
24
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +28,7 @@ dependencies:
29
28
  version: '4'
30
29
  - - "<"
31
30
  - !ruby/object:Gem::Version
32
- version: '6'
31
+ version: '7'
33
32
  - !ruby/object:Gem::Dependency
34
33
  name: rake
35
34
  requirement: !ruby/object:Gem::Requirement
@@ -170,6 +169,20 @@ dependencies:
170
169
  - - "~>"
171
170
  - !ruby/object:Gem::Version
172
171
  version: '0.54'
172
+ - !ruby/object:Gem::Dependency
173
+ name: ostruct
174
+ requirement: !ruby/object:Gem::Requirement
175
+ requirements:
176
+ - - ">="
177
+ - !ruby/object:Gem::Version
178
+ version: '0'
179
+ type: :development
180
+ prerelease: false
181
+ version_requirements: !ruby/object:Gem::Requirement
182
+ requirements:
183
+ - - ">="
184
+ - !ruby/object:Gem::Version
185
+ version: '0'
173
186
  description: Namespaced Rack::Session, Rack::Cache, I18n and cache Redis stores for
174
187
  Ruby web frameworks.
175
188
  email:
@@ -178,25 +191,9 @@ executables: []
178
191
  extensions: []
179
192
  extra_rdoc_files: []
180
193
  files:
181
- - ".codeclimate.yml"
182
- - ".github/auto-assign-issues.yml"
183
- - ".github/release.yml"
184
- - ".github/workflows/ci.yml"
185
- - ".github/workflows/publish.yml"
186
- - ".gitignore"
187
- - ".rubocop.yml"
188
- - Appraisals
189
194
  - CHANGELOG.md
190
- - CODEOWNERS
191
- - Gemfile
192
195
  - MIT-LICENSE
193
196
  - README.md
194
- - Rakefile
195
- - gemfiles/redis_4_0_x.gemfile
196
- - gemfiles/redis_4_1_x.gemfile
197
- - gemfiles/redis_4_6_x.gemfile
198
- - gemfiles/redis_4_x.gemfile
199
- - gemfiles/redis_5_x.gemfile
200
197
  - lib/redis-store.rb
201
198
  - lib/redis/distributed_store.rb
202
199
  - lib/redis/store.rb
@@ -207,22 +204,13 @@ files:
207
204
  - lib/redis/store/serialization.rb
208
205
  - lib/redis/store/ttl.rb
209
206
  - lib/redis/store/version.rb
210
- - redis-store.gemspec
211
- - test/redis/distributed_store_test.rb
212
- - test/redis/store/factory_test.rb
213
- - test/redis/store/interface_test.rb
214
- - test/redis/store/namespace_test.rb
215
- - test/redis/store/redis_version_test.rb
216
- - test/redis/store/serialization_test.rb
217
- - test/redis/store/ttl_test.rb
218
- - test/redis/store/version_test.rb
219
- - test/redis/store_test.rb
220
- - test/test_helper.rb
221
207
  homepage: http://redis-store.org/redis-store
222
208
  licenses:
223
209
  - MIT
224
- metadata: {}
225
- post_install_message:
210
+ metadata:
211
+ bug_tracker_uri: https://github.com/redis-store/redis-store/issues
212
+ changelog_uri: https://github.com/redis-store/redis-store/releases
213
+ source_code_uri: https://github.com/redis-store/redis-store
226
214
  rdoc_options: []
227
215
  require_paths:
228
216
  - lib
@@ -237,8 +225,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
237
225
  - !ruby/object:Gem::Version
238
226
  version: '0'
239
227
  requirements: []
240
- rubygems_version: 3.5.11
241
- signing_key:
228
+ rubygems_version: 3.6.9
242
229
  specification_version: 4
243
230
  summary: Redis stores for Ruby frameworks
244
231
  test_files: []
data/.codeclimate.yml DELETED
@@ -1,6 +0,0 @@
1
- ---
2
- plugins:
3
- rubocop:
4
- enabled: true
5
- fixme:
6
- enabled: true
@@ -1,2 +0,0 @@
1
- assignees:
2
- - tubbo
data/.github/release.yml DELETED
@@ -1,13 +0,0 @@
1
- changelog:
2
- exclude:
3
- labels: [dependencies]
4
- authors: [renovate-bot]
5
- categories:
6
- - title: Breaking Changes
7
- labels: [breaking]
8
- - title: New Features
9
- labels: [enhancement]
10
- - title: Bug Fixes
11
- labels: [bug]
12
- - title: Other Changes
13
- labels: ["*"]
@@ -1,66 +0,0 @@
1
- name: CI
2
- on:
3
- pull_request:
4
- push:
5
- branches-ignore: [master]
6
- tags-ignore: [v*]
7
- concurrency:
8
- group: ${{ github.workflow }}-${{ github.ref }}
9
- cancel-in-progress: true
10
- jobs:
11
- test:
12
- name: "test (ruby: ${{ matrix.ruby }}, redis.rb: ${{ matrix.redis }})"
13
- runs-on: ubuntu-latest
14
- continue-on-error: ${{ contains(matrix.ruby, 'head') }}
15
- strategy:
16
- fail-fast: false
17
- matrix:
18
- ruby:
19
- - "2.7"
20
- - "3.0"
21
- - "3.1"
22
- - "3.2"
23
- - "3.3"
24
- # - 'head'
25
- - "jruby"
26
- # - 'jruby-head'
27
- - "truffleruby"
28
- # - 'truffleruby-head'
29
- redis:
30
- - 4_0_x
31
- - 4_1_x
32
- - 4_x
33
- - 5_x
34
- env:
35
- BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/redis_${{ matrix.redis }}.gemfile
36
- services:
37
- redis:
38
- image: redis
39
- ports:
40
- - 6379:6379
41
- distributed1:
42
- image: redis
43
- ports:
44
- - 6380:6380
45
- distributed2:
46
- image: redis
47
- ports:
48
- - 6381:6381
49
- steps:
50
- - uses: actions/checkout@v4
51
- - uses: ruby/setup-ruby@v1
52
- with:
53
- ruby-version: ${{ matrix.ruby }}
54
- bundler-cache: true
55
- - run: bundle exec rake
56
- lint:
57
- runs-on: ubuntu-latest
58
- steps:
59
- - uses: actions/checkout@v4
60
- with:
61
- fetch-depth: 0
62
- - uses: ruby/setup-ruby@v1
63
- with:
64
- ruby-version: 3.3
65
- bundler-cache: true
66
- - run: bundle exec rake lint
@@ -1,32 +0,0 @@
1
- name: Publish
2
- on:
3
- push:
4
- tags: [v*]
5
- permissions:
6
- contents: write
7
- concurrency:
8
- group: ${{ github.workflow }}-${{ github.ref }}
9
- cancel-in-progress: true
10
- jobs:
11
- release:
12
- runs-on: ubuntu-latest
13
- steps:
14
- - uses: actions/checkout@v4
15
- - uses: ruby/setup-ruby@v1
16
- with:
17
- ruby-version: "3.3"
18
- bundler-cache: true
19
- - run: |
20
- mkdir -p ~/.gem
21
- cat << EOF > ~/.gem/credentials
22
- ---
23
- :rubygems_api_key: ${{ secrets.RUBYGEMS_API_KEY }}
24
- EOF
25
-
26
- chmod 0600 ~/.gem/credentials
27
- - run: bundle exec rake release
28
- - uses: softprops/action-gh-release@v1
29
- with:
30
- files: "*.gem"
31
- generate_release_notes: true
32
- prerelease: ${{ contains(github.ref, '.pre') }}
data/.gitignore DELETED
@@ -1,9 +0,0 @@
1
- Gemfile.lock
2
- *.gem
3
- tmp/
4
- stdout
5
- # Gemfile locks generated by Appraisals
6
- gemfiles/*.gemfile.lock
7
- gemfiles/.bundle/
8
- # ASDF
9
- .tool-versions
data/.rubocop.yml DELETED
@@ -1,132 +0,0 @@
1
- ---
2
- AllCops:
3
- TargetRubyVersion: 2.4
4
- # RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
5
- # to ignore them, so only the ones explicitly set in this file are enabled.
6
- DisabledByDefault: true
7
- Exclude:
8
- - "**/vendor/**/*"
9
-
10
- # Prefer &&/|| over and/or.
11
- Style/AndOr:
12
- Enabled: true
13
-
14
- # Align comments with method definitions.
15
- Layout/CommentIndentation:
16
- Enabled: true
17
-
18
- Layout/ElseAlignment:
19
- Enabled: true
20
-
21
- Layout/EmptyLineAfterMagicComment:
22
- Enabled: true
23
-
24
- # In a regular class definition, no empty lines around the body.
25
- Layout/EmptyLinesAroundClassBody:
26
- Enabled: true
27
-
28
- # In a regular method definition, no empty lines around the body.
29
- Layout/EmptyLinesAroundMethodBody:
30
- Enabled: true
31
-
32
- # In a regular module definition, no empty lines around the body.
33
- Layout/EmptyLinesAroundModuleBody:
34
- Enabled: true
35
-
36
- Layout/FirstParameterIndentation:
37
- Enabled: true
38
-
39
- # Method definitions after `private` or `protected` isolated calls need one
40
- # extra level of indentation.
41
- Layout/IndentationConsistency:
42
- Enabled: true
43
- EnforcedStyle: indented_internal_methods
44
-
45
- # Two spaces, no tabs (for indentation).
46
- Layout/IndentationWidth:
47
- Enabled: true
48
-
49
- Layout/LeadingCommentSpace:
50
- Enabled: true
51
-
52
- Layout/SpaceAfterColon:
53
- Enabled: true
54
-
55
- Layout/SpaceAfterComma:
56
- Enabled: true
57
-
58
- Layout/SpaceAroundEqualsInParameterDefault:
59
- Enabled: true
60
-
61
- Layout/SpaceAroundKeyword:
62
- Enabled: true
63
-
64
- Layout/SpaceAroundOperators:
65
- Enabled: true
66
-
67
- Layout/SpaceBeforeComma:
68
- Enabled: true
69
-
70
- Layout/SpaceBeforeFirstArg:
71
- Enabled: true
72
-
73
- Style/DefWithParentheses:
74
- Enabled: true
75
-
76
- # Defining a method with parameters needs parentheses.
77
- Style/MethodDefParentheses:
78
- Enabled: true
79
-
80
- # Use `foo {}` not `foo{}`.
81
- Layout/SpaceBeforeBlockBraces:
82
- Enabled: true
83
-
84
- # Use `foo { bar }` not `foo {bar}`.
85
- Layout/SpaceInsideBlockBraces:
86
- Enabled: true
87
-
88
- # Use `{ a: 1 }` not `{a:1}`.
89
- Layout/SpaceInsideHashLiteralBraces:
90
- Enabled: true
91
-
92
- Layout/SpaceInsideParens:
93
- Enabled: true
94
-
95
- # Detect hard tabs, no hard tabs.
96
- Layout/IndentationStyle:
97
- Enabled: true
98
-
99
- # Blank lines should not have any spaces.
100
- Layout/TrailingEmptyLines:
101
- Enabled: true
102
-
103
- # No trailing whitespace.
104
- Layout/TrailingWhitespace:
105
- Enabled: true
106
-
107
- # Use quotes for string literals when they are enough.
108
- Style/RedundantPercentQ:
109
- Enabled: true
110
-
111
- # Align `end` with the matching keyword or starting expression except for
112
- # assignments, where it should be aligned with the LHS.
113
- Layout/EndAlignment:
114
- Enabled: true
115
- EnforcedStyleAlignWith: variable
116
- AutoCorrect: true
117
-
118
- # Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
119
- Lint/RequireParentheses:
120
- Enabled: true
121
-
122
- Style/RedundantReturn:
123
- Enabled: true
124
- AllowMultipleReturnValues: true
125
-
126
- Style/Semicolon:
127
- Enabled: true
128
- AllowAsExpressionSeparator: true
129
-
130
- # Prefer Foo.method over Foo::method
131
- Style/ColonMethodCall:
132
- Enabled: true
data/Appraisals DELETED
@@ -1,19 +0,0 @@
1
- appraise "redis_4_0_x" do
2
- gem "redis", "~> 4.0.0"
3
- end
4
-
5
- appraise "redis_4_1_x" do
6
- gem "redis", "~> 4.1.0"
7
- end
8
-
9
- appraise "redis_4_6_x" do
10
- gem "redis", "~> 4.6.0"
11
- end
12
-
13
- appraise "redis_4_x" do
14
- gem "redis", "~> 4.0"
15
- end
16
-
17
- appraise "redis_5_x" do
18
- gem "redis", "~> 5.0"
19
- end
data/CODEOWNERS DELETED
@@ -1 +0,0 @@
1
- * @tubbo
data/Gemfile DELETED
@@ -1,7 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- if RUBY_VERSION < '2'
4
- gem 'redis', '< 4'
5
- end
6
-
7
- gemspec
data/Rakefile DELETED
@@ -1,15 +0,0 @@
1
- require 'bundler/setup'
2
- require 'rake'
3
- require 'bundler/gem_tasks'
4
- require 'appraisal'
5
- require 'rubocop/rake_task'
6
-
7
- RuboCop::RakeTask.new :lint
8
-
9
- if !ENV["APPRAISAL_INITIALIZED"] && !ENV["CI"]
10
- task :default do
11
- sh "appraisal install && rake appraisal default"
12
- end
13
- else
14
- require 'redis-store/testing/tasks'
15
- end
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "redis", "~> 4.0.0"
6
-
7
- gemspec path: "../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "redis", "~> 4.1.0"
6
-
7
- gemspec path: "../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "redis", "~> 4.6.0"
6
-
7
- gemspec path: "../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "redis", "~> 4.0"
6
-
7
- gemspec path: "../"
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "redis", "~> 5.0"
6
-
7
- gemspec path: "../"
data/redis-store.gemspec DELETED
@@ -1,31 +0,0 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- $:.push File.expand_path('../lib', __FILE__)
4
- require 'redis/store/version'
5
-
6
- Gem::Specification.new do |s|
7
- s.name = 'redis-store'
8
- s.version = Redis::Store::VERSION
9
- s.authors = ['Luca Guidi']
10
- s.email = ['me@lucaguidi.com']
11
- s.homepage = 'http://redis-store.org/redis-store'
12
- s.summary = 'Redis stores for Ruby frameworks'
13
- s.description = 'Namespaced Rack::Session, Rack::Cache, I18n and cache Redis stores for Ruby web frameworks.'
14
-
15
- s.files = `git ls-files`.split("\n")
16
- s.require_paths = ["lib"]
17
- s.license = 'MIT'
18
-
19
- s.add_dependency 'redis', '>= 4', '< 6'
20
-
21
- s.add_development_dependency 'rake', '>= 12.3.3'
22
- s.add_development_dependency 'bundler'
23
- s.add_development_dependency 'mocha', '~> 2.1.0'
24
- s.add_development_dependency 'minitest', '~> 5'
25
- s.add_development_dependency 'git', '~> 1.2'
26
- s.add_development_dependency 'pry-nav', '~> 0.2.4'
27
- s.add_development_dependency 'pry', '~> 0.10.4'
28
- s.add_development_dependency 'redis-store-testing'
29
- s.add_development_dependency 'appraisal', '~> 2.0'
30
- s.add_development_dependency 'rubocop', '~> 0.54'
31
- end
@@ -1,111 +0,0 @@
1
- require 'test_helper'
2
-
3
- describe "Redis::DistributedStore" do
4
- def setup
5
- @dmr = Redis::DistributedStore.new [
6
- { :host => "localhost", :port => "6380", :db => 0 },
7
- { :host => "localhost", :port => "6381", :db => 0 }
8
- ]
9
- @rabbit = OpenStruct.new :name => "bunny"
10
- @white_rabbit = OpenStruct.new :color => "white"
11
- @dmr.set "rabbit", @rabbit
12
- end
13
-
14
- def teardown
15
- @dmr.ring.nodes.each { |server| server.flushdb }
16
- end
17
-
18
- it "accepts connection params" do
19
- dmr = Redis::DistributedStore.new [ :host => "localhost", :port => "6380", :db => "1" ]
20
- _(dmr.ring.nodes.size).must_equal(1)
21
- mr = dmr.ring.nodes.first
22
- _(mr.to_s).must_equal("Redis Client connected to localhost:6380 against DB 1")
23
- end
24
-
25
- it "forces reconnection" do
26
- @dmr.nodes.each do |node|
27
- node.expects(:reconnect)
28
- end
29
-
30
- @dmr.reconnect
31
- end
32
-
33
- it "sets an object" do
34
- @dmr.set "rabbit", @white_rabbit
35
- _(@dmr.get("rabbit")).must_equal(@white_rabbit)
36
- end
37
-
38
- it "gets an object" do
39
- _(@dmr.get("rabbit")).must_equal(@rabbit)
40
- end
41
-
42
- it "mget" do
43
- @dmr.set "rabbit2", @white_rabbit
44
- begin
45
- @dmr.mget "rabbit", "rabbit2" do |rabbits|
46
- rabbit, rabbit2 = rabbits
47
- _(rabbits.length).must_equal(2)
48
- _(rabbit).must_equal(@rabbit)
49
- _(rabbit2).must_equal(@white_rabbit)
50
- end
51
- rescue Redis::Distributed::CannotDistribute
52
- # Not supported on redis-rb < 4, and hence Ruby < 2.2.
53
- end
54
- end
55
-
56
- it "mapped_mget" do
57
- @dmr.set "rabbit2", @white_rabbit
58
- begin
59
- result = @dmr.mapped_mget("rabbit", "rabbit2")
60
- _(result.keys).must_equal %w[ rabbit rabbit2 ]
61
- _(result["rabbit"]).must_equal @rabbit
62
- _(result["rabbit2"]).must_equal @white_rabbit
63
- rescue Redis::Distributed::CannotDistribute
64
- # Not supported on redis-rb < 4, and hence Ruby < 2.2.
65
- end
66
- end
67
-
68
- it "passes through ring replica options" do
69
- dmr = Redis::DistributedStore.new [
70
- { :host => "localhost", :port => "6380", :db => 0 },
71
- { :host => "localhost", :port => "6381", :db => 0 }
72
- ], replicas: 1024
73
- _(dmr.ring.replicas).must_equal 1024
74
- end
75
-
76
- it "uses a custom ring object" do
77
- my_ring = Redis::HashRing.new
78
- dmr = Redis::DistributedStore.new [
79
- { :host => "localhost", :port => "6380", :db => 0 },
80
- { :host => "localhost", :port => "6381", :db => 0 }
81
- ], ring: my_ring
82
- _(dmr.ring).must_equal my_ring
83
- _(dmr.ring.nodes.length).must_equal 2
84
- end
85
-
86
- describe '#redis_version' do
87
- it 'returns redis version' do
88
- @dmr.nodes.first.expects(:redis_version)
89
- @dmr.redis_version
90
- end
91
- end
92
-
93
- describe '#supports_redis_version?' do
94
- it 'returns redis version' do
95
- @dmr.nodes.first.expects(:supports_redis_version?).with('2.8.0')
96
- @dmr.supports_redis_version?('2.8.0')
97
- end
98
- end
99
-
100
- describe "namespace" do
101
- it "uses namespaced key" do
102
- @dmr = Redis::DistributedStore.new [
103
- { :host => "localhost", :port => "6380", :db => 0 },
104
- { :host => "localhost", :port => "6381", :db => 0 }
105
- ], :namespace => "theplaylist"
106
-
107
- @dmr.expects(:node_for).with("theplaylist:rabbit").returns(@dmr.nodes.first)
108
- @dmr.get "rabbit"
109
- end
110
- end
111
- end unless ENV['CI']