dynamosaurus 0.1.5 → 0.1.6

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: b24b77f3a1503cd97560d5595e42f55c2cb11d37
4
- data.tar.gz: 8e40fe03a5a30d04aede8bdb3d7da25805ad516d
3
+ metadata.gz: 896faf1434dbeb3df206410cd17297f6712f0c47
4
+ data.tar.gz: 10154ce8f6cc0210919675b4715cb7a54f54aba0
5
5
  SHA512:
6
- metadata.gz: d7d4ee5be947ba53172851cca0e45344b82ab224c465231b452e8acac2f8e9e7c559c8efc217f102109a385cb0d46a45778fa12784113da9a76a5c7a6a33c8fb
7
- data.tar.gz: 6d5ba5ebd62cf434f72a329cd34e613e08f73142b02212cc49c84bc81198d9533cebf6a4a218b6e89299ae91320d2e60b6e65f50f221762444789be9feac115b
6
+ metadata.gz: 0e95e9423a56a3e03aea53fb1f0d0cfff9d40fd5362a2428b37c3bf54fb0a959a61a3b04ff9585bc124a020e41f4d06f38ee2fe44028fa5c36f6c18f6d14d1f6
7
+ data.tar.gz: c05d104a9306f4ff38edfac4d6179999cbaf830f3c9c953636350b34e967310b21bbb157c55662047ecfeae606448230ee684674878995070e6377bf791a9fbc
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dynamosaurus (0.1.5)
4
+ dynamosaurus (0.1.6)
5
5
  aws-sdk (>= 3.0)
6
6
  deep_merge
7
7
 
@@ -349,68 +349,6 @@ module Dynamosaurus
349
349
  end
350
350
  end
351
351
 
352
- def query_of_all(params, offset_key, limit = 20, scan_index_forward = true)
353
- params[:limit] = limit + 1
354
- params[:scan_index_forward] = scan_index_forward;
355
-
356
- p params
357
- res = dynamo_db.query(params)
358
-
359
- items = []
360
-
361
- if res.items
362
- items = res.items.map{|item|
363
- new :data => item
364
- }
365
- end
366
-
367
- ret[table_name] = items
368
- ret[:count] = [item.count, limit].min
369
-
370
- if (res[:count] > limit)
371
- ret[:next] = res.items[limit][offset_key]
372
- end
373
- end
374
-
375
- def rangeGetList(data, limit = 20, scan_index_forward = true, options={})
376
- pkey = hash_key
377
- rkey = range_key
378
- params = data.is_a?(Array) ?
379
- (scan_index_forward ?
380
- rangeKeyQuery("#pkey = :pkey_value and #rkey >= :rkey_value", [pkey, rkey], data) :
381
- rangeKeyQuery("#pkey = :pkey_value and #rkey <= :rkey_value", [pkey, rkey], data)) :
382
- keyQuery("#pkey = :pkey_value", pkey, data)
383
- res = query_of_all(params.merge(options), rkey, limit, scan_index_forward)
384
- end
385
-
386
- def keyQuery(expression, pkey, data)
387
- params = {
388
- table_name: table_name,
389
- key_condition_expression: expression,
390
- expression_attribute_names: {
391
- "#pkey" => pkey,
392
- },
393
- expression_attribute_values: {
394
- ":pkey_value" => data,
395
- }
396
- }
397
- end
398
-
399
- def rangeKeyQuery(expression, keys, data)
400
- params = {
401
- table_name: table_name,
402
- key_condition_expression: expression,
403
- expression_attribute_names:{
404
- "#pkey" => hash_key,
405
- "#rkey" => range_key,
406
- },
407
- expression_attribute_values: {
408
- ":pkey_value" => data[0],
409
- ":rkey_value" => data[1],
410
- }
411
- }
412
- end
413
-
414
352
  def query keys, index=nil, option={}
415
353
  query = {
416
354
  :table_name => table_name
@@ -554,12 +492,11 @@ module Dynamosaurus
554
492
  def put hash, num_hash={}, return_values=nil
555
493
  new_hash = put_data(hash, num_hash)
556
494
 
557
- params = {
495
+ res = dynamo_db.put_item(
558
496
  :table_name => table_name,
559
497
  :item => new_hash,
560
498
  :return_values => return_values || "NONE"
561
- }
562
- res = dynamo_db.put_item(params)
499
+ )
563
500
  end
564
501
 
565
502
  def put_data hash, num_hash={}
@@ -1,3 +1,3 @@
1
1
  module Dynamosaurus
2
- VERSION = "0.1.5"
2
+ VERSION = "0.1.6"
3
3
  end
@@ -215,13 +215,6 @@ describe Dynamosaurus do
215
215
 
216
216
  it{ is_expected.to eq 2 }
217
217
  end
218
-
219
- context 'get all' do
220
- subject { Comment.rangeGetList("1") }
221
-
222
- it { is_expected.to eq 2 }
223
-
224
- end
225
218
  end
226
219
 
227
220
  describe 'table options' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamosaurus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Isamu Arimoto