gdatastore_cache_store 0.1.1 → 0.1.2
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/.gitignore +1 -0
- data/README.md +1 -3
- data/lib/gdatastore_cache_store.rb +8 -4
- data/lib/gdatastore_cache_store/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ccb41c62ecda19d688d4c9bf8273592f7ce1eeb
|
4
|
+
data.tar.gz: 4f9c529da0d6e4ad9004d615f47c68f47f209d9c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fb2ce3cbcdb45cf45bc5683d53d7aedab908e059bede4b400a513a8e82ba74f086b9164e55e5cf19976dae8d9c19bf8352119815dbc3ccb7ee130f75d39cfc4a
|
7
|
+
data.tar.gz: c35300c82e5c3b335b5632559ff285ef5d17e717484f65e29b61c9e2ec5e3fca9c0c37f72bb4c5923c69af655b8a6a9e2a2ff2b5c96567b585e36d46f4238527
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
# GdatastoreCacheStore
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
Use Google Datastore as a cache store for your Rails application
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
@@ -19,7 +19,7 @@ class GdatastoreCacheStore
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def read(key, _ = nil)
|
22
|
-
result = @datastore.find @entity_genre, key
|
22
|
+
result = @datastore.find @entity_genre, keyfy(key)
|
23
23
|
return unless result
|
24
24
|
|
25
25
|
value = result['value']
|
@@ -45,13 +45,17 @@ class GdatastoreCacheStore
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def cache_key(key)
|
48
|
-
@datastore.key @entity_genre, key
|
48
|
+
@datastore.key @entity_genre, keyfy(key)
|
49
49
|
end
|
50
50
|
|
51
51
|
def fetch(key, _ = nil)
|
52
|
-
result = read(key)
|
52
|
+
result = read(keyfy(key))
|
53
53
|
return result if result.present?
|
54
54
|
|
55
|
-
write(key, yield)
|
55
|
+
write(keyfy(key), yield)
|
56
|
+
end
|
57
|
+
|
58
|
+
def keyfy(key)
|
59
|
+
key.to_s
|
56
60
|
end
|
57
61
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gdatastore_cache_store
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien Séveno
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-08-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: google-cloud-datastore
|
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
version: '0'
|
97
97
|
requirements: []
|
98
98
|
rubyforge_project:
|
99
|
-
rubygems_version: 2.4
|
99
|
+
rubygems_version: 2.6.4
|
100
100
|
signing_key:
|
101
101
|
specification_version: 4
|
102
102
|
summary: Use Google Datastore as a cache store for your Rails application
|