zache 0.9.0 → 0.10.0
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 +4 -4
- data/lib/zache.rb +2 -2
- data/test/test_zache.rb +1 -0
- data/zache.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc076a4fc749fc00a9d894de37dbca8ae03a9c607d5bab39dc04b57fbbf182d6
|
4
|
+
data.tar.gz: 1290c77d9339599eccafb37008b5a58561e901cbf76572f6a8538f7aeee42cc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fee403d8ede6cfcf64d1e417df1e1c83025aa0ee14eb21c34945a1c40b7473c936079285ab3b61584d4baf03e75928eb5cb01c5451d0b0365e7c51be695c80d1
|
7
|
+
data.tar.gz: ff1d2b0e94dddd5c500a2a30e738bae6147a92ecd21b1f432a5cf5dc4df0a6ee23f5f632e1b28bf0575b740d2e1466ba661b9f32e33f4a9d05932fa4669716e1
|
data/lib/zache.rb
CHANGED
@@ -114,9 +114,9 @@ class Zache
|
|
114
114
|
# Checks whether the value exists in the cache by the provided key. Returns
|
115
115
|
# TRUE if the value is here. If the key is already expired in the hash,
|
116
116
|
# it will be removed by this method and the result will be FALSE.
|
117
|
-
def exists?(key)
|
117
|
+
def exists?(key, dirty: false)
|
118
118
|
rec = @hash[key]
|
119
|
-
if key_expired?(key)
|
119
|
+
if key_expired?(key) && !dirty && !@dirty
|
120
120
|
@hash.delete(key)
|
121
121
|
rec = nil
|
122
122
|
end
|
data/test/test_zache.rb
CHANGED
data/zache.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |s|
|
|
31
31
|
s.rubygems_version = '2.5'
|
32
32
|
s.required_ruby_version = '>=2.5'
|
33
33
|
s.name = 'zache'
|
34
|
-
s.version = '0.
|
34
|
+
s.version = '0.10.0'
|
35
35
|
s.license = 'MIT'
|
36
36
|
s.summary = 'In-memory Cache'
|
37
37
|
s.description = 'Zero-footprint in-memory thread-safe cache'
|