activesupport_cache_database 0.1.1 → 0.1.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: b8117a7d193020df063b7d8787dd680d001cb5f1d93e2c2bf74bcf7d9a63fc1f
4
- data.tar.gz: 7178a4bf6d7a781327cc230dbc06633c1482b02d7cbf4122f16424f116a81b37
3
+ metadata.gz: 973852575f17d5bc8f4faf071724c054068e5ab070782dce02844a72d418dd2a
4
+ data.tar.gz: 7551068640fe8e9c00f0e7e4474909d21bcd05b8881723fe6907f9b152e278c4
5
5
  SHA512:
6
- metadata.gz: 52ae5e8fa77ae77b1ba4d113fe9252a6b5e546a8a19ab4bc9b7feae7ee8277b9671987f0c6cc6fed0da82adc311eeef53c2b889f866eb013b93b2845f747da0e
7
- data.tar.gz: ca01add6ff60f1011c55efd3284eac9349ba73f858ecea17cc1b2729fbcee8dc892256f046b5d3ebfbd65cd827c0853c3ddc789959f91acfacc68f7848c8398e
6
+ metadata.gz: 6420375b2577ed8f62df452e71d7d280d343d193666d52c36fa5a3aea4d57eac1e3ca81e902ad5ef141ce5190d829f488a8ec0686ee0d6b18481cdb55deadbd2
7
+ data.tar.gz: d79407e5d25930e3b5fe96785b9e953c293a3eb7825c288525b1a73252b151b09ab7976fd1360adf4c43fb3ad55eba2e237071720c6f9473f2efbcab512a59a1
@@ -1,65 +1,68 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- activesupport_cache_database (0.1.1)
4
+ activesupport_cache_database (0.1.2)
5
5
  activerecord (>= 5.0)
