dynamini 2.10.1 → 2.10.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/Gemfile.lock +20 -17
- data/dynamini.gemspec +1 -1
- data/lib/dynamini/querying.rb +12 -2
- data/spec/dynamini/querying_spec.rb +20 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6de2fb3c93586ae5e29c842aa20c5c4b2ffbe15a
|
4
|
+
data.tar.gz: d010ecba7e323942905a366eb238982520eb7c83
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b9452e98ada739ee207ccd048ff29d1cc7762687da1f125160fd19f0ac1e8d24eb7de15de6195f4a79c7e3c0fb61b74bda5a5a14e5fdc8f76aab820a5b57cf7
|
7
|
+
data.tar.gz: 6996d29cd05339962ef97335e98b1e8776b3ded5f2d131bcda222652bc95e027c36bb1f9f71eec744ccfaf253cb588007149705bf5739213d8603a529d0860cd
|
data/Gemfile.lock
CHANGED
@@ -1,29 +1,30 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
dynamini (2.10.
|
4
|
+
dynamini (2.10.1)
|
5
5
|
activemodel (>= 3, < 5.0)
|
6
6
|
aws-sdk (~> 2)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activemodel (4.2.
|
12
|
-
activesupport (= 4.2.
|
11
|
+
activemodel (4.2.9)
|
12
|
+
activesupport (= 4.2.9)
|
13
13
|
builder (~> 3.1)
|
14
|
-
activesupport (4.2.
|
14
|
+
activesupport (4.2.9)
|
15
15
|
i18n (~> 0.7)
|
16
|
-
json (~> 1.7, >= 1.7.7)
|
17
16
|
minitest (~> 5.1)
|
18
17
|
thread_safe (~> 0.3, >= 0.3.4)
|
19
18
|
tzinfo (~> 1.1)
|
20
|
-
aws-sdk (2.
|
21
|
-
aws-sdk-resources (= 2.
|
22
|
-
aws-sdk-core (2.
|
19
|
+
aws-sdk (2.10.48)
|
20
|
+
aws-sdk-resources (= 2.10.48)
|
21
|
+
aws-sdk-core (2.10.48)
|
22
|
+
aws-sigv4 (~> 1.0)
|
23
23
|
jmespath (~> 1.0)
|
24
|
-
aws-sdk-resources (2.
|
25
|
-
aws-sdk-core (= 2.
|
26
|
-
|
24
|
+
aws-sdk-resources (2.10.48)
|
25
|
+
aws-sdk-core (= 2.10.48)
|
26
|
+
aws-sigv4 (1.0.2)
|
27
|
+
builder (3.2.3)
|
27
28
|
coderay (1.1.0)
|
28
29
|
diff-lcs (1.2.5)
|
29
30
|
ffi (1.9.10)
|
@@ -48,15 +49,14 @@ GEM
|
|
48
49
|
guard-shell (0.7.1)
|
49
50
|
guard (>= 2.0.0)
|
50
51
|
guard-compat (~> 1.0)
|
51
|
-
i18n (0.
|
52
|
-
jmespath (1.1
|
53
|
-
json (1.8.3)
|
52
|
+
i18n (0.8.6)
|
53
|
+
jmespath (1.3.1)
|
54
54
|
listen (3.0.3)
|
55
55
|
rb-fsevent (>= 0.9.3)
|
56
56
|
rb-inotify (>= 0.9)
|
57
57
|
lumberjack (1.0.9)
|
58
58
|
method_source (0.8.2)
|
59
|
-
minitest (5.
|
59
|
+
minitest (5.10.3)
|
60
60
|
nenv (0.2.0)
|
61
61
|
notiffany (0.0.8)
|
62
62
|
nenv (~> 0.1)
|
@@ -85,8 +85,8 @@ GEM
|
|
85
85
|
shellany (0.0.1)
|
86
86
|
slop (3.6.0)
|
87
87
|
thor (0.19.1)
|
88
|
-
thread_safe (0.3.
|
89
|
-
tzinfo (1.2.
|
88
|
+
thread_safe (0.3.6)
|
89
|
+
tzinfo (1.2.3)
|
90
90
|
thread_safe (~> 0.1)
|
91
91
|
|
92
92
|
PLATFORMS
|
@@ -99,3 +99,6 @@ DEPENDENCIES
|
|
99
99
|
guard-shell
|
100
100
|
pry (~> 0)
|
101
101
|
rspec (~> 3)
|
102
|
+
|
103
|
+
BUNDLED WITH
|
104
|
+
1.16.0.pre.2
|
data/dynamini.gemspec
CHANGED
data/lib/dynamini/querying.rb
CHANGED
@@ -69,10 +69,20 @@ module Dynamini
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def build_expression_attribute_values(args)
|
72
|
+
range_key = current_index_range_key(args)
|
73
|
+
|
74
|
+
if (handle = handles[range_key.to_sym])
|
75
|
+
start_val = args[:start] ? attribute_callback(TypeHandler::SETTER_PROCS, handle, args[:start], false) : nil
|
76
|
+
end_val = args[:end] ? attribute_callback(TypeHandler::SETTER_PROCS, handle, args[:end], false) : nil
|
77
|
+
else
|
78
|
+
start_val = args[:start]
|
79
|
+
end_val = args[:end]
|
80
|
+
end
|
81
|
+
|
72
82
|
expression_values = {}
|
73
83
|
expression_values[':h'] = args[:hash_key]
|
74
|
-
expression_values[':s'] =
|
75
|
-
expression_values[':e'] =
|
84
|
+
expression_values[':s'] = start_val if start_val
|
85
|
+
expression_values[':e'] = end_val if end_val
|
76
86
|
expression_values
|
77
87
|
end
|
78
88
|
|
@@ -18,8 +18,10 @@ describe Dynamini::Querying do
|
|
18
18
|
set_hash_key :foo
|
19
19
|
set_range_key :bar
|
20
20
|
set_secondary_index :secondary_index, hash_key: :secondary_hash_key, range_key: :secondary_range_key
|
21
|
+
set_secondary_index :tertiary_index, hash_key: :tertiary_hash_key, range_key: :tertiary_range_key
|
21
22
|
handle :bar, :integer
|
22
23
|
handle :secondary_range_key, :integer
|
24
|
+
handle :tertiary_range_key, :time
|
23
25
|
end
|
24
26
|
|
25
27
|
describe '.find' do
|
@@ -270,6 +272,24 @@ describe Dynamini::Querying do
|
|
270
272
|
expect(TestClassWithRange.query(hash_key: 'non-existent-key', index_name: :secondary_index)).to eq([])
|
271
273
|
end
|
272
274
|
end
|
275
|
+
|
276
|
+
context 'with a type handled range key' do
|
277
|
+
it 'converts the start and end parameter to the raw type' do
|
278
|
+
start_param = Time.new(2000, 1, 1)
|
279
|
+
end_param = Time.new(2001, 1, 1)
|
280
|
+
|
281
|
+
expect(TestClassWithRange.client).to receive(:query).with(hash_including(
|
282
|
+
expression_attribute_values: {':h' => '12345', ':s' => start_param.to_f, ':e' => end_param.to_f}
|
283
|
+
)).and_return(OpenStruct.new(items: []))
|
284
|
+
|
285
|
+
TestClassWithRange.query(
|
286
|
+
hash_key: '12345',
|
287
|
+
index_name: :tertiary_index,
|
288
|
+
start: start_param,
|
289
|
+
end: end_param
|
290
|
+
)
|
291
|
+
end
|
292
|
+
end
|
273
293
|
end
|
274
294
|
|
275
295
|
describe '.exists?' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dynamini
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.10.
|
4
|
+
version: 2.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Greg Ward
|
@@ -15,7 +15,7 @@ authors:
|
|
15
15
|
autorequire:
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
|
-
date: 2017-
|
18
|
+
date: 2017-10-02 00:00:00.000000000 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: activemodel
|