modis 4.0.1 → 4.1.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: 90338a93da41f45150c96831168e346edc9c408aa587bd7e1d82cb6e735e1b5b
4
- data.tar.gz: 87894188fb86b5f4f5f5586990a99744a3c88eedda54e1e1bb5d588df3c33db7
3
+ metadata.gz: d3cc18ebd9e13700435d34434b57d52b10eea6b6af111458db728c58ef132d7f
4
+ data.tar.gz: 77010b2ca7a9edf776064a2d94f0c1e311af46263f9419b169afb157f78c4c48
5
5
  SHA512:
6
- metadata.gz: b80e7a9f7d6b546f100a03d0b49f0d6f095832cc97aeaea6fd4edb23428fd741c9851e76e1ad011d785e478f4f0bbd77eea31e77c2c420df447506ec328fc114
7
- data.tar.gz: c43be4893954d2826f6f31c39c2a035bce50907f32fe224a475b4f0b71d038a42379c13132192297271ab30ad4922abcabec463db4832f40f9c5c2ac293aedb0
6
+ metadata.gz: dec75991005c6e245aff2f49150c76fafac0c65cc4523a4de814938e8de3e39b8baed59e5338e4759a9978ac1967c765be90aecdd1b5cc99a050b96bd0561512
7
+ data.tar.gz: acff0628d95b28918f1329e1cd325031561da7635ae73619e822902f794b33a0314e104db801b8bd22cdec2e588a01fb2cbe97d1bec81316255df911b13f73ca
@@ -0,0 +1,67 @@
1
+ name: Test
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ env:
10
+ CI: "true"
11
+
12
+ jobs:
13
+ test:
14
+ runs-on: ubuntu-22.04
15
+
16
+ services:
17
+ redis:
18
+ image: redis
19
+ options: >-
20
+ --health-cmd "redis-cli ping"
21
+ --health-interval 10s
22
+ --health-timeout 5s
23
+ --health-retries 5
24
+ ports:
25
+ # Maps port 6379 on service container to the host
26
+ - 6379:6379
27
+
28
+ strategy:
29
+ matrix:
30
+ gemfile: ['rails_5.2', 'rails_6.0', 'rails_6.1', 'rails_7.0']
31
+
32
+ ruby: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1']
33
+
34
+ exclude:
35
+ # Rails 5.2 requires Ruby < 3.0
36
+ # https://github.com/rails/rails/issues/40938
37
+ - ruby: '3.0'
38
+ gemfile: 'rails_5.2'
39
+ - ruby: '3.1'
40
+ gemfile: 'rails_5.2'
41
+ # Rails >= 6 requires Ruby >= 2.5
42
+ - ruby: '2.4'
43
+ gemfile: 'rails_6.0'
44
+ - ruby: '2.4'
45
+ gemfile: 'rails_6.1'
46
+ # Rails >= 7 requires Ruby >= 2.7
47
+ - ruby: '2.4'
48
+ gemfile: 'rails_7.0'
49
+ - ruby: '2.5'
50
+ gemfile: 'rails_7.0'
51
+ - ruby: '2.6'
52
+ gemfile: 'rails_7.0'
53
+
54
+ env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
55
+ BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
56
+
57
+ steps:
58
+ - uses: actions/checkout@v2
59
+
60
+ - name: Set up Ruby
61
+ uses: ruby/setup-ruby@v1
62
+ with:
63
+ ruby-version: ${{ matrix.ruby }}
64
+ bundler-cache: true # runs 'bundle install' and caches installed gems automatically
65
+
66
+ - name: Run tests
67
+ run: bundle exec rake
@@ -0,0 +1,3 @@
1
+ user=rpush
2
+ project=modis
3
+ future-release=v4.1.0
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.6.5
1
+ 3.1.3
data/Appraisals CHANGED
@@ -1,20 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- appraise 'rails-4.2' do
4
- gem 'activemodel', '~> 4.2.0'
5
- gem 'activesupport', '~> 4.2.0'
6
- end
7
-
8
- appraise 'rails-5.0' do
9
- gem 'activemodel', '~> 5.0.0'
10
- gem 'activesupport', '~> 5.0.0'
11
- end
12
-
13
- appraise 'rails-5.1' do
14
- gem 'activemodel', '~> 5.1.0'
15
- gem 'activesupport', '~> 5.1.0'
16
- end
17
-
18
3
  appraise 'rails-5.2' do
19
4
  gem 'activemodel', '~> 5.2.0'
20
5
  gem 'activesupport', '~> 5.2.0'
@@ -24,3 +9,13 @@ appraise 'rails-6.0' do
24
9
  gem 'activemodel', '~> 6.0.0'
25
10
  gem 'activesupport', '~> 6.0.0'
26
11
  end
12
+
13
+ appraise 'rails-6.1' do
14
+ gem 'activemodel', '~> 6.1.0'
15
+ gem 'activesupport', '~> 6.1.0'
16
+ end
17
+
18
+ appraise 'rails-7.0' do
19
+ gem 'activemodel', '~> 7.0.0'
20
+ gem 'activesupport', '~> 7.0.0'
21
+ end
data/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Changelog
2
2
 
3
+ ## [v4.1.0](https://github.com/rpush/modis/tree/v4.1.0) (2023-02-01)
4
+
5
+ [Full Changelog](https://github.com/rpush/modis/compare/v4.0.1...v4.1.0)
6
+
7
+ **Closed issues:**
8
+
9
+ - Migrate CI to GitHub Actions, add testing for Rails 7.0 and Ruby 3.1 [\#33](https://github.com/rpush/modis/issues/33)
10
+
11
+ **Merged pull requests:**
12
+
13
+ - Upgrades to latest activesupport [\#44](https://github.com/rpush/modis/pull/44) ([benlangfeld](https://github.com/benlangfeld))
14
+ - Switch from Travis CI to GH actions [\#42](https://github.com/rpush/modis/pull/42) ([benlangfeld](https://github.com/benlangfeld))
15
+ - Flexible encoding [\#41](https://github.com/rpush/modis/pull/41) ([benlangfeld](https://github.com/benlangfeld))
16
+ - Compatibility with redis 4.8.x gem [\#40](https://github.com/rpush/modis/pull/40) ([benlangfeld](https://github.com/benlangfeld))
17
+ - Compatibility with redis 4.7.x gem [\#39](https://github.com/rpush/modis/pull/39) ([benlangfeld](https://github.com/benlangfeld))
18
+ - More modern ruby for local dev [\#37](https://github.com/rpush/modis/pull/37) ([benlangfeld](https://github.com/benlangfeld))
19
+ - Don't allow redis \> 4.6 yet [\#36](https://github.com/rpush/modis/pull/36) ([benlangfeld](https://github.com/benlangfeld))
20
+
3
21
  ## [v4.0.1](https://github.com/rpush/modis/tree/v4.0.1) (2022-03-02)
4
22
 
5
23
  [Full Changelog](https://github.com/rpush/modis/compare/v4.0.0...v4.0.1)
@@ -12,6 +30,10 @@
12
30
 
13
31
  [Full Changelog](https://github.com/rpush/modis/compare/v3.3.0...v4.0.0)
14
32
 
33
+ **Closed issues:**
34
+
35
+ - remove hiredis dependency [\#15](https://github.com/rpush/modis/issues/15)
36
+
15
37
  **Merged pull requests:**
16
38
 
17
39
  - Makes hiredis a development dependency [\#31](https://github.com/rpush/modis/pull/31) ([fdocr](https://github.com/fdocr))
@@ -31,12 +53,18 @@
31
53
 
32
54
  **Merged pull requests:**
33
55
 
34
- - Add missing `\#update` and `\#update!` persistance methods [\#27](https://github.com/rpush/modis/pull/27) ([dsantosmerino](https://github.com/dsantosmerino))
56
+ - Add missing `#update` and `#update!` persistance methods [\#27](https://github.com/rpush/modis/pull/27) ([dsantosmerino](https://github.com/dsantosmerino))
35
57
 
36
58
  ## [v3.1.0](https://github.com/rpush/modis/tree/v3.1.0) (2019-10-18)
37
59
 
38
60
  [Full Changelog](https://github.com/rpush/modis/compare/3.0.0...v3.1.0)
39
61
 
62
+ **Closed issues:**
63
+
64
+ - Add testing for Rails 6 [\#24](https://github.com/rpush/modis/issues/24)
65
+ - Modis Memory Leak [\#14](https://github.com/rpush/modis/issues/14)
66
+ - Support of Rails 5.2 [\#13](https://github.com/rpush/modis/issues/13)
67
+
40
68
  **Merged pull requests:**
41
69
 
42
70
  - Remove i18n dependency [\#26](https://github.com/rpush/modis/pull/26) ([aried3r](https://github.com/aried3r))
@@ -47,6 +75,10 @@
47
75
 
48
76
  [Full Changelog](https://github.com/rpush/modis/compare/v2.1.0...3.0.0)
49
77
 
78
+ **Closed issues:**
79
+
80
+ - difficult to persist after making changes to part of a hash attribute [\#8](https://github.com/rpush/modis/issues/8)
81
+
50
82
  **Merged pull requests:**
51
83
 
52
84
  - Prep 3.0.0 release [\#21](https://github.com/rpush/modis/pull/21) ([garettarrowood](https://github.com/garettarrowood))
@@ -57,14 +89,64 @@
57
89
  - get rid of old school rocket syntax [\#11](https://github.com/rpush/modis/pull/11) ([DmytroStepaniuk](https://github.com/DmytroStepaniuk))
58
90
  - fix wrong readme example [\#10](https://github.com/rpush/modis/pull/10) ([DmytroStepaniuk](https://github.com/DmytroStepaniuk))
59
91
 
60
- ## v2.1.0
92
+ ## [v2.1.0](https://github.com/rpush/modis/tree/v2.1.0) (2017-06-24)
93
+
94
+ [Full Changelog](https://github.com/rpush/modis/compare/v1.4.2...v2.1.0)
95
+
96
+ **Closed issues:**
97
+
98
+ - Reason of :all index [\#6](https://github.com/rpush/modis/issues/6)
99
+
100
+ **Merged pull requests:**
101
+
102
+ - New option for Modis::Model - :enable\_all\_index [\#7](https://github.com/rpush/modis/pull/7) ([nattfodd](https://github.com/nattfodd))
103
+
104
+ ## [v1.4.2](https://github.com/rpush/modis/tree/v1.4.2) (2017-06-05)
105
+
106
+ [Full Changelog](https://github.com/rpush/modis/compare/v2.0.0...v1.4.2)
107
+
108
+ ## [v2.0.0](https://github.com/rpush/modis/tree/v2.0.0) (2017-05-25)
109
+
110
+ [Full Changelog](https://github.com/rpush/modis/compare/v1.4.1...v2.0.0)
111
+
112
+ **Closed issues:**
113
+
114
+ - Drop support for Ruby \<= 2.1 [\#4](https://github.com/rpush/modis/issues/4)
115
+ - Spec errors in new optimizations [\#1](https://github.com/rpush/modis/issues/1)
116
+
117
+ **Merged pull requests:**
118
+
119
+ - Improvements [\#5](https://github.com/rpush/modis/pull/5) ([Tonkpils](https://github.com/Tonkpils))
120
+ - Support for Ruby 2.4.1 [\#3](https://github.com/rpush/modis/pull/3) ([Tonkpils](https://github.com/Tonkpils))
121
+
122
+ ## [v1.4.1](https://github.com/rpush/modis/tree/v1.4.1) (2015-01-20)
123
+
124
+ [Full Changelog](https://github.com/rpush/modis/compare/v1.4.0...v1.4.1)
125
+
126
+ ## [v1.4.0](https://github.com/rpush/modis/tree/v1.4.0) (2015-01-13)
127
+
128
+ [Full Changelog](https://github.com/rpush/modis/compare/v1.3.0...v1.4.0)
129
+
130
+ ## [v1.3.0](https://github.com/rpush/modis/tree/v1.3.0) (2014-09-01)
131
+
132
+ [Full Changelog](https://github.com/rpush/modis/compare/v1.2.0...v1.3.0)
133
+
134
+ ## [v1.2.0](https://github.com/rpush/modis/tree/v1.2.0) (2014-09-01)
135
+
136
+ [Full Changelog](https://github.com/rpush/modis/compare/v1.1.0...v1.2.0)
137
+
138
+ ## [v1.1.0](https://github.com/rpush/modis/tree/v1.1.0) (2014-07-09)
139
+
140
+ [Full Changelog](https://github.com/rpush/modis/compare/v1.0.0...v1.1.0)
141
+
142
+ ## [v1.0.0](https://github.com/rpush/modis/tree/v1.0.0) (2014-06-22)
143
+
144
+ [Full Changelog](https://github.com/rpush/modis/compare/v0.0.1...v1.0.0)
61
145
 
62
- - Add `enable_all_index` option to allow disabling the `all` keys. [#7](https://github.com/rpush/modis/pull/7)
146
+ ## [v0.0.1](https://github.com/rpush/modis/tree/v0.0.1) (2014-04-20)
63
147
 
64
- ## v2.0.0
148
+ [Full Changelog](https://github.com/rpush/modis/compare/a42bf2ff8e233a52ce1fb4fd3120f21cec8bee1c...v0.0.1)
65
149
 
66
- - Support MRI 2.2.2+ and JRuby 9k+ [#5](https://github.com/rpush/modis/pull/5)
67
- - Remove YAML (de)serialization support [#5](https://github.com/rpush/modis/pull/5)
68
150
 
69
151
 
70
152
  \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
data/Gemfile.lock CHANGED
@@ -1,49 +1,100 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- modis (4.0.1)
4
+ modis (4.1.0)
5
5
  activemodel (>= 5.2)
6
6
  activesupport (>= 5.2)
7
7
  connection_pool (>= 2)
8
8
  msgpack (>= 0.5)
9
- redis (>= 3.0)
9
+ redis (>= 3.0, < 5.0)
10
10
 
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- activemodel (6.0.3.4)
15
- activesupport (= 6.0.3.4)
16
- activesupport (6.0.3.4)
14
+ activemodel (7.0.4.2)
15
+ activesupport (= 7.0.4.2)
16
+ activesupport (7.0.4.2)
17
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
- i18n (>= 0.7, < 2)
19
- minitest (~> 5.1)
20
- tzinfo (~> 1.1)
21
- zeitwerk (~> 2.2, >= 2.2.2)
18
+ i18n (>= 1.6, < 2)
19
+ minitest (>= 5.1)
20
+ tzinfo (~> 2.0)
21
+ addressable (2.8.1)
22
+ public_suffix (>= 2.0.2, < 6.0)
22
23
  appraisal (2.3.0)
23
24
  bundler
24
25
  rake
25
26
  thor (>= 0.14.0)
26
27
  ast (2.4.2)
28
+ async (2.3.1)
29
+ console (~> 1.10)
30
+ io-event (~> 1.1)
31
+ timers (~> 4.1)
32
+ async-http (0.59.5)
33
+ async (>= 1.25)
34
+ async-io (>= 1.28)
35
+ async-pool (>= 0.2)
36
+ protocol-http (~> 0.23)
37
+ protocol-http1 (~> 0.14.0)
38
+ protocol-http2 (~> 0.14.0)
39
+ traces (>= 0.8.0)
40
+ async-http-faraday (0.11.0)
41
+ async-http (~> 0.42)
42
+ faraday
43
+ async-io (1.34.3)
44
+ async
45
+ async-pool (0.3.12)
46
+ async (>= 1.25)
27
47
  cane (3.0.0)
28
48
  parallel
29
49
  codeclimate-test-reporter (1.0.7)
30
50
  simplecov
31
- concurrent-ruby (1.1.7)
32
- connection_pool (2.2.3)
51
+ concurrent-ruby (1.2.0)
52
+ connection_pool (2.3.0)
53
+ console (1.16.2)
54
+ fiber-local
33
55
  diff-lcs (1.4.4)
34
56
  docile (1.3.2)
57
+ faraday (2.7.4)
58
+ faraday-net_http (>= 2.0, < 3.1)
59
+ ruby2_keywords (>= 0.0.4)
60
+ faraday-http-cache (2.4.1)
61
+ faraday (>= 0.8)
62
+ faraday-net_http (3.0.2)
63
+ fiber-local (1.0.0)
64
+ github_changelog_generator (1.16.4)
65
+ activesupport
66
+ async (>= 1.25.0)
67
+ async-http-faraday
68
+ faraday-http-cache
69
+ multi_json
70
+ octokit (~> 4.6)
71
+ rainbow (>= 2.2.1)
72
+ rake (>= 10.0)
35
73
  hiredis (0.6.3)
36
- i18n (1.8.5)
74
+ i18n (1.12.0)
37
75
  concurrent-ruby (~> 1.0)
76
+ io-event (1.1.6)
38
77
  jaro_winkler (1.5.4)
39
- minitest (5.14.2)
40
- msgpack (1.3.3)
78
+ minitest (5.17.0)
79
+ msgpack (1.6.0)
80
+ multi_json (1.15.0)
81
+ octokit (4.25.1)
82
+ faraday (>= 1, < 3)
83
+ sawyer (~> 0.9)
41
84
  parallel (1.20.1)
42
85
  parser (3.0.1.0)
43
86
  ast (~> 2.4.1)
87
+ protocol-hpack (1.4.2)
88
+ protocol-http (0.24.0)
89
+ protocol-http1 (0.14.6)
90
+ protocol-http (~> 0.22)
91
+ protocol-http2 (0.14.2)
92
+ protocol-hpack (~> 1.4)
93
+ protocol-http (~> 0.18)
94
+ public_suffix (5.0.1)
44
95
  rainbow (3.0.0)
45
96
  rake (13.0.1)
46
- redis (4.6.0)
97
+ redis (4.8.0)
47
98
  rexml (3.2.5)
48
99
  rspec (3.9.0)
49
100
  rspec-core (~> 3.9.0)
@@ -67,16 +118,20 @@ GEM
67
118
  ruby-progressbar (~> 1.7)
68
119
  unicode-display_width (>= 1.4.0, < 2.0)
69
120
  ruby-progressbar (1.11.0)
121
+ ruby2_keywords (0.0.5)
122
+ sawyer (0.9.2)
123
+ addressable (>= 2.3.5)
124
+ faraday (>= 0.17.3, < 3)
70
125
  simplecov (0.18.5)
71
126
  docile (~> 1.1)
72
127
  simplecov-html (~> 0.11)
73
- simplecov-html (0.12.2)
128
+ simplecov-html (0.12.3)
74
129
  thor (1.0.1)
75
- thread_safe (0.3.6)
76
- tzinfo (1.2.7)
77
- thread_safe (~> 0.1)
130
+ timers (4.3.5)
131
+ traces (0.8.0)
132
+ tzinfo (2.0.6)
133
+ concurrent-ruby (~> 1.0)
78
134
  unicode-display_width (1.7.0)
79
- zeitwerk (2.4.0)
80
135
 
81
136
  PLATFORMS
82
137
  ruby
@@ -85,6 +140,7 @@ DEPENDENCIES
85
140
  appraisal
86
141
  cane
87
142
  codeclimate-test-reporter
143
+ github_changelog_generator
88
144
  hiredis (>= 0.5)
89
145
  modis!
90
146
  rake
data/README.md CHANGED
@@ -1,4 +1,3 @@
1
- [![Build Status](https://travis-ci.org/rpush/modis.svg?branch=master)](https://travis-ci.org/rpush/modis)
2
1
  [![Code Climate](https://codeclimate.com/github/ileitch/modis/badges/gpa.svg)](https://codeclimate.com/github/ileitch/modis)
3
2
  [![Test Coverage](https://codeclimate.com/github/ileitch/modis/badges/coverage.svg)](https://codeclimate.com/github/ileitch/modis)
4
3
 
data/Rakefile CHANGED
@@ -10,9 +10,9 @@ RSpec::Core::RakeTask.new(:spec) do |spec|
10
10
  spec.rspec_opts = ['--backtrace']
11
11
  end
12
12
 
13
- if ENV['TRAVIS'] && ENV['QUALITY'] == 'false'
13
+ if ENV['CI'] && ENV['QUALITY'] == 'false'
14
14
  task default: 'spec'
15
- elsif RUBY_VERSION > '1.9' && defined?(RUBY_ENGINE) && RUBY_ENGINE == 'ruby'
15
+ elsif defined?(RUBY_ENGINE) && RUBY_ENGINE == 'ruby'
16
16
  task default: 'spec:quality'
17
17
  else
18
18
  task default: 'spec'
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activemodel", "~> 7.0.0"
6
+ gem "activesupport", "~> 7.0.0"
7
+
8
+ gemspec path: "../"
data/lib/modis/index.rb CHANGED
@@ -62,7 +62,7 @@ module Modis
62
62
 
63
63
  indexed_attributes.each do |attribute|
64
64
  key = index_key(attribute, read_attribute(attribute))
65
- redis.sadd(key, id)
65
+ redis.sadd(key, [id])
66
66
  end
67
67
  end
68
68
 
@@ -71,7 +71,7 @@ module Modis
71
71
 
72
72
  indexed_attributes.each do |attribute|
73
73
  key = index_key(attribute, read_attribute(attribute))
74
- redis.srem(key, id)
74
+ redis.srem(key, [id])
75
75
  end
76
76
  end
77
77
 
@@ -83,7 +83,8 @@ module Modis
83
83
 
84
84
  def deserialize(record)
85
85
  values = record.values
86
- values = MessagePack.unpack(msgpack_array_header(values.size) + values.join)
86
+ header = msgpack_array_header(values.size, values.first.encoding)
87
+ values = MessagePack.unpack(header + values.join)
87
88
  keys = record.keys
88
89
  values.each_with_index { |v, i| record[keys[i]] = v }
89
90
  record
@@ -97,14 +98,14 @@ module Modis
97
98
 
98
99
  private
99
100
 
100
- def msgpack_array_header(values_size)
101
+ def msgpack_array_header(values_size, encoding)
101
102
  if values_size < 16
102
103
  [0x90 | values_size].pack("C")
103
104
  elsif values_size < 65536
104
105
  [0xDC, values_size].pack("Cn")
105
106
  else
106
107
  [0xDD, values_size].pack("CN")
107
- end.force_encoding(Encoding::UTF_8)
108
+ end.force_encoding(encoding)
108
109
  end
109
110
  end
110
111
 
@@ -138,8 +139,8 @@ module Modis
138
139
  redis.pipelined do |pipeline|
139
140
  remove_from_indexes(pipeline)
140
141
  if self.class.all_index_enabled?
141
- pipeline.srem(self.class.key_for(:all), id)
142
- pipeline.srem(self.class.sti_base_key_for(:all), id) if self.class.sti_child?
142
+ pipeline.srem(self.class.key_for(:all), [id])
143
+ pipeline.srem(self.class.sti_base_key_for(:all), [id]) if self.class.sti_child?
143
144
  end
144
145
  pipeline.del(key)
145
146
  end
@@ -217,8 +218,8 @@ module Modis
217
218
 
218
219
  if new_record?
219
220
  if self.class.all_index_enabled?
220
- pipeline.sadd(self.class.key_for(:all), id)
221
- pipeline.sadd(self.class.sti_base_key_for(:all), id) if self.class.sti_child?
221
+ pipeline.sadd(self.class.key_for(:all), [id])
222
+ pipeline.sadd(self.class.sti_base_key_for(:all), [id]) if self.class.sti_child?
222
223
  end
223
224
  add_to_indexes(pipeline)
224
225
  else
data/lib/modis/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Modis
4
- VERSION = '4.0.1'
4
+ VERSION = '4.1.0'
5
5
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  begin
4
- if ENV['TRAVIS']
4
+ if ENV['CI']
5
5
  namespace :spec do
6
6
  task cane: ['spec']
7
7
  end
data/modis.gemspec CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |gem|
22
22
 
23
23
  gem.add_runtime_dependency 'activemodel', '>= 5.2'
24
24
  gem.add_runtime_dependency 'activesupport', '>= 5.2'
25
- gem.add_runtime_dependency 'redis', '>= 3.0'
25
+ gem.add_runtime_dependency 'redis', '>= 3.0', '< 5.0'
26
26
  gem.add_runtime_dependency 'connection_pool', '>= 2'
27
27
 
28
28
  if defined? JRUBY_VERSION
@@ -40,4 +40,5 @@ Gem::Specification.new do |gem|
40
40
  gem.add_development_dependency 'rubocop', '0.81.0'
41
41
  gem.add_development_dependency 'simplecov'
42
42
  gem.add_development_dependency 'hiredis', '>= 0.5'
43
+ gem.add_development_dependency 'github_changelog_generator'
43
44
  end
data/spec/finder_spec.rb CHANGED
@@ -183,7 +183,7 @@ describe Modis::Finder do
183
183
  it 'transparently upgrades old data' do
184
184
  consumer = FindersSpec::Consumer.create!(name: 'Ian')
185
185
  Modis.with_connection do |redis|
186
- redis.srem(FindersSpec::Consumer.key_for(:all), consumer.id)
186
+ redis.srem(FindersSpec::Consumer.key_for(:all), [consumer.id])
187
187
  end
188
188
  expect(FindersSpec::Consumer.find(consumer.id)).to eq(consumer)
189
189
  end
@@ -111,13 +111,8 @@ describe Modis::Persistence do
111
111
 
112
112
  it 'does not track the ID if the underlying Redis command failed' do
113
113
  redis = double(hmset: double(value: nil), sadd: nil)
114
- if Gem::Version.new(Redis::VERSION) > Gem::Version.new('4.6.0')
115
- expect(model.class).to receive(:transaction).and_yield(Redis::PipelinedConnection.new(Redis::Pipeline::Multi.new(redis)))
116
- expect(redis).to receive(:pipelined).and_yield(Redis::PipelinedConnection.new(Redis::Pipeline.new(redis)))
117
- else
118
- expect(model.class).to receive(:transaction).and_yield(redis)
119
- expect(redis).to receive(:pipelined).and_yield(redis)
120
- end
114
+ expect(model.class).to receive(:transaction).and_yield(redis)
115
+ expect(redis).to receive(:pipelined).and_yield(redis)
121
116
  model.save
122
117
  expect { model.class.find(model.id) }.to raise_error(Modis::RecordNotFound)
123
118
  end
@@ -140,13 +135,8 @@ describe Modis::Persistence do
140
135
  model.age = 11
141
136
  redis = double
142
137
  expect(redis).to receive(:hmset).with("modis:persistence_spec:mock_model:1", ["age", "\v"]).and_return(double(value: 'OK'))
143
- if Gem::Version.new(Redis::VERSION) > Gem::Version.new('4.6.0')
144
- expect(model.class).to receive(:transaction).and_yield(Redis::PipelinedConnection.new(Redis::Pipeline::Multi.new(redis)))
145
- expect(redis).to receive(:pipelined).and_yield(Redis::PipelinedConnection.new(Redis::Pipeline.new(redis)))
146
- else
147
- expect(model.class).to receive(:transaction).and_yield(redis)
148
- expect(redis).to receive(:pipelined).and_yield(redis)
149
- end
138
+ expect(model.class).to receive(:transaction).and_yield(redis)
139
+ expect(redis).to receive(:pipelined).and_yield(redis)
150
140
  model.save!
151
141
  expect(model.age).to eq(11)
152
142
  end
data/spec/spec_helper.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- unless ENV['TRAVIS']
3
+ unless ENV['CI']
4
4
  begin
5
5
  require './spec/support/simplecov_helper'
6
6
  include SimpleCovHelper # rubocop:disable Style/MixinUsage
@@ -11,7 +11,7 @@ module SimpleCovHelper
11
11
 
12
12
  formatters = [SimpleCov::Formatter::QualityFormatter]
13
13
 
14
- if ENV['TRAVIS']
14
+ if ENV['CI']
15
15
  require 'codeclimate-test-reporter'
16
16
 
17
17
  formatters << CodeClimate::TestReporter::Formatter if CodeClimate::TestReporter.run?
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.0.1
4
+ version: 4.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ian Leitch
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-02 00:00:00.000000000 Z
11
+ date: 2023-02-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -45,6 +45,9 @@ dependencies:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '3.0'
48
+ - - "<"
49
+ - !ruby/object:Gem::Version
50
+ version: '5.0'
48
51
  type: :runtime
49
52
  prerelease: false
50
53
  version_requirements: !ruby/object:Gem::Requirement
@@ -52,6 +55,9 @@ dependencies:
52
55
  - - ">="
53
56
  - !ruby/object:Gem::Version
54
57
  version: '3.0'
58
+ - - "<"
59
+ - !ruby/object:Gem::Version
60
+ version: '5.0'
55
61
  - !ruby/object:Gem::Dependency
56
62
  name: connection_pool
57
63
  requirement: !ruby/object:Gem::Requirement
@@ -192,6 +198,20 @@ dependencies:
192
198
  - - ">="
193
199
  - !ruby/object:Gem::Version
194
200
  version: '0.5'
201
+ - !ruby/object:Gem::Dependency
202
+ name: github_changelog_generator
203
+ requirement: !ruby/object:Gem::Requirement
204
+ requirements:
205
+ - - ">="
206
+ - !ruby/object:Gem::Version
207
+ version: '0'
208
+ type: :development
209
+ prerelease: false
210
+ version_requirements: !ruby/object:Gem::Requirement
211
+ requirements:
212
+ - - ">="
213
+ - !ruby/object:Gem::Version
214
+ version: '0'
195
215
  description: ActiveModel + Redis
196
216
  email:
197
217
  - port001@gmail.com
@@ -199,10 +219,11 @@ executables: []
199
219
  extensions: []
200
220
  extra_rdoc_files: []
201
221
  files:
222
+ - ".github/workflows/test.yml"
223
+ - ".github_changelog_generator"
202
224
  - ".gitignore"
203
225
  - ".rubocop.yml"
204
226
  - ".ruby-version"
205
- - ".travis.yml"
206
227
  - Appraisals
207
228
  - CHANGELOG.md
208
229
  - Gemfile
@@ -217,6 +238,7 @@ files:
217
238
  - gemfiles/rails_5.2.gemfile
218
239
  - gemfiles/rails_6.0.gemfile
219
240
  - gemfiles/rails_6.1.gemfile
241
+ - gemfiles/rails_7.0.gemfile
220
242
  - lib/modis.rb
221
243
  - lib/modis/attribute.rb
222
244
  - lib/modis/configuration.rb
@@ -258,7 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
258
280
  - !ruby/object:Gem::Version
259
281
  version: '0'
260
282
  requirements: []
261
- rubygems_version: 3.1.4
283
+ rubygems_version: 3.3.26
262
284
  signing_key:
263
285
  specification_version: 4
264
286
  summary: ActiveModel + Redis
data/.travis.yml DELETED
@@ -1,42 +0,0 @@
1
- language: ruby
2
-
3
- dist: bionic
4
-
5
- cache: bundler
6
-
7
- services:
8
- - redis-server
9
-
10
- rvm:
11
- - 2.3
12
- - 2.4
13
- - 2.5
14
- - 2.6
15
- - 2.7
16
- - 3.0
17
- - jruby-9.2.17.0
18
-
19
- gemfile:
20
- - gemfiles/rails_5.2.gemfile
21
- - gemfiles/rails_6.0.gemfile
22
- - gemfiles/rails_6.1.gemfile
23
-
24
- matrix:
25
- fast_finish: true
26
- exclude:
27
- # Rails 6 requires Ruby 2.5 or higher
28
- - gemfile: gemfiles/rails_6.0.gemfile
29
- rvm: 2.3
30
- - gemfile: gemfiles/rails_6.1.gemfile
31
- rvm: 2.3
32
- - gemfile: gemfiles/rails_6.0.gemfile
33
- rvm: 2.4
34
- - gemfile: gemfiles/rails_6.1.gemfile
35
- rvm: 2.4
36
- # Rails 5.2 isn't compatible with Ruby 3.0 or higher
37
- - gemfile: gemfiles/rails_5.2.gemfile
38
- rvm: 3.0
39
-
40
- env:
41
- global:
42
- secure: LrTz0Pq2ibNZuKDhdzcrvEUSNxUpPopEq9aJeCxy3UpV0v4vpHBtWV0S6zofvf98g/RkZ6cGI1u+0H578dHgE6pWTo+iR8LAwqPKofrFIWRkeo+M77Vs5swahb3mQyPOcig1hfVWDm25MsojePYm70eBIcBU55NWImtdePXfiU0=