modis 4.3.0 → 4.3.2
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 +4 -4
- data/.github/workflows/test.yml +34 -2
- data/.github_changelog_generator +1 -1
- data/Appraisals +10 -0
- data/CHANGELOG.md +23 -2
- data/Gemfile.lock +2 -2
- data/gemfiles/rails_7.1.gemfile +8 -0
- data/gemfiles/rails_7.2.gemfile +8 -0
- data/lib/modis/configuration.rb +3 -3
- data/lib/modis/version.rb +1 -1
- data/lib/modis.rb +19 -3
- data/spec/multi_redis_spec.rb +2 -0
- data/spec/persistence_spec.rb +2 -2
- data/spec/spec_helper.rb +3 -9
- metadata +4 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bd66702e695b7d99aa4687b5112f11182228c746109da11e993ababfa5eb62d0
|
|
4
|
+
data.tar.gz: 7999704909f7ad4bfa8365d3107fe2e9f4446070545898bc53d6939c0f733526
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fc275ca88973e5b553125a3b0cd7f4aa048e4627d4b6ba2f8ebba9867910e0f7acd004d1084b8ad93dbe9bbb836c111615a0cd8e0bbd523c323ee8098c1023ce
|
|
7
|
+
data.tar.gz: 37848dacc6eb044dbf04af650111916876f0c13c74f09cd8793cd34a52b5121f8504283357944175c3cfb4c4105d0bec1212649ecef3a87c76d9c3d646885d19
|
data/.github/workflows/test.yml
CHANGED
|
@@ -28,9 +28,9 @@ jobs:
|
|
|
28
28
|
strategy:
|
|
29
29
|
fail-fast: false
|
|
30
30
|
matrix:
|
|
31
|
-
gemfile: ['rails_5.2', 'rails_6.0', 'rails_6.1', 'rails_7.0']
|
|
31
|
+
gemfile: ['rails_5.2', 'rails_6.0', 'rails_6.1', 'rails_7.0', 'rails_7.1', 'rails_7.2']
|
|
32
32
|
|
|
33
|
-
ruby: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1']
|
|
33
|
+
ruby: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2', '3.3']
|
|
34
34
|
|
|
35
35
|
exclude:
|
|
36
36
|
# Rails 5.2 requires Ruby < 3.0
|
|
@@ -39,6 +39,10 @@ jobs:
|
|
|
39
39
|
gemfile: 'rails_5.2'
|
|
40
40
|
- ruby: '3.1'
|
|
41
41
|
gemfile: 'rails_5.2'
|
|
42
|
+
- ruby: '3.2'
|
|
43
|
+
gemfile: 'rails_5.2'
|
|
44
|
+
- ruby: '3.3'
|
|
45
|
+
gemfile: 'rails_5.2'
|
|
42
46
|
# Rails >= 6 requires Ruby >= 2.5
|
|
43
47
|
- ruby: '2.4'
|
|
44
48
|
gemfile: 'rails_6.0'
|
|
@@ -51,6 +55,22 @@ jobs:
|
|
|
51
55
|
gemfile: 'rails_7.0'
|
|
52
56
|
- ruby: '2.6'
|
|
53
57
|
gemfile: 'rails_7.0'
|
|
58
|
+
- ruby: '2.4'
|
|
59
|
+
gemfile: 'rails_7.1'
|
|
60
|
+
- ruby: '2.5'
|
|
61
|
+
gemfile: 'rails_7.1'
|
|
62
|
+
- ruby: '2.6'
|
|
63
|
+
gemfile: 'rails_7.1'
|
|
64
|
+
- ruby: '2.4'
|
|
65
|
+
gemfile: 'rails_7.2'
|
|
66
|
+
- ruby: '2.5'
|
|
67
|
+
gemfile: 'rails_7.2'
|
|
68
|
+
- ruby: '2.6'
|
|
69
|
+
gemfile: 'rails_7.2'
|
|
70
|
+
- ruby: '2.7'
|
|
71
|
+
gemfile: 'rails_7.2'
|
|
72
|
+
- ruby: '3.0'
|
|
73
|
+
gemfile: 'rails_7.2'
|
|
54
74
|
|
|
55
75
|
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
|
|
56
76
|
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
|
|
@@ -66,3 +86,15 @@ jobs:
|
|
|
66
86
|
|
|
67
87
|
- name: Run tests
|
|
68
88
|
run: bundle exec rake
|
|
89
|
+
|
|
90
|
+
tests:
|
|
91
|
+
runs-on: ubuntu-latest
|
|
92
|
+
needs: test
|
|
93
|
+
if: always()
|
|
94
|
+
steps:
|
|
95
|
+
- name: All tests ok
|
|
96
|
+
if: ${{ !(contains(needs.*.result, 'failure')) }}
|
|
97
|
+
run: exit 0
|
|
98
|
+
- name: Some tests failed
|
|
99
|
+
if: ${{ contains(needs.*.result, 'failure') }}
|
|
100
|
+
run: exit 1
|
data/.github_changelog_generator
CHANGED
data/Appraisals
CHANGED
|
@@ -19,3 +19,13 @@ appraise 'rails-7.0' do
|
|
|
19
19
|
gem 'activemodel', '~> 7.0.0'
|
|
20
20
|
gem 'activesupport', '~> 7.0.0'
|
|
21
21
|
end
|
|
22
|
+
|
|
23
|
+
appraise 'rails-7.1' do
|
|
24
|
+
gem 'activemodel', '~> 7.1.0'
|
|
25
|
+
gem 'activesupport', '~> 7.1.0'
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
appraise 'rails-7.2' do
|
|
29
|
+
gem 'activemodel', '~> 7.2.0'
|
|
30
|
+
gem 'activesupport', '~> 7.2.0'
|
|
31
|
+
end
|
data/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,29 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
## [v4.
|
|
3
|
+
## [v4.3.2](https://github.com/rpush/modis/tree/v4.3.2) (2024-09-06)
|
|
4
4
|
|
|
5
|
-
[Full Changelog](https://github.com/rpush/modis/compare/v4.
|
|
5
|
+
[Full Changelog](https://github.com/rpush/modis/compare/v4.3.1...v4.3.2)
|
|
6
|
+
|
|
7
|
+
**Merged pull requests:**
|
|
8
|
+
|
|
9
|
+
- Test on Rails 7.2 [\#54](https://github.com/rpush/modis/pull/54) ([benlangfeld](https://github.com/benlangfeld))
|
|
10
|
+
- Test on new Ruby/Rails versions [\#52](https://github.com/rpush/modis/pull/52) ([benlangfeld](https://github.com/benlangfeld))
|
|
11
|
+
|
|
12
|
+
## [v4.3.1](https://github.com/rpush/modis/tree/v4.3.1) (2024-08-01)
|
|
13
|
+
|
|
14
|
+
[Full Changelog](https://github.com/rpush/modis/compare/v4.3.0...v4.3.1)
|
|
15
|
+
|
|
16
|
+
**Closed issues:**
|
|
17
|
+
|
|
18
|
+
- Release 4.3.0 breaks the Rpush initialization [\#50](https://github.com/rpush/modis/issues/50)
|
|
19
|
+
|
|
20
|
+
**Merged pull requests:**
|
|
21
|
+
|
|
22
|
+
- Restore backwards compatibility broken in 4.3.0 [\#51](https://github.com/rpush/modis/pull/51) ([benlangfeld](https://github.com/benlangfeld))
|
|
23
|
+
|
|
24
|
+
## [v4.3.0](https://github.com/rpush/modis/tree/v4.3.0) (2024-07-31)
|
|
25
|
+
|
|
26
|
+
[Full Changelog](https://github.com/rpush/modis/compare/v4.2.0...v4.3.0)
|
|
6
27
|
|
|
7
28
|
**Merged pull requests:**
|
|
8
29
|
|
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
modis (4.3.
|
|
4
|
+
modis (4.3.2)
|
|
5
5
|
activemodel (>= 5.2)
|
|
6
6
|
activesupport (>= 5.2)
|
|
7
7
|
connection_pool (>= 2)
|
|
@@ -94,7 +94,7 @@ GEM
|
|
|
94
94
|
public_suffix (5.0.1)
|
|
95
95
|
rainbow (3.0.0)
|
|
96
96
|
rake (13.0.1)
|
|
97
|
-
redis (5.
|
|
97
|
+
redis (5.3.0)
|
|
98
98
|
redis-client (>= 0.22.0)
|
|
99
99
|
redis-client (0.22.2)
|
|
100
100
|
connection_pool
|
data/lib/modis/configuration.rb
CHANGED
data/lib/modis/version.rb
CHANGED
data/lib/modis.rb
CHANGED
|
@@ -18,11 +18,14 @@ require 'modis/index'
|
|
|
18
18
|
require 'modis/model'
|
|
19
19
|
|
|
20
20
|
module Modis
|
|
21
|
-
@mutex = Mutex.new
|
|
22
21
|
class << self
|
|
23
22
|
attr_writer :connection_pool_size, :connection_pool_timeout,
|
|
24
23
|
:connection_pools
|
|
25
24
|
|
|
25
|
+
def mutex
|
|
26
|
+
@mutex ||= Mutex.new
|
|
27
|
+
end
|
|
28
|
+
|
|
26
29
|
def redis_options
|
|
27
30
|
@redis_options ||= { default: {} }
|
|
28
31
|
end
|
|
@@ -31,7 +34,20 @@ module Modis
|
|
|
31
34
|
if options.is_a?(Hash) && options.values.first.is_a?(Hash)
|
|
32
35
|
@redis_options = options.transform_values(&:dup)
|
|
33
36
|
else
|
|
34
|
-
|
|
37
|
+
redis_options[:default] = options
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def reset!
|
|
42
|
+
connection_pools.each do |key, _|
|
|
43
|
+
with_connection(key) do |connection|
|
|
44
|
+
keys = connection.keys "#{config.namespace}:*"
|
|
45
|
+
connection.del(*keys) unless keys.empty?
|
|
46
|
+
end
|
|
47
|
+
end
|
|
48
|
+
instance_variables.each do |var|
|
|
49
|
+
instance_variable_set(var, nil)
|
|
50
|
+
remove_instance_variable(var)
|
|
35
51
|
end
|
|
36
52
|
end
|
|
37
53
|
|
|
@@ -49,7 +65,7 @@ module Modis
|
|
|
49
65
|
|
|
50
66
|
def connection_pool(pool_name = :default)
|
|
51
67
|
connection_pools[pool_name] ||= begin
|
|
52
|
-
|
|
68
|
+
mutex.synchronize do
|
|
53
69
|
ConnectionPool.new(
|
|
54
70
|
size: connection_pool_size,
|
|
55
71
|
timeout: connection_pool_timeout
|
data/spec/multi_redis_spec.rb
CHANGED
data/spec/persistence_spec.rb
CHANGED
|
@@ -277,7 +277,7 @@ describe Modis::Persistence do
|
|
|
277
277
|
end
|
|
278
278
|
|
|
279
279
|
describe 'update_attributes!' do
|
|
280
|
-
around(:each) { |example| ActiveSupport::Deprecation.silence { example.run } }
|
|
280
|
+
around(:each) { |example| ActiveSupport::Deprecation.new.silence { example.run } }
|
|
281
281
|
|
|
282
282
|
it 'updates the given attributes' do
|
|
283
283
|
model.update_attributes!(name: 'Derp', age: 29)
|
|
@@ -331,7 +331,7 @@ describe Modis::Persistence do
|
|
|
331
331
|
end
|
|
332
332
|
|
|
333
333
|
describe 'update_attributes' do
|
|
334
|
-
around(:each) { |example| ActiveSupport::Deprecation.silence { example.run } }
|
|
334
|
+
around(:each) { |example| ActiveSupport::Deprecation.new.silence { example.run } }
|
|
335
335
|
|
|
336
336
|
it 'updates the given attributes' do
|
|
337
337
|
model.update_attributes(name: 'Derp', age: 29)
|
data/spec/spec_helper.rb
CHANGED
|
@@ -14,18 +14,12 @@ require 'modis'
|
|
|
14
14
|
|
|
15
15
|
Redis.raise_deprecations = true if Gem.loaded_specs['redis'].version >= Gem::Version.new('4.6.0')
|
|
16
16
|
|
|
17
|
-
Modis.configure do |config|
|
|
18
|
-
config.namespace = 'modis'
|
|
19
|
-
end
|
|
20
|
-
|
|
21
17
|
RSpec.configure do |config|
|
|
22
18
|
config.after :each do
|
|
23
19
|
RSpec::Mocks.space.proxy_for(Modis).reset
|
|
24
|
-
Modis.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
connection.del(*keys) unless keys.empty?
|
|
28
|
-
end
|
|
20
|
+
Modis.reset!
|
|
21
|
+
Modis.configure do |modis_config|
|
|
22
|
+
modis_config.namespace = 'modis'
|
|
29
23
|
end
|
|
30
24
|
end
|
|
31
25
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: modis
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.3.
|
|
4
|
+
version: 4.3.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ian Leitch
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2024-
|
|
11
|
+
date: 2024-09-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activemodel
|
|
@@ -233,6 +233,8 @@ files:
|
|
|
233
233
|
- gemfiles/rails_6.0.gemfile
|
|
234
234
|
- gemfiles/rails_6.1.gemfile
|
|
235
235
|
- gemfiles/rails_7.0.gemfile
|
|
236
|
+
- gemfiles/rails_7.1.gemfile
|
|
237
|
+
- gemfiles/rails_7.2.gemfile
|
|
236
238
|
- lib/modis.rb
|
|
237
239
|
- lib/modis/attribute.rb
|
|
238
240
|
- lib/modis/configuration.rb
|