6
6
  activesupport (>= 5.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activemodel (6.0.0)
12
- activesupport (= 6.0.0)
13
- activerecord (6.0.0)
14
- activemodel (= 6.0.0)
15
- activesupport (= 6.0.0)
16
- activesupport (6.0.0)
11
+ activemodel (6.0.3.1)
12
+ activesupport (= 6.0.3.1)
13
+ activerecord (6.0.3.1)
14
+ activemodel (= 6.0.3.1)
15
+ activesupport (= 6.0.3.1)
16
+ activesupport (6.0.3.1)
17
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
18
  i18n (>= 0.7, < 2)
19
19
  minitest (~> 5.1)
20
20
  tzinfo (~> 1.1)
21
- zeitwerk (~> 2.1, >= 2.1.8)
21
+ zeitwerk (~> 2.2, >= 2.2.2)
22
22
  ast (2.4.0)
23
- concurrent-ruby (1.1.5)
23
+ concurrent-ruby (1.1.6)
24
24
  diff-lcs (1.3)
25
- i18n (1.6.0)
25
+ i18n (1.8.2)
26
26
  concurrent-ruby (~> 1.0)
27
- jaro_winkler (1.5.3)
28
- minitest (5.11.3)
29
- mysql2 (0.5.2)
30
- parallel (1.17.0)
31
- parser (2.6.4.1)
27
+ minitest (5.14.1)
28
+ mysql2 (0.5.3)
29
+ parallel (1.19.1)
30
+ parser (2.7.1.3)
32
31
  ast (~> 2.4.0)
33
- pg (1.1.4)
32
+ pg (1.2.3)
34
33
  rainbow (3.0.0)
35
- rake (12.3.3)
36
- rspec (3.8.0)
37
- rspec-core (~> 3.8.0)
38
- rspec-expectations (~> 3.8.0)
39
- rspec-mocks (~> 3.8.0)
40
- rspec-core (3.8.2)
41
- rspec-support (~> 3.8.0)
42
- rspec-expectations (3.8.4)
34
+ rake (13.0.1)
35
+ rexml (3.2.4)
36
+ rspec (3.9.0)
37
+ rspec-core (~> 3.9.0)
38
+ rspec-expectations (~> 3.9.0)
39
+ rspec-mocks (~> 3.9.0)
40
+ rspec-core (3.9.2)
41
+ rspec-support (~> 3.9.3)
42
+ rspec-expectations (3.9.2)
43
43
  diff-lcs (>= 1.2.0, < 2.0)
44
- rspec-support (~> 3.8.0)
45
- rspec-mocks (3.8.1)
44
+ rspec-support (~> 3.9.0)
45
+ rspec-mocks (3.9.1)
46
46
  diff-lcs (>= 1.2.0, < 2.0)
47
- rspec-support (~> 3.8.0)
48
- rspec-support (3.8.2)
49
- rubocop (0.74.0)
50
- jaro_winkler (~> 1.5.1)
47
+ rspec-support (~> 3.9.0)
48
+ rspec-support (3.9.3)
49
+ rubocop (0.84.0)
51
50
  parallel (~> 1.10)
52
- parser (>= 2.6)
51
+ parser (>= 2.7.0.1)
53
52
  rainbow (>= 2.2.2, < 4.0)
53
+ rexml
54
+ rubocop-ast (>= 0.0.3)
54
55
  ruby-progressbar (~> 1.7)
55
- unicode-display_width (>= 1.4.0, < 1.7)
56
+ unicode-display_width (>= 1.4.0, < 2.0)
57
+ rubocop-ast (0.0.3)
58
+ parser (>= 2.7.0.1)
56
59
  ruby-progressbar (1.10.1)
57
- sqlite3 (1.4.1)
60
+ sqlite3 (1.4.2)
58
61
  thread_safe (0.3.6)
59
- tzinfo (1.2.5)
62
+ tzinfo (1.2.7)
60
63
  thread_safe (~> 0.1)
61
- unicode-display_width (1.6.0)
62
- zeitwerk (2.1.10)
64
+ unicode-display_width (1.7.0)
65
+ zeitwerk (2.3.0)
63
66
 
64
67
  PLATFORMS
65
68
  ruby
@@ -75,4 +78,4 @@ DEPENDENCIES
75
78
  sqlite3
76
79
 
77
80
  BUNDLED WITH
78
- 2.0.2
81
+ 2.1.4
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'activesupport_cache_database'
3
- s.version = '0.1.1'
3
+ s.version = '0.1.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,13 +15,13 @@ module ActiveSupport
15
15
 
16
16
  # param [Hash] options options
17
17
  # option options [Class] :model model class. Default: ActiveSupport::Cache::DatabaseStore::Model
18
- def initialize(options=nil)
18
+ def initialize(options = nil)
19
19
  @model = (options || {}).delete(:model) || Model
20
20
  super(options)
21
21
  end
22
22
 
23
23
  # Preemptively iterates through all stored keys and removes the ones which have expired.
24
- def cleanup(options=nil)
24
+ def cleanup(options = nil)
25
25
  options = merged_options(options)
26
26
  scope = @model.expired
27
27
  if (namespace = options[:namespace])
@@ -31,7 +31,7 @@ module ActiveSupport
31
31
  end
32
32
 
33
33
  # Clears the entire cache. Be careful with this method.
34
- def clear(options=nil)
34
+ def clear(options = nil)
35
35
  options = merged_options(options)
36
36
  if (namespace = options[:namespace])
37
37
  @model.namespaced(namespace).delete_all
@@ -42,7 +42,7 @@ module ActiveSupport
42
42
  end
43
43
 
44
44
  # Calculates the number of entries in the cache.
45
- def count(options=nil)
45
+ def count(options = nil)
46
46
  options = merged_options(options)
47
47
  scope = @model.all
48
48
  if (namespace = options[:namespace])
@@ -54,24 +54,24 @@ module ActiveSupport
54
54
 
55
55
  private
56
56
 
57
- def normalize_key(name, options=nil)
57
+ def normalize_key(name, options = nil)
58
58
  key = super.to_s
59
59
  raise ArgumentError, 'Namespaced key exceeds the length limit' if key && key.bytesize > 255
60
60
 
61
61
  key
62
62
  end
63
63
 
64
- def read_entry(key, _options=nil)
64
+ def read_entry(key, _options = nil)
65
65
  from_record @model.where(key: key).first
66
66
  end
67
67
 
68
- def write_entry(key, entry, _options=nil)
68
+ def write_entry(key, entry, _options = nil)
69
69
  record = @model.where(key: key).first_or_initialize
70
70
  expires_at = Time.zone.at(entry.expires_at) if entry.expires_at
71
71
  record.update! value: Marshal.dump(entry.value), version: entry.version.presence, expires_at: expires_at
72
72
  end
73
73
 
74
- def delete_entry(key, _options=nil)
74
+ def delete_entry(key, _options = nil)
75
75
  @model.where(key: key).destroy_all
76
76
  end
77
77
 
@@ -89,7 +89,7 @@ module ActiveSupport
89
89
  next if entry.nil?
90
90
 
91
91
  if entry.expired?
92
- delete_entry(rec.key, options)
92
+ delete_entry(rec.key, **options)
93
93
  elsif entry.mismatched?(version)
94
94
  # Skip mismatched versions
95
95
  else
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.1.1
4
+ version: 0.1.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: 2019-09-12 00:00:00.000000000 Z
11
+ date: 2020-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -178,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
178
178
  - !ruby/object:Gem::Version
179
179
  version: '0'
180
180
  requirements: []
181
- rubygems_version: 3.0.3
181
+ rubygems_version: 3.1.2
182
182
  signing_key:
183
183
  specification_version: 4
184
184
  summary: ActiveSupport::Cache::Store implementation backed by ActiveRecord.