sin_lru_redux 2.5.2 → 2.5.3

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: cf7571b2016719c1a7c64a739ecf886af45734c84ade0216148670379839c043
4
- data.tar.gz: e31ef06f5733165370594ae6b870a5c532821678e1ca89d96ca6b7981d9248d3
3
+ metadata.gz: 9e14886d30c8fc7cd6893fd4d68f28ac6b6cf742d3be939967e657a2ced2b98b
4
+ data.tar.gz: 6cc3dcd349da61671a5190f1407cfc0e5a2e64801cd813c0025101f6df8e67e0
5
5
  SHA512:
6
- metadata.gz: c23b6af4cb525d28dfdecfa9d992f4c4ed3ee9e6f40bcc64c416a5b087f69fd09f388bdc19c12e39f1d4f80c33f0eda11c31d1b8349096741b6feb58a005640a
7
- data.tar.gz: 85c3b9945a983f6fa3432b17f372d3fd0a24144492c9d676d4fff45760cb2f042f35d80a44461a9154f87dcee49db457a795b32b8d62da8f79eac9ed1ed2e68f
6
+ metadata.gz: 248e8b68ac632ed472984ed30ced2626a8e3c834bddf7c241932bbb94cacabdc8be6ac35f2f857e75bdf008907653146f50ae21329fd551fa66ec70c7e14d1ce
7
+ data.tar.gz: deda0e08bef579e9a6fe3459dc88e60cf3457759225d2ad5f345d0a0bfffb7e0f75a4f29cd62ca08155331c977b5c3d0a6cbcd97faea1da9ae111e23e6044301
data/CHANGELOG.md CHANGED
@@ -1,5 +1,35 @@
1
1
  # Changelog
2
2
 
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [2.5.3] - 2026-08-10
9
+
10
+ ### Changed
11
+
12
+ - Restructure cache tests with shared modules
13
+ - Add tests for TTL cache count and expire
14
+ - Minimize gem version constraints
15
+ - Remove unneeded json gem dependency
16
+ - Pin json and minitest gem versions on TruffleRuby
17
+ - Remove ineffective version metadata from gemspec
18
+ - Improve lint CI
19
+ - Remove assign workflow
20
+ - Add newer Ruby versions to test matrix
21
+ - Update release and lint CI Ruby version to 4.0
22
+ - Upgrade actions/checkout to v7
23
+ - Update .rubocop.yml
24
+ - Update .gitignore
25
+ - Update README.md
26
+ - Update sponsor links
27
+
28
+ ### Fixed
29
+
30
+ - Fix `LruRedux::TTL::Cache#count`, `#length`, and `#size` to evict expired items
31
+ - Fix `LruRedux::TTL::ThreadSafeCache#expire`, `#length`, and `#size` to synchronize access
32
+
3
33
  ## [2.5.2] - 2025-3-12
4
34
 
5
35
  - Other: Update summary
@@ -113,3 +143,21 @@
113
143
  ## [0.0.4] - 2013-4-23
114
144
 
115
145
  - Initial version
146
+
147
+ [2.5.3]: https://github.com/cadenza-tech/sin_lru_redux/compare/v2.5.2...v2.5.3
148
+ [2.5.2]: https://github.com/cadenza-tech/sin_lru_redux/compare/v2.5.1...v2.5.2
149
+ [2.5.1]: https://github.com/cadenza-tech/sin_lru_redux/compare/v2.5.0...v2.5.1
150
+ [2.5.0]: https://github.com/cadenza-tech/sin_lru_redux/compare/v2.4.0...v2.5.0
151
+ [2.4.0]: https://github.com/cadenza-tech/sin_lru_redux/compare/v2.3.0...v2.4.0
152
+ [2.3.0]: https://github.com/cadenza-tech/sin_lru_redux/compare/v2.2.1...v2.3.0
153
+ [2.2.1]: https://github.com/cadenza-tech/sin_lru_redux/compare/v2.2.0...v2.2.1
154
+ [2.2.0]: https://github.com/cadenza-tech/sin_lru_redux/compare/v2.1.0...v2.2.0
155
+ [2.1.0]: https://github.com/cadenza-tech/sin_lru_redux/compare/v2.0.1...v2.1.0
156
+ [2.0.1]: https://github.com/cadenza-tech/sin_lru_redux/compare/v2.0.0...v2.0.1
157
+ [2.0.0]: https://github.com/cadenza-tech/sin_lru_redux/compare/v1.1.0...v2.0.0
158
+ [1.1.0]: https://github.com/cadenza-tech/sin_lru_redux/compare/v1.0.0...v1.1.0
159
+ [1.0.0]: https://github.com/cadenza-tech/sin_lru_redux/compare/v0.8.4...v1.0.0
160
+ [0.8.4]: https://github.com/cadenza-tech/sin_lru_redux/compare/v0.8.3...v0.8.4
161
+ [0.8.3]: https://github.com/cadenza-tech/sin_lru_redux/compare/v0.8.2...v0.8.3
162
+ [0.8.2]: https://github.com/cadenza-tech/sin_lru_redux/compare/0.8.1...v0.8.2
163
+ [0.8.1]: https://github.com/cadenza-tech/sin_lru_redux/releases/tag/0.8.1
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![License](https://img.shields.io/github/license/cadenza-tech/sin_lru_redux?label=License&labelColor=343B42&color=blue)](https://github.com/cadenza-tech/sin_lru_redux/blob/main/LICENSE.txt) [![Tag](https://img.shields.io/github/tag/cadenza-tech/sin_lru_redux?label=Tag&logo=github&labelColor=343B42&color=2EBC4F)](https://github.com/cadenza-tech/sin_lru_redux/blob/main/CHANGELOG.md) [![Release](https://github.com/cadenza-tech/sin_lru_redux/actions/workflows/release.yml/badge.svg)](https://github.com/cadenza-tech/sin_lru_redux/actions?query=workflow%3Arelease) [![Test](https://github.com/cadenza-tech/sin_lru_redux/actions/workflows/test.yml/badge.svg)](https://github.com/cadenza-tech/sin_lru_redux/actions?query=workflow%3Atest) [![Lint](https://github.com/cadenza-tech/sin_lru_redux/actions/workflows/lint.yml/badge.svg)](https://github.com/cadenza-tech/sin_lru_redux/actions?query=workflow%3Alint)
4
4
 
5
- Efficient and thread-safe LRU cache
5
+ Efficient and thread-safe LRU cache.
6
6
 
7
7
  Forked from [LruRedux](https://github.com/SamSaffron/lru_redux).
8
8
 
@@ -181,4 +181,4 @@ Everyone interacting in the SinLruRedux project's codebases, issue trackers, cha
181
181
 
182
182
  ## Sponsor
183
183
 
184
- You can sponsor this project on [Patreon](https://patreon.com/CadenzaTech).
184
+ You can sponsor this project on [GitHub Sponsors](https://github.com/sponsors/cadenza-tech).
data/Rakefile CHANGED
@@ -8,4 +8,6 @@ Rake::TestTask.new(:test) do |task|
8
8
  task.pattern = 'test/**/test_*.rb'
9
9
  end
10
10
 
11
- RuboCop::RakeTask.new
11
+ RuboCop::RakeTask.new(:rubocop) do |task|
12
+ task.options = ['--format', ENV['RUBOCOP_FORMAT']] if ENV['RUBOCOP_FORMAT']
13
+ end
@@ -135,6 +135,8 @@ module LruRedux
135
135
  end
136
136
 
137
137
  def count
138
+ evict_expired
139
+
138
140
  @data_lru.size
139
141
  end
140
142
  alias_method :length, :count
@@ -4,6 +4,12 @@ module LruRedux
4
4
  module TTL
5
5
  class ThreadSafeCache < Cache
6
6
  include ::LruRedux::Util::SafeSync
7
+
8
+ def expire
9
+ synchronize do
10
+ super
11
+ end
12
+ end
7
13
  end
8
14
  end
9
15
  end
@@ -89,7 +89,7 @@ module LruRedux
89
89
  end
90
90
  end
91
91
 
92
- def has_key?(key) # rubocop:disable Naming/PredicateName
92
+ def has_key?(key) # rubocop:disable Naming/PredicatePrefix
93
93
  synchronize do
94
94
  super(key)
95
95
  end
@@ -107,6 +107,18 @@ module LruRedux
107
107
  end
108
108
  end
109
109
 
110
+ def length
111
+ synchronize do
112
+ super
113
+ end
114
+ end
115
+
116
+ def size
117
+ synchronize do
118
+ super
119
+ end
120
+ end
121
+
110
122
  private
111
123
 
112
124
  def valid?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module LruRedux
4
- VERSION = '2.5.2'
4
+ VERSION = '2.5.3'
5
5
  end
@@ -4,6 +4,12 @@ module SinLruRedux
4
4
  module TTL
5
5
  class ThreadSafeCache < Cache
6
6
  include ::SinLruRedux::Util::SafeSync
7
+
8
+ def expire
9
+ synchronize do
10
+ super
11
+ end
12
+ end
7
13
  end
8
14
  end
9
15
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sin_lru_redux
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.2
4
+ version: 2.5.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masahiro
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-03-12 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies: []
12
12
  description: Efficient and thread-safe LRU cache
13
13
  email:
@@ -38,20 +38,17 @@ files:
38
38
  - lib/sin_lru_redux/util.rb
39
39
  - lib/sin_lru_redux/util/safe_sync.rb
40
40
  - lib/sin_lru_redux/version.rb
41
- homepage: https://github.com/cadenza-tech/sin_lru_redux/tree/v2.5.2
41
+ homepage: https://github.com/cadenza-tech/sin_lru_redux/tree/v2.5.3
42
42
  licenses:
43
43
  - MIT
44
44
  metadata:
45
- homepage_uri: https://github.com/cadenza-tech/sin_lru_redux/tree/v2.5.2
46
- source_code_uri: https://github.com/cadenza-tech/sin_lru_redux/tree/v2.5.2
47
- changelog_uri: https://github.com/cadenza-tech/sin_lru_redux/blob/v2.5.2/CHANGELOG.md
45
+ homepage_uri: https://github.com/cadenza-tech/sin_lru_redux/tree/v2.5.3
46
+ source_code_uri: https://github.com/cadenza-tech/sin_lru_redux/tree/v2.5.3
47
+ changelog_uri: https://github.com/cadenza-tech/sin_lru_redux/blob/v2.5.3/CHANGELOG.md
48
48
  bug_tracker_uri: https://github.com/cadenza-tech/sin_lru_redux/issues
49
- documentation_uri: https://rubydoc.info/gems/sin_lru_redux/2.5.2
50
- funding_uri: https://patreon.com/CadenzaTech
49
+ documentation_uri: https://rubydoc.info/gems/sin_lru_redux/2.5.3
50
+ funding_uri: https://github.com/sponsors/cadenza-tech
51
51
  rubygems_mfa_required: 'true'
52
- required_jruby_version: ">= 9.4.0.0"
53
- required_truffleruby_version: ">= 22.0.0"
54
- required_truffleruby+graalvm_version: ">= 22.0.0"
55
52
  rdoc_options: []
56
53
  require_paths:
57
54
  - lib
@@ -66,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
63
  - !ruby/object:Gem::Version
67
64
  version: '0'
68
65
  requirements: []
69
- rubygems_version: 3.6.2
66
+ rubygems_version: 4.0.16
70
67
  specification_version: 4
71
68
  summary: Efficient and thread-safe LRU cache
72
69
  test_files: []