lru_redux_store 0.1.0.alpha → 0.1.2.alpha

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: 6bcc0e3bda88de5344be1eed33c06f985ad9ec76e252cfd4732830c24afe5760
4
- data.tar.gz: 53478ad2d249f38690225ca43606f5e290cf6ab16de659f3d067459cf08ae9b8
3
+ metadata.gz: ff8cd15d2352f04af4ea3cf6687995bf51cd9e1214c17a070d74badf70513ef3
4
+ data.tar.gz: e57041c422fd0104dc87f3df4ae9c6f39fe9c42d07b35fcbf617788dd2bd3f97
5
5
  SHA512:
6
- metadata.gz: c148200eb44a574e137cf57b4c9340055ed261db1c68cd54e0c8d02dbcfac1140893ec58576675cb2adbafdce584db4f6d14e56e55936a99380daea0e445ea3a
7
- data.tar.gz: 1104df0afb5b9112424b5c0366cd98d2e38d59fe10df7420d68ef9649656b6ae8401986169662091993244399a6c1bc090574a918dc87b2d14480e3ba001cd99
6
+ metadata.gz: a425e6ad9413300b93af8d43b3171ee37bbcda8d2929cfc59a6cd8c25290e1385dafb5a78b8e2802e6ec4f71c37130b01fa3ccc0ffff5d5663526d4bf7974405
7
+ data.tar.gz: b5e6e15bef9ed665428a72d4f1632c7cd51321cd3f2df6b53373cc523d0a79daf063efa4c36fe130f88fa0a27ab7dc9cb5bc4391feddcaf47f92dcbaca4f41bd
@@ -0,0 +1,8 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: bundler
4
+ directory: "/"
5
+ schedule:
6
+ interval: daily
7
+ time: "13:00"
8
+ open-pull-requests-limit: 10
@@ -0,0 +1,59 @@
1
+ # This workflow uses actions that are not certified by GitHub.
2
+ # They are provided by a third-party and are governed by
3
+ # separate terms of service, privacy policy, and support
4
+ # documentation.
5
+ # This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
6
+ # For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
7
+
8
+ name: Ruby
9
+
10
+ on:
11
+ pull_request:
12
+ branches: [main]
13
+
14
+ jobs:
15
+ test:
16
+ runs-on: ubuntu-latest
17
+ strategy:
18
+ matrix:
19
+ ruby: ["3.3", "3.4", "4.0"]
20
+ rails: ["rails-7.2", "rails-8.0", "rails-8.1", "rails-edge"]
21
+ env:
22
+ MATRIX_RUBY: ${{ matrix.ruby }}
23
+ MATRIX_RAILS: ${{ matrix.rails }}
24
+ steps:
25
+ - uses: actions/checkout@v7
26
+ - uses: ruby/setup-ruby@v1
27
+ with:
28
+ ruby-version: ${{ matrix.ruby }}
29
+ bundler-cache: true
30
+ - name: Bundle install
31
+ run: |
32
+ bundle install --jobs 4 --retry 3
33
+ - name: Appraisal install
34
+ run: |
35
+ bundle exec appraisal "$MATRIX_RAILS" bundle install
36
+ - name: Run tests
37
+ run: |
38
+ bundle exec appraisal "$MATRIX_RAILS" rake spec
39
+ tests:
40
+ needs: test
41
+ if: ${{ always() }}
42
+ runs-on: ubuntu-latest
43
+ steps:
44
+ - name: Check matrix status
45
+ if: ${{ needs.test.result != 'success' }}
46
+ run: exit 1
47
+ lint:
48
+ runs-on: ubuntu-latest
49
+ steps:
50
+ - uses: actions/checkout@v7
51
+ - uses: ruby/setup-ruby@v1
52
+ with:
53
+ ruby-version: "4.0" # Not needed with a .ruby-version file
54
+ bundler-cache: true
55
+ - name: Bundle install
56
+ run: |
57
+ bundle install --jobs 4 --retry 3
58
+ - name: Rubocop
59
+ run: bundle exec rubocop --format github
data/.gitignore CHANGED
@@ -7,3 +7,5 @@
7
7
  /spec/reports/
8
8
  /tmp/
9
9
  Gemfile.lock
10
+ .DS_Store
11
+ gemfiles/*gemfile.lock
data/.rubocop.yml CHANGED
@@ -10,26 +10,34 @@ AllCops:
10
10
  NewCops: enable
11
11
  TargetRubyVersion: 3.3
12
12
  SuggestExtensions: false
13
- Exclude:
14
- - bench/**/*
15
13
 
16
- Style/Documentation:
14
+ Gemspec/DevelopmentDependencies:
17
15
  Enabled: false
18
16
 
19
- Gemspec/DevelopmentDependencies:
17
+ Layout/LineLength:
20
18
  Enabled: false
