mingle_keyvalue_store 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +7 -7
  2. data/lib/mingle_keyvalue_store.rb +6 -3
  3. metadata +63 -57
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
- ---
2
- SHA1:
3
- metadata.gz: d2a8148185db602a7a6f4ae58abbea668465fd0e
4
- data.tar.gz: f7b5703b4b17d59c3555cf08362c4bb884dc4ad9
5
- SHA512:
6
- metadata.gz: 5398a5dd074a880e482b4e90c9588bf128684e2da602b524736e2eed2f0caab07ba7b509cfadc89825231cd7b8130d850baba6b798d11948e6fe21e1ce75a822
7
- data.tar.gz: 4a5cc05e46365b3dcf96fe1527b58762087f4f8a8e26009223832f1d966499e1f1126357d25a16b07a2398edc5c636dbe764d2c57590da3a07b8c4af3921a49a
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 4c1910ccee145828d9a7d53ead5c4cfde581b5cc
4
+ data.tar.gz: ac50388c1c856bc03b27b7f145898fecdda41cfa
5
+ SHA512:
6
+ metadata.gz: 9df6bbaccc33d18e9ef78eebf4be8a8c1dc410c1e6579fe3d0d7dc951306201b2a4ee300a0c94c2fcd3dc0a677f16a0f5a6cdf17955de0ff113ebcde6660fe97
7
+ data.tar.gz: bd5be69673236578c891ce4bc648ba3f73af178e2ab765afc4477c92a44cddb1cbd4418ed0561add35afc1c3ac996022b226f97a7f64bac7f288a4259d5338df
@@ -68,12 +68,12 @@ module Mingle
68
68
  class DynamodbBased
69
69
  def initialize(table_name, key_column, value_column)
70
70
  @key_column = key_column
71
- @value_column = value_column
71
+ @value_column = value_column.to_s
72
72
  @table_name = table_name
73
73
  end
74
74
 
75
75
  def [](store_key)
76
- if attribute = table_items[store_key].attributes[@value_column]
76
+ if attribute = attributes(table_items[store_key])[@value_column]
77
77
  JSON.parse(attribute)
78
78
  end
79
79
  end
@@ -91,7 +91,7 @@ module Mingle
91
91
  end
92
92
 
93
93
  def all_items
94
- table_items.map { |item| item.attributes.to_hash }
94
+ table_items.map { |item| attributes(item) }
95
95
  end
96
96
 
97
97
  def delete(key)
@@ -99,6 +99,9 @@ module Mingle
99
99
  end
100
100
 
101
101
  private
102
+ def attributes(item)
103
+ item.attributes.to_h(:consistent_read => true)
104
+ end
102
105
 
103
106
  def table_items
104
107
  table = AWS::DynamoDB.new.tables[@table_name]
metadata CHANGED
@@ -1,76 +1,82 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: mingle_keyvalue_store
3
- version: !ruby/object:Gem::Version
4
- version: 0.1.6
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.7
5
5
  platform: ruby
6
- authors:
7
- - Ian
8
- - sdqali
6
+ authors:
7
+ - Ian
8
+ - sdqali
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2014-02-04 00:00:00 Z
14
- dependencies:
15
- - !ruby/object:Gem::Dependency
16
- name: aws-sdk
17
- prerelease: false
18
- requirement: &id001 !ruby/object:Gem::Requirement
19
- requirements:
20
- - - ~>
21
- - !ruby/object:Gem::Version
22
- version: "1.11"
23
- - - ">="
24
- - !ruby/object:Gem::Version
25
- version: 1.11.3
26
- type: :runtime
27
- version_requirements: *id001
28
- - !ruby/object:Gem::Dependency
29
- name: rake
30
- prerelease: false
31
- requirement: &id002 !ruby/object:Gem::Requirement
32
- requirements:
33
- - &id003
34
- - ">="
35
- - !ruby/object:Gem::Version
36
- version: "0"
37
- type: :development
38
- version_requirements: *id002
12
+ date: 2014-05-28 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: aws-sdk
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - "~>"
19
+ - !ruby/object:Gem::Version
20
+ version: '1.11'
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: 1.11.3
24
+ type: :runtime
25
+ prerelease: false
26
+ version_requirements: !ruby/object:Gem::Requirement
27
+ requirements:
28
+ - - "~>"
29
+ - !ruby/object:Gem::Version
30
+ version: '1.11'
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 1.11.3
34
+ - !ruby/object:Gem::Dependency
35
+ name: rake
36
+ requirement: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ type: :development
42
+ prerelease: false
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
39
48
  description: A key value store implentation that uses DynamoDB or Pstore underneath.
40
- email:
41
- - reginaldthedog@gmail.com
42
- - sadiqalikm@gmail.com
49
+ email:
50
+ - reginaldthedog@gmail.com
51
+ - sadiqalikm@gmail.com
43
52
  executables: []
44
-
45
53
  extensions: []
46
-
47
54
  extra_rdoc_files: []
48
-
49
- files:
50
- - README.md
51
- - lib/mingle_keyvalue_store.rb
55
+ files:
56
+ - README.md
57
+ - lib/mingle_keyvalue_store.rb
52
58
  homepage: https://github.com/ThoughtWorksStudios/mingle_keyvalue_store
53
- licenses:
54
- - MIT
59
+ licenses:
60
+ - MIT
55
61
  metadata: {}
56
-
57
62
  post_install_message:
58
63
  rdoc_options: []
59
-
60
- require_paths:
61
- - lib
62
- required_ruby_version: !ruby/object:Gem::Requirement
63
- requirements:
64
- - *id003
65
- required_rubygems_version: !ruby/object:Gem::Requirement
66
- requirements:
67
- - *id003
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
68
76
  requirements: []
69
-
70
77
  rubyforge_project:
71
- rubygems_version: 2.1.9
78
+ rubygems_version: 2.2.0
72
79
  signing_key:
73
80
  specification_version: 4
74
81
  summary: A key value store implentation that uses DynamoDB or Pstore underneath.
75
82
  test_files: []
76
-