geminiext 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/geminiext/cache.rb +2 -0
- 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: b9d9c0b9651ab28acc15a0156d8a801c3c2432de1a28052c4f151568642e000c
|
4
|
+
data.tar.gz: 169262f9e2bb8fbfaea0c778d5d74bea8bf7b68beb941860ef825e90ce339461
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 29fbf2bfaa621004d08a80ea7c8703d36166568e526c0c255234228bfd75adefd15fab6c5411338a48c57d258b3209bdb11024ec08675880dc9edbfc8261fb26
|
7
|
+
data.tar.gz: d1421a48732a4000f0e058dc2a35e62d22418e1bd72667a18fa7ff85fb2838a706fa8297404df312bd29fcd39a75ff8597db68e40d6cbd352d184eb27ae41983
|
data/lib/geminiext/cache.rb
CHANGED
@@ -46,6 +46,8 @@ module GeminiExt
|
|
46
46
|
req.params['key'] = ENV.fetch('GEMINI_API_KEY')
|
47
47
|
end
|
48
48
|
|
49
|
+
return [] if JSON.parse(response.body).empty?
|
50
|
+
|
49
51
|
JSON.parse(response.body)['cachedContents'].map do |item|
|
50
52
|
def item.delete = GeminiExt::Cache.delete(name: self['name'])
|
51
53
|
def item.set_ttl(ttl = 120) = GeminiExt::Cache.update(name: self['name'], content: { ttl: "#{ttl}s" })
|