21
19
 
22
- # One class implements the entire cache store API surface.
23
20
  Metrics/ClassLength:
24
- Max: 110
21
+ Enabled: false
25
22
 
26
- # This gem runs outside Rails: no Time.zone is configured, and wall-clock
27
- # Time.now is what the store and the backing sin_lru_redux cache use.
28
- Rails/TimeZone:
23
+ Metrics/AbcSize:
24
+ Enabled: false
25
+
26
+ RSpec/ExampleLength:
27
+ Enabled: false
28
+
29
+ Metrics/MethodLength:
30
+ Enabled: false
31
+
32
+ Style/Documentation:
29
33
  Enabled: false
30
34
 
31
- # ActiveSupport::Cache::Store#fetch takes options as its second positional
32
- # argument, not a default value, so the Hash#fetch rewrite does not apply.
33
35
  Style/RedundantFetchBlock:
36
+ Enabled: false
37
+
38
+ Rails/RakeEnvironment:
39
+ Enabled: false
40
+
41
+ Rails/TimeZone:
34
42
  Exclude:
35
- - spec/**/*_spec.rb
43
+ - spec/lru_redux_store/store_spec.rb
data/.rubocop_todo.yml CHANGED
@@ -0,0 +1,15 @@
1
+ # This configuration was generated by
2
+ # `rubocop --auto-gen-config`
3
+ # on 2026-07-25 23:16:59 UTC using RuboCop version 1.88.2.
4
+ # The point is for the user to remove these configuration records
5
+ # one by one as the offenses are removed from the code base.
6
+ # Note that changes in the inspected code, or installation of new
7
+ # versions of RuboCop, may require this file to be generated again.
8
+
9
+ # Offense count: 32
10
+ # This cop supports safe autocorrection (--autocorrect).
11
+ # Configuration parameters: MaxUnannotatedPlaceholdersAllowed, Mode, AllowedMethods, AllowedPatterns.
12
+ # SupportedStyles: annotated, template, unannotated
13
+ # AllowedMethods: redirect
14
+ Style/FormatStringToken:
15
+ EnforcedStyle: unannotated
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # LruReduxStore
1
+ # LruReduxStore [![Gem Version](https://badge.fury.io/rb/lru_redux_store.svg)](https://badge.fury.io/rb/lru_redux_store)
2
2
 
