activesupport_cache_database 0.3.0 → 0.3.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: c3b2183683fc6cb4ec9bb735da8fed61f9e057b894bfef685416dfb019d924ee
4
- data.tar.gz: b493bb3f1a7aa74a27e87030fbefb98a3bf95cf98955bfbcf817382039776442
3
+ metadata.gz: '0840ceacca7159f5b4abd0ac006342cac7852ee2bcd8b993c81d43393ec2579e'
4
+ data.tar.gz: e25a5fde4bb9c870ef23df5f5ba8215f68504b366ddac2ea5cdab2dacddcba1c
5
5
  SHA512:
6
- metadata.gz: 1ce1549296de2188bbfa524c8745844bb150d0df44e0d1472a617d716279deafe758b13b7c577dba84c00697b4aeca8fe8048bc96936fd2e17021accdc03777a
7
- data.tar.gz: ae967fdb27b3597c4c1bc7ed58e57c6f4a59795a63dfc1df44caaae3b60ac3b53698df40131e8c17a0520202187e43e606a4f1cdb0471aaed0c1a7e4a1af6aab
6
+ metadata.gz: 718e24bd6dc5c98cd7c5694c8dc92a759725b53dede1076c5d6079d2ce956676f68b0fa0e20f9f17176d4a11162922185b1feded4073b34cf09b87804628a058
7
+ data.tar.gz: 1b463a7fa6e6c297f5a2c68cf16bde3565b33e9a6e03922a3109d8bf329aaa1b08046b509954ee56bce7c072f54101f7abeaca7fb90f51c506411680b297795d
@@ -11,7 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  strategy:
13
13
  matrix:
14
- ruby-version: ["2.7", "3.0", "3.1"]
14
+ ruby-version: ["2.7", "3.0", "3.1", "3.2"]
15
15
  gemfiles: ["Gemfile", "Gemfile.rails6"]
16
16
  env:
17
17
  BUNDLE_GEMFILE: ${{ matrix.gemfile }}
data/Gemfile CHANGED
@@ -1,2 +1,9 @@
1
1
  source 'https://rubygems.org'
2
2
  gemspec
3
+
4
+ gem 'mysql2'
5
+ gem 'pg'
6
+ gem 'rake'
7
+ gem 'rspec'
8
+ gem 'rubocop-bsm'
9
+ gem 'sqlite3'
data/Gemfile.lock CHANGED
@@ -1,88 +1,92 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activesupport_cache_database (0.3.0)
4
+ activesupport_cache_database (0.3.2)
5
5
  activerecord (>= 6.0)
6
6
  activesupport (>= 6.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activemodel (7.0.3.1)
12
- activesupport (= 7.0.3.1)
13
- activerecord (7.0.3.1)
14
- activemodel (= 7.0.3.1)
15
- activesupport (= 7.0.3.1)
16
- activesupport (7.0.3.1)
11
+ activemodel (7.0.4.2)
12
+ activesupport (= 7.0.4.2)
13
+ activerecord (7.0.4.2)
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
18
  i18n (>= 1.6, < 2)
19
19
  minitest (>= 5.1)
20
20
  tzinfo (~> 2.0)
21
21
  ast (2.4.2)
22
- concurrent-ruby (1.1.10)
22
+ concurrent-ruby (1.2.2)
23
23
  diff-lcs (1.5.0)
24
- i18n (1.11.0)
24
+ i18n (1.12.0)
25
25
  concurrent-ruby (~> 1.0)
26
- json (2.6.2)
27
- minitest (5.16.2)
28
- mysql2 (0.5.4)
26
+ json (2.6.3)
27
+ mini_portile2 (2.8.1)
28
+ minitest (5.17.0)
29
+ mysql2 (0.5.5)
29
30
  parallel (1.22.1)
30
- parser (3.1.2.0)
31
+ parser (3.2.1.0)
31
32
  ast (~> 2.4.1)
32
- pg (1.4.1)
33
+ pg (1.4.6)
33
34
  rainbow (3.1.1)
34
35
  rake (13.0.6)
35
- regexp_parser (2.5.0)
36
+ regexp_parser (2.7.0)
36
37
  rexml (3.2.5)
37
- rspec (3.11.0)
38
- rspec-core (~> 3.11.0)
39
- rspec-expectations (~> 3.11.0)
40
- rspec-mocks (~> 3.11.0)
41
- rspec-core (3.11.0)
42
- rspec-support (~> 3.11.0)
43
- rspec-expectations (3.11.0)
38
+ rspec (3.12.0)
39
+ rspec-core (~> 3.12.0)
40
+ rspec-expectations (~> 3.12.0)
41
+ rspec-mocks (~> 3.12.0)
42
+ rspec-core (3.12.1)
43
+ rspec-support (~> 3.12.0)
44
+ rspec-expectations (3.12.2)
44
45
  diff-lcs (>= 1.2.0, < 2.0)
45
- rspec-support (~> 3.11.0)
46
- rspec-mocks (3.11.1)
46
+ rspec-support (~> 3.12.0)
47
+ rspec-mocks (3.12.3)
47
48
  diff-lcs (>= 1.2.0, < 2.0)
48
- rspec-support (~> 3.11.0)
49
- rspec-support (3.11.0)
50
- rubocop (1.31.2)
49
+ rspec-support (~> 3.12.0)
50
+ rspec-support (3.12.0)
51
+ rubocop (1.47.0)
51
52
  json (~> 2.3)
52
53
  parallel (~> 1.10)
53
- parser (>= 3.1.0.0)
54
+ parser (>= 3.2.0.0)
54
55
  rainbow (>= 2.2.2, < 4.0)
55
56
  regexp_parser (>= 1.8, < 3.0)
56
57
  rexml (>= 3.2.5, < 4.0)
57
- rubocop-ast (>= 1.18.0, < 2.0)
58
+ rubocop-ast (>= 1.26.0, < 2.0)
58
59
  ruby-progressbar (~> 1.7)
59
- unicode-display_width (>= 1.4.0, < 3.0)
60
- rubocop-ast (1.19.1)
61
- parser (>= 3.1.1.0)
62
- rubocop-bsm (0.6.0)
60
+ unicode-display_width (>= 2.4.0, < 3.0)
61
+ rubocop-ast (1.27.0)
62
+ parser (>= 3.2.1.0)
63
+ rubocop-bsm (0.6.1)
63
64
  rubocop (~> 1.0)
64
65
  rubocop-performance
65
66
  rubocop-rake
66
67
  rubocop-rspec
67
- rubocop-performance (1.14.2)
68
+ rubocop-capybara (2.17.1)
69
+ rubocop (~> 1.41)
70
+ rubocop-performance (1.16.0)
68
71
  rubocop (>= 1.7.0, < 2.0)
69
72
  rubocop-ast (>= 0.4.0)
70
73
  rubocop-rake (0.6.0)
71
74
  rubocop (~> 1.0)
72
- rubocop-rspec (2.12.1)
73
- rubocop (~> 1.31)
75
+ rubocop-rspec (2.18.1)
76
+ rubocop (~> 1.33)
77
+ rubocop-capybara (~> 2.17)
74
78
  ruby-progressbar (1.11.0)
75
- sqlite3 (1.4.4)
76
- tzinfo (2.0.4)
79
+ sqlite3 (1.6.1)
80
+ mini_portile2 (~> 2.8.0)
81
+ tzinfo (2.0.6)
77
82
  concurrent-ruby (~> 1.0)
78
- unicode-display_width (2.2.0)
83
+ unicode-display_width (2.4.2)
79
84
 
80
85
  PLATFORMS
81
86
  ruby
82
87
 
83
88
  DEPENDENCIES
84
89
  activesupport_cache_database!
85
- bundler
86
90
  mysql2
87
91
  pg
88
92
  rake
data/Gemfile.rails6 CHANGED
@@ -3,3 +3,9 @@ gemspec
3
3
 
4
4
  gem 'activesupport', '~> 6.1'
5
5
  gem 'activerecord', '~> 6.1'
6
+ gem 'mysql2'
7
+ gem 'pg'
8
+ gem 'rake'
9
+ gem 'rspec'
10
+ gem 'rubocop-bsm'
11
+ gem 'sqlite3'
data/Gemfile.rails6.lock CHANGED
@@ -1,83 +1,86 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activesupport_cache_database (0.3.0)
5
- activerecord (>= 5.0)
6
- activesupport (>= 5.0)
4
+ activesupport_cache_database (0.3.1)
5
+ activerecord (>= 6.0)
6
+ activesupport (>= 6.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activemodel (6.1.6.1)
12
- activesupport (= 6.1.6.1)
13
- activerecord (6.1.6.1)
14
- activemodel (= 6.1.6.1)
15
- activesupport (= 6.1.6.1)
16
- activesupport (6.1.6.1)
11
+ activemodel (6.1.7.2)
12
+ activesupport (= 6.1.7.2)
13
+ activerecord (6.1.7.2)
14
+ activemodel (= 6.1.7.2)
15
+ activesupport (= 6.1.7.2)
16
+ activesupport (6.1.7.2)
17
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
18
  i18n (>= 1.6, < 2)
19
19
  minitest (>= 5.1)
20
20
  tzinfo (~> 2.0)
21
21
  zeitwerk (~> 2.3)
22
22
  ast (2.4.2)
23
- concurrent-ruby (1.1.10)
23
+ concurrent-ruby (1.2.0)
24
24
  diff-lcs (1.5.0)
25
- i18n (1.11.0)
25
+ i18n (1.12.0)
26
26
  concurrent-ruby (~> 1.0)
27
- json (2.6.2)
28
- minitest (5.16.2)
29
- mysql2 (0.5.4)
27
+ json (2.6.3)
28
+ minitest (5.17.0)
29
+ mysql2 (0.5.5)
30
30
  parallel (1.22.1)
31
- parser (3.1.2.0)
31
+ parser (3.2.0.0)
32
32
  ast (~> 2.4.1)
33
- pg (1.4.1)
33
+ pg (1.4.5)
34
34
  rainbow (3.1.1)
35
35
  rake (13.0.6)
36
- regexp_parser (2.5.0)
36
+ regexp_parser (2.6.2)
37
37
  rexml (3.2.5)
38
- rspec (3.11.0)
39
- rspec-core (~> 3.11.0)
40
- rspec-expectations (~> 3.11.0)
41
- rspec-mocks (~> 3.11.0)
42
- rspec-core (3.11.0)
43
- rspec-support (~> 3.11.0)
44
- rspec-expectations (3.11.0)
38
+ rspec (3.12.0)
39
+ rspec-core (~> 3.12.0)
40
+ rspec-expectations (~> 3.12.0)
41
+ rspec-mocks (~> 3.12.0)
42
+ rspec-core (3.12.0)
43
+ rspec-support (~> 3.12.0)
44
+ rspec-expectations (3.12.2)
45
45
  diff-lcs (>= 1.2.0, < 2.0)
46
- rspec-support (~> 3.11.0)
47
- rspec-mocks (3.11.1)
46
+ rspec-support (~> 3.12.0)
47
+ rspec-mocks (3.12.3)
48
48
  diff-lcs (>= 1.2.0, < 2.0)
49
- rspec-support (~> 3.11.0)
50
- rspec-support (3.11.0)
51
- rubocop (1.31.2)
49
+ rspec-support (~> 3.12.0)
50
+ rspec-support (3.12.0)
51
+ rubocop (1.44.1)
52
52
  json (~> 2.3)
53
53
  parallel (~> 1.10)
54
- parser (>= 3.1.0.0)
54
+ parser (>= 3.2.0.0)
55
55
  rainbow (>= 2.2.2, < 4.0)
56
56
  regexp_parser (>= 1.8, < 3.0)
57
57
  rexml (>= 3.2.5, < 4.0)
58
- rubocop-ast (>= 1.18.0, < 2.0)
58
+ rubocop-ast (>= 1.24.1, < 2.0)
59
59
  ruby-progressbar (~> 1.7)
60
- unicode-display_width (>= 1.4.0, < 3.0)
61
- rubocop-ast (1.19.1)
60
+ unicode-display_width (>= 2.4.0, < 3.0)
61
+ rubocop-ast (1.24.1)
62
62
  parser (>= 3.1.1.0)
63
- rubocop-bsm (0.6.0)
63
+ rubocop-bsm (0.6.1)
64
64
  rubocop (~> 1.0)
65
65
  rubocop-performance
66
66
  rubocop-rake
67
67
  rubocop-rspec
68
- rubocop-performance (1.14.2)
68
+ rubocop-capybara (2.17.0)
69
+ rubocop (~> 1.41)
70
+ rubocop-performance (1.15.2)
69
71
  rubocop (>= 1.7.0, < 2.0)
70
72
  rubocop-ast (>= 0.4.0)
71
73
  rubocop-rake (0.6.0)
72
74
  rubocop (~> 1.0)
73
- rubocop-rspec (2.12.1)
74
- rubocop (~> 1.31)
75
+ rubocop-rspec (2.18.1)
76
+ rubocop (~> 1.33)
77
+ rubocop-capybara (~> 2.17)
75
78
  ruby-progressbar (1.11.0)
76
- sqlite3 (1.4.4)
77
- tzinfo (2.0.4)
79
+ sqlite3 (1.6.0-x86_64-linux)
80
+ tzinfo (2.0.6)
78
81
  concurrent-ruby (~> 1.0)
79
- unicode-display_width (2.2.0)
80
- zeitwerk (2.6.0)
82
+ unicode-display_width (2.4.2)
83
+ zeitwerk (2.6.6)
81
84
 
82
85
  PLATFORMS
83
86
  x86_64-linux
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'activesupport_cache_database'
3
- s.version = '0.3.0'
3
+ s.version = '0.3.2'
4
4
  s.authors = ['Black Square Media Ltd']
5
5
  s.email = ['info@blacksquaremedia.com']
6
6
  s.summary = %(ActiveSupport::Cache::Store implementation backed by ActiveRecord.)
@@ -15,12 +15,5 @@ Gem::Specification.new do |s|
15
15
  s.add_dependency 'activerecord', '>= 6.0'
16
16
  s.add_dependency 'activesupport', '>= 6.0'
17
17
 
18
- s.add_development_dependency 'bundler'
19
- s.add_development_dependency 'mysql2'
20
- s.add_development_dependency 'pg'
21
- s.add_development_dependency 'rake'
22
- s.add_development_dependency 'rspec'
23
- s.add_development_dependency 'rubocop-bsm'
24
- s.add_development_dependency 'sqlite3'
25
18
  s.metadata['rubygems_mfa_required'] = 'true'
26
19
  end
@@ -74,6 +74,13 @@ module ActiveSupport
74
74
  record = @model.where(key: key).first_or_initialize
75
75
  expires_at = Time.zone.at(entry.expires_at) if entry.expires_at
76
76
  record.update! value: Marshal.dump(entry.value), version: entry.version.presence, expires_at: expires_at
77
+ rescue ActiveRecord::RecordNotUnique
78
+ # If two servers initialize a new record with the same cache key and try to save it,
79
+ # the saves will race. We do not need to ensure a specific save wins, but we do need to ensure
80
+ # that at least one of the saves succeeds and that none of the saves raise an exception.
81
+ # In practive it means that if there alread was a save that "won" from us and completed earlier
82
+ # we don't need to do anything.
83
+ true
77
84
  end
78
85
 
79
86
  def delete_entry(key, _options = nil)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activesupport_cache_database
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Black Square Media Ltd
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-13 00:00:00.000000000 Z
11
+ date: 2023-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -38,104 +38,6 @@ dependencies:
38
38
  - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '6.0'
41
- - !ruby/object:Gem::Dependency
42
- name: bundler
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
55
- - !ruby/object:Gem::Dependency
56
- name: mysql2
57
- requirement: !ruby/object:Gem::Requirement
58
- requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '0'
62
- type: :development
63
- prerelease: false
64
- version_requirements: !ruby/object:Gem::Requirement
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- version: '0'
69
- - !ruby/object:Gem::Dependency
70
- name: pg
71
- requirement: !ruby/object:Gem::Requirement
72
- requirements:
73
- - - ">="
74
- - !ruby/object:Gem::Version
75
- version: '0'
76
- type: :development
77
- prerelease: false
78
- version_requirements: !ruby/object:Gem::Requirement
79
- requirements:
80
- - - ">="
81
- - !ruby/object:Gem::Version
82
- version: '0'
83
- - !ruby/object:Gem::Dependency
84
- name: rake
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - ">="
88
- - !ruby/object:Gem::Version
89
- version: '0'
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - ">="
95
- - !ruby/object:Gem::Version
96
- version: '0'
97
- - !ruby/object:Gem::Dependency
98
- name: rspec
99
- requirement: !ruby/object:Gem::Requirement
100
- requirements:
101
- - - ">="
102
- - !ruby/object:Gem::Version
103
- version: '0'
104
- type: :development
105
- prerelease: false
106
- version_requirements: !ruby/object:Gem::Requirement
107
- requirements:
108
- - - ">="
109
- - !ruby/object:Gem::Version
110
- version: '0'
111
- - !ruby/object:Gem::Dependency
112
- name: rubocop-bsm
113
- requirement: !ruby/object:Gem::Requirement
114
- requirements:
115
- - - ">="
116
- - !ruby/object:Gem::Version
117
- version: '0'
118
- type: :development
119
- prerelease: false
120
- version_requirements: !ruby/object:Gem::Requirement
121
- requirements:
122
- - - ">="
123
- - !ruby/object:Gem::Version
124
- version: '0'
125
- - !ruby/object:Gem::Dependency
126
- name: sqlite3
127
- requirement: !ruby/object:Gem::Requirement
128
- requirements:
129
- - - ">="
130
- - !ruby/object:Gem::Version
131
- version: '0'
132
- type: :development
133
- prerelease: false
134
- version_requirements: !ruby/object:Gem::Requirement
135
- requirements:
136
- - - ">="
137
- - !ruby/object:Gem::Version
138
- version: '0'
139
41
  description: Use your DB as a cache store
140
42
  email:
141
43
  - info@blacksquaremedia.com
@@ -179,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
81
  - !ruby/object:Gem::Version
180
82
  version: '0'
181
83
  requirements: []
182
- rubygems_version: 3.3.7
84
+ rubygems_version: 3.4.6
183
85
  signing_key:
184
86
  specification_version: 4
185
87
  summary: ActiveSupport::Cache::Store implementation backed by ActiveRecord.