greencache 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 31ffd757e8f11b29d680b9f463c248323d8cd1c7
4
- data.tar.gz: 7a024b4bdd522ded1325e491ae3b76e68be9b148
2
+ SHA256:
3
+ metadata.gz: 3dff03b6a7842d910edca9c0621c2d397db6f717e8047df76024b74af6bc6a72
4
+ data.tar.gz: 24ce73bdfd300b5a99a05cbadd3d1df511a8e1272d18409eba3523ee965b6839
5
5
  SHA512:
6
- metadata.gz: 10cca761c35c884d94497f41aff93c629b315d8924b125271c236a200aab247fd7f61038308f398e01d06b095c7b5242b6055e5ad44cc39c04a45ae622338955
7
- data.tar.gz: f650215c5359218e2012b3cc365006e33d4c44b54431802c306c0695e5623fb77eb070083bdbb5613e7a392338535e475b7c959b8d2a1ed828224ef6ecca99fe
6
+ metadata.gz: 1067e72923725c96a23b22b6cb710ea177e0efeae3637c8e4ad321a9aebeb71729bc091515d96e60baa56f600ef57cc1cf69bf5c4a3bfd003ef85effeb8c4b09
7
+ data.tar.gz: 8f2db04b23fccf1a756fb7f3ce4ed52e7c1d243d44c6d45200e49cae75df775a6b99fee6f0d3ae2cf4586f2c4923b78d9345d599296e79c04a39b4a5b0d4fa90
data/lib/greencache.rb CHANGED
@@ -25,6 +25,10 @@ module Greencache
25
25
  value
26
26
  end
27
27
 
28
+ def expire(redis_key)
29
+ redis.del(redis_key) if redis_up?
30
+ end
31
+
28
32
  private def read_from_cache!(redis_key, config)
29
33
  value = get_value!(redis_key, config)
30
34
  log("cache.hit", redis_key, config)
@@ -1,3 +1,3 @@
1
1
  module Greencache
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
@@ -109,4 +109,9 @@ describe Greencache do
109
109
  expect(rc.fernet).to receive(:generate).with("foo", '"bar"'){ "abc" }
110
110
  rc.encrypt("bar", {encrypt: true, secret: 'foo'})
111
111
  end
112
+
113
+ it 'expires keys' do
114
+ expect(rc.redis).to receive(:del).with('cache-key-123456')
115
+ expect(rc.expire('cache-key-123456'))
116
+ end
112
117
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: greencache
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neil Middleton
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-07-10 00:00:00.000000000 Z
12
+ date: 2018-12-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -154,11 +154,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
154
  version: '0'
155
155
  requirements: []
156
156
  rubyforge_project:
157
- rubygems_version: 2.6.8
157
+ rubygems_version: 2.7.6
158
158
  signing_key:
159
159
  specification_version: 4
160
160
  summary: A gem for caching values in redis and encrypting them
161
161
  test_files:
162
162
  - spec/greencache_spec.rb
163
163
  - spec/spec_helper.rb
164
- has_rdoc: