gdatastore_cache_store 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
2
  SHA1:
3
- metadata.gz: b1a3706a3197754a40bf1fa3dfc570aea1504533
4
- data.tar.gz: 5d952a42425ad4610c8c10d841fb3d904057e618
3
+ metadata.gz: 0ccb41c62ecda19d688d4c9bf8273592f7ce1eeb
4
+ data.tar.gz: 4f9c529da0d6e4ad9004d615f47c68f47f209d9c
5
5
  SHA512:
6
- metadata.gz: 74398a2fc43c3551071a6502d19fa618446c040205e2f2a94e9adf052fc3a36edd6da271edb530fb1c86a500b5d37d1caa2e57e3a51c34c8411186817c5ad65b
7
- data.tar.gz: 65db20d8ea4dc02586a856531e6457368882204ea25cfc3e1399963e54ecc3fcb148e668b4a07fcf50d5c527efdebd89e15b50adab197019a53f402ce2f36e0f
6
+ metadata.gz: fb2ce3cbcdb45cf45bc5683d53d7aedab908e059bede4b400a513a8e82ba74f086b9164e55e5cf19976dae8d9c19bf8352119815dbc3ccb7ee130f75d39cfc4a
7
+ data.tar.gz: c35300c82e5c3b335b5632559ff285ef5d17e717484f65e29b61c9e2ec5e3fca9c0c37f72bb4c5923c69af655b8a6a9e2a2ff2b5c96567b585e36d46f4238527
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ gdatastore_cache_store-*
data/README.md CHANGED
@@ -1,8 +1,6 @@
1
1
  # GdatastoreCacheStore
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/gdatastore_cache_store`. To experiment with that code, run `bin/console` for an interactive prompt.
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
@@ -1,3 +1,3 @@
1
1
  class GdatastoreCacheStore
2
- version = VERSION = "0.1.1"
2
+ version = VERSION = "0.1.2"
3
3
  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.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-07-28 00:00:00.000000000 Z
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.5
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