zache 0.5.3 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/lib/zache.rb +25 -0
- data/test/test_zache.rb +5 -0
- data/zache.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1946835650fe9364a00701710789c08de9e93b03b1885a9ac924203940c2b27
|
4
|
+
data.tar.gz: 99cb4f482d86a3c1288ef8705c05638a24fd7e580d682e60fa610e61a0e92f02
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93ea85258dd3439d79ebfff81676e8a60dffcfba29539d5fa1a180682001e92cb0cc4841274f985cbce164bc10b4767654e64a4edc4db76c43b68bf5b1017a62
|
7
|
+
data.tar.gz: eb1084cc733ca67a49783526621c81289e0492e3de9d1483ecaa557763588aa2d29414ab570b23f25865e41b62f80b039ee414d75b3d8d76608f0f097cb5387c
|
data/.gitignore
CHANGED
data/lib/zache.rb
CHANGED
@@ -37,6 +37,31 @@
|
|
37
37
|
# Copyright:: Copyright (c) 2018 Yegor Bugayenko
|
38
38
|
# License:: MIT
|
39
39
|
class Zache
|
40
|
+
# Fake implementation that doesn't cache anything, but behaves like it
|
41
|
+
# does. It implements all methods of the original class, but doesn't do
|
42
|
+
# any caching. This is very useful for testing.
|
43
|
+
class Fake
|
44
|
+
def get(*)
|
45
|
+
yield
|
46
|
+
end
|
47
|
+
|
48
|
+
def exists?(*)
|
49
|
+
true
|
50
|
+
end
|
51
|
+
|
52
|
+
def locked?
|
53
|
+
false
|
54
|
+
end
|
55
|
+
|
56
|
+
def put(*); end
|
57
|
+
|
58
|
+
def remove(_key); end
|
59
|
+
|
60
|
+
def remove_all; end
|
61
|
+
|
62
|
+
def clean; end
|
63
|
+
end
|
64
|
+
|
40
65
|
# Makes a new object of the cache.
|
41
66
|
# "sync" is whether the hash is thread-safe (`true`)
|
42
67
|
# or not (`false`); it is recommended to leave this parameter untouched,
|
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.6.0'
|
35
35
|
s.license = 'MIT'
|
36
36
|
s.summary = 'In-memory Cache'
|
37
37
|
s.description = 'Zero-footprint in-memory thread-safe cache'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yegor Bugayenko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|