3
3
  This gem provides an [`ActiveSupport::Cache::Store`](https://api.rubyonrails.org/classes/ActiveSupport/Cache/Store.html) implementation backed by [`sin_lru_redux`](https://github.com/cadenza-tech/sin_lru_redux), an "efficient and thread-safe LRU cache". It's a drop-in alternative to `ActiveSupport::Cache::MemoryStore` that's bounded by entry count instead of estimated byte size.
4
4
 
data/Rakefile CHANGED
@@ -4,3 +4,5 @@ require 'bundler/gem_tasks'
4
4
  require 'rspec/core/rake_task'
5
5
 
6
6
  RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file was generated by Appraisal
4
+
5
+ source 'https://rubygems.org'
6
+
7
+ gem 'rails', '~> 7.2.0'
8
+
9
+ gemspec path: '../'
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file was generated by Appraisal
4
+
5
+ source 'https://rubygems.org'
6
+
7
+ gem 'rails', '~> 8.0.2'
8
+
9
+ gemspec path: '../'
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file was generated by Appraisal
4
+
5
+ source 'https://rubygems.org'
6
+
7
+ gem 'rails', '~> 8.1.0'
8
+
9
+ gemspec path: '../'
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ # This file was generated by Appraisal
4
+
5
+ source 'https://rubygems.org'
6
+
7
+ gem 'rails', github: 'rails/rails'
8
+
9
+ gemspec path: '../'
@@ -63,7 +63,7 @@ module LruReduxStore
63
63
 
64
64
  # Preemptively iterates through all stored keys and removes the ones which have expired.
65
65
  def cleanup(_options = nil)
66
- _instrument(:cleanup, size: @data.count) do
66
+ instrument(:cleanup, size: @data.count) do
67
67
  synchronize { @data.expire }
68
68
  end
69
69
  end
@@ -163,7 +163,7 @@ module LruReduxStore
163
163
 
164
164
  # Modifies the amount of an integer value that is stored in the cache.
165
165
  # If the key is not found it is created and set to +amount+.
166
- def modify_value(name, amount, **options) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
166
+ def modify_value(name, amount, **options)
167
167
  options = merged_options options
168
168
  key = normalize_key name, options
169
169
  version = normalize_version name, options
@@ -2,5 +2,5 @@
2
2
 
3
3
  module LruReduxStore
4
4
  # Current release version.
5
- VERSION = '0.1.0.alpha'
5
+ VERSION = '0.1.2.alpha'
6
6
  end
@@ -11,10 +11,8 @@ Gem::Specification.new do |spec|
11
11
  spec.email = ['modosc@users.noreply.github.com']
12
12
 
13
13
  spec.summary = 'An ActiveSupport::Cache::Store backed by sin_lru_redux.'
14
- spec.description = 'A bounded, thread-safe, in-memory cache store for Rails. ' \
15
- 'Backed by sin_lru_redux for O(1) LRU eviction with optional TTL, ' \
16
- 'it stores raw values with no serialization and emits the same ' \
17
- 'interface as ActiveSupport::Cache::Store.'
14
+ spec.description = "This gem provides an ActiveSupport::Cache::Store implementation backed by sin_lru_redux, an \"efficient and thread-safe LRU cache\". It's a drop-in alternative to ActiveSupport::Cache::MemoryStore that's bounded by entry count instead of estimated byte size."
15
+
18
16
  spec.homepage = 'https://github.com/modosc/lru_redux_store'
19
17
  spec.required_ruby_version = '>= 3.3.0'
20
18
 
@@ -40,7 +38,7 @@ Gem::Specification.new do |spec|
40
38
  spec.add_development_dependency 'rspec-rails', '~> 8.0.2'
41
39
  spec.add_development_dependency 'rubocop', '~> 1.88.2'
42
40
  spec.add_development_dependency 'rubocop-performance', '~> 1.26.0'
43
- spec.add_development_dependency 'rubocop-rails', '~> 2.35.5'
41
+ spec.add_development_dependency 'rubocop-rails', '~> 2.36.0'
44
42
  spec.add_development_dependency 'rubocop-rspec', '~> 3.10.2'
45
43
  spec.add_dependency 'activesupport', '>= 7.2.0'
46
44
  spec.add_dependency 'sin_lru_redux', '>= 2.5.2'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lru_redux_store
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0.alpha
4
+ version: 0.1.2.alpha
5
5
  platform: ruby
6
6
  authors:
7
7
  - jonathan schatz
@@ -141,14 +141,14 @@ dependencies:
141
141
  requirements:
142
142
  - - "~>"
143
143
  - !ruby/object:Gem::Version
144
- version: 2.35.5
144
+ version: 2.36.0
145
145
  type: :development
146
146
  prerelease: false
147
147
  version_requirements: !ruby/object:Gem::Requirement
148
148
  requirements:
149
149
  - - "~>"
150
150
  - !ruby/object:Gem::Version
151
- version: 2.35.5
151
+ version: 2.36.0
152
152
  - !ruby/object:Gem::Dependency
153
153
  name: rubocop-rspec
154
154
  requirement: !ruby/object:Gem::Requirement
@@ -205,15 +205,18 @@ dependencies:
205
205
  - - ">="
206
206
  - !ruby/object:Gem::Version
207
207
  version: 2.5.0
208
- description: A bounded, thread-safe, in-memory cache store for Rails. Backed by sin_lru_redux
209
- for O(1) LRU eviction with optional TTL, it stores raw values with no serialization
210
- and emits the same interface as ActiveSupport::Cache::Store.
208
+ description: This gem provides an ActiveSupport::Cache::Store implementation backed
209
+ by sin_lru_redux, an "efficient and thread-safe LRU cache". It's a drop-in alternative
210
+ to ActiveSupport::Cache::MemoryStore that's bounded by entry count instead of estimated
211
+ byte size.
211
212
  email:
212
213
  - modosc@users.noreply.github.com
213
214
  executables: []
214
215
  extensions: []
215
216
  extra_rdoc_files: []
216
217
  files:
218
+ - ".github/dependabot.yml"
219
+ - ".github/workflows/ruby.yml"
217
220
  - ".gitignore"
218
221
  - ".rspec"
219
222
  - ".rubocop.yml"
@@ -231,6 +234,10 @@ files:
231
234
  - bench/bench_ttl.rb
232
235
  - bin/console
233
236
  - bin/setup
237
+ - gemfiles/rails_7.2.gemfile
238
+ - gemfiles/rails_8.0.gemfile
239
+ - gemfiles/rails_8.1.gemfile
240
+ - gemfiles/rails_edge.gemfile
234
241
  - lib/active_support/cache/lru_redux_store.rb
235
242
  - lib/lru_redux_store.rb
236
243
  - lib/lru_redux_store/dup_coder.rb
@@ -260,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
260
267
  - !ruby/object:Gem::Version
261
268
  version: '0'
262
269
  requirements: []
263
- rubygems_version: 4.0.12
270
+ rubygems_version: 4.0.10
264
271
  specification_version: 4
265
272
  summary: An ActiveSupport::Cache::Store backed by sin_lru_redux.
266
273
  test_files: []