sin_lru_redux 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/lint.yml +1 -0
- data/README.md +8 -2
- data/lib/lru_redux/cache.rb +7 -5
- data/lib/lru_redux/ttl/cache.rb +21 -19
- data/lib/lru_redux/version.rb +1 -1
- data/sin_lru_redux.gemspec +6 -3
- metadata +10 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85729ffa3e0d98bfbdf486ac9d1e7f784573ce8b45e51f049578d969f5ea14a6
|
4
|
+
data.tar.gz: c882c657a2cf0b594e793960df7fadb1fcf6a7a771676f3daef99e019263d96b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a0821005a8ab87869955770f937f729bc064b6bb75e4749bd0f04b2bf26c50fb698315dc40cf9d360c2a4b2673119eddaa63aace7805601bff34632acdeb082
|
7
|
+
data.tar.gz: c320f100455634b6d27bfde47c7b2a15ab2c665781c81c19de51b5337f485075fc6185e9d9b43fbdc9b7fdeb6a42c1d6f734799d00a3a58254c3f0f83fb479cb
|
data/.github/workflows/lint.yml
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# SinLruRedux [![Gem Version](https://badge.fury.io/rb/sin_lru_redux.svg)](http://badge.fury.io/rb/sin_lru_redux)
|
2
2
|
|
3
|
-
|
3
|
+
Efficient and thread-safe LRU cache.
|
4
4
|
|
5
5
|
Forked from [LruRedux](https://github.com/SamSaffron/lru_redux).
|
6
6
|
|
@@ -239,11 +239,17 @@ This is a list of the caches that are used in the benchmarks.
|
|
239
239
|
|
240
240
|
## Changelog
|
241
241
|
|
242
|
+
### version 2.0.1 - 28-Dec-2024
|
243
|
+
|
244
|
+
- Refactor: Make valid_xxxx? methods private
|
245
|
+
- Fix: Fix lint CI.
|
246
|
+
- Other: Update gemspec
|
247
|
+
|
242
248
|
### version 2.0.0 - 28-Dec-2024
|
243
249
|
|
244
250
|
- New: Add ignore_nil argument to cache initialize arguments. If true, blocks called by getset yielding nil values will be returned but not stored in the cache.
|
245
251
|
- Fix: Fix LruRedux::TTL::ThreadSafeCache#delete to return deleted value.
|
246
|
-
- Ruby Support: Drop runtime support for Ruby 2.
|
252
|
+
- Ruby Support: Drop runtime support for Ruby 2.2 and below and JRuby.
|
247
253
|
|
248
254
|
### version 1.1.0 - 30-Mar-2015
|
249
255
|
|
data/lib/lru_redux/cache.rb
CHANGED
@@ -110,6 +110,13 @@ class LruRedux::Cache
|
|
110
110
|
|
111
111
|
protected
|
112
112
|
|
113
|
+
# for cache validation only, ensures all is sound
|
114
|
+
def valid?
|
115
|
+
true
|
116
|
+
end
|
117
|
+
|
118
|
+
private
|
119
|
+
|
113
120
|
def valid_max_size?(max_size)
|
114
121
|
return true if max_size.is_a?(Integer) && max_size >= 1
|
115
122
|
|
@@ -121,9 +128,4 @@ class LruRedux::Cache
|
|
121
128
|
|
122
129
|
false
|
123
130
|
end
|
124
|
-
|
125
|
-
# for cache validation only, ensures all is sound
|
126
|
-
def valid?
|
127
|
-
true
|
128
|
-
end
|
129
131
|
end
|
data/lib/lru_redux/ttl/cache.rb
CHANGED
@@ -169,25 +169,6 @@ module LruRedux
|
|
169
169
|
|
170
170
|
protected
|
171
171
|
|
172
|
-
def valid_max_size?(max_size)
|
173
|
-
return true if max_size.is_a?(Integer) && max_size >= 1
|
174
|
-
|
175
|
-
false
|
176
|
-
end
|
177
|
-
|
178
|
-
def valid_ttl?(ttl)
|
179
|
-
return true if ttl == :none
|
180
|
-
return true if ttl.is_a?(Numeric) && ttl >= 0
|
181
|
-
|
182
|
-
false
|
183
|
-
end
|
184
|
-
|
185
|
-
def valid_ignore_nil?(ignore_nil)
|
186
|
-
return true if [true, false].include?(ignore_nil)
|
187
|
-
|
188
|
-
false
|
189
|
-
end
|
190
|
-
|
191
172
|
# for cache validation only, ensures all is sound
|
192
173
|
def valid?
|
193
174
|
@data_lru.size == @data_ttl.size
|
@@ -217,6 +198,27 @@ module LruRedux
|
|
217
198
|
@data_lru.delete(key)
|
218
199
|
end
|
219
200
|
end
|
201
|
+
|
202
|
+
private
|
203
|
+
|
204
|
+
def valid_max_size?(max_size)
|
205
|
+
return true if max_size.is_a?(Integer) && max_size >= 1
|
206
|
+
|
207
|
+
false
|
208
|
+
end
|
209
|
+
|
210
|
+
def valid_ttl?(ttl)
|
211
|
+
return true if ttl == :none
|
212
|
+
return true if ttl.is_a?(Numeric) && ttl >= 0
|
213
|
+
|
214
|
+
false
|
215
|
+
end
|
216
|
+
|
217
|
+
def valid_ignore_nil?(ignore_nil)
|
218
|
+
return true if [true, false].include?(ignore_nil)
|
219
|
+
|
220
|
+
false
|
221
|
+
end
|
220
222
|
end
|
221
223
|
end
|
222
224
|
end
|
data/lib/lru_redux/version.rb
CHANGED
data/sin_lru_redux.gemspec
CHANGED
@@ -7,14 +7,17 @@ require 'lru_redux/version'
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
8
|
spec.name = 'sin_lru_redux'
|
9
9
|
spec.version = LruRedux::VERSION
|
10
|
-
spec.description =
|
11
|
-
|
10
|
+
spec.description = <<~DESCRIPTION
|
11
|
+
Efficient and thread-safe LRU cache.
|
12
|
+
Forked from LruRedux.
|
13
|
+
DESCRIPTION
|
14
|
+
spec.summary = 'Efficient and thread-safe LRU cache.'
|
12
15
|
spec.authors = ['Masahiro']
|
13
16
|
spec.email = ['watanabe@cadenza-tech.com']
|
14
17
|
spec.license = 'MIT'
|
15
18
|
|
16
19
|
github_root_uri = 'https://github.com/cadenza-tech/sin_lru_redux'
|
17
|
-
spec.homepage = "#{github_root_uri}/tree
|
20
|
+
spec.homepage = "#{github_root_uri}/tree/v#{spec.version}"
|
18
21
|
spec.metadata = {
|
19
22
|
'homepage_uri' => spec.homepage,
|
20
23
|
'source_code_uri' => spec.homepage,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sin_lru_redux
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masahiro
|
@@ -9,7 +9,9 @@ bindir: bin
|
|
9
9
|
cert_chain: []
|
10
10
|
date: 2024-12-28 00:00:00.000000000 Z
|
11
11
|
dependencies: []
|
12
|
-
description:
|
12
|
+
description: |
|
13
|
+
Efficient and thread-safe LRU cache.
|
14
|
+
Forked from LruRedux.
|
13
15
|
email:
|
14
16
|
- watanabe@cadenza-tech.com
|
15
17
|
executables: []
|
@@ -41,15 +43,15 @@ files:
|
|
41
43
|
- test/thread_safe_cache_test.rb
|
42
44
|
- test/ttl/cache_test.rb
|
43
45
|
- test/ttl/thread_safe_cache_test.rb
|
44
|
-
homepage: https://github.com/cadenza-tech/sin_lru_redux/tree/
|
46
|
+
homepage: https://github.com/cadenza-tech/sin_lru_redux/tree/v2.0.1
|
45
47
|
licenses:
|
46
48
|
- MIT
|
47
49
|
metadata:
|
48
|
-
homepage_uri: https://github.com/cadenza-tech/sin_lru_redux/tree/
|
49
|
-
source_code_uri: https://github.com/cadenza-tech/sin_lru_redux/tree/
|
50
|
-
changelog_uri: https://github.com/cadenza-tech/sin_lru_redux/blob/2.0.
|
50
|
+
homepage_uri: https://github.com/cadenza-tech/sin_lru_redux/tree/v2.0.1
|
51
|
+
source_code_uri: https://github.com/cadenza-tech/sin_lru_redux/tree/v2.0.1
|
52
|
+
changelog_uri: https://github.com/cadenza-tech/sin_lru_redux/blob/2.0.1#changelog
|
51
53
|
bug_tracker_uri: https://github.com/cadenza-tech/sin_lru_redux/issues
|
52
|
-
documentation_uri: https://rubydoc.info/gems/sin_lru_redux/2.0.
|
54
|
+
documentation_uri: https://rubydoc.info/gems/sin_lru_redux/2.0.1
|
53
55
|
rubygems_mfa_required: 'true'
|
54
56
|
rdoc_options: []
|
55
57
|
require_paths:
|
@@ -67,5 +69,5 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
67
69
|
requirements: []
|
68
70
|
rubygems_version: 3.6.2
|
69
71
|
specification_version: 4
|
70
|
-
summary:
|
72
|
+
summary: Efficient and thread-safe LRU cache.
|
71
73
|
test_files: []
|