ddbcli 0.5.4 → 0.6.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: faeb245e990d3a7536f1431c6c511999711e98eb
4
- data.tar.gz: 3d7b1243d6052406de960abe9e1f8576e4879cfc
2
+ SHA256:
3
+ metadata.gz: 3a29dcbf41408fb490fcd2bb7286cc72cc905ade673a20780030b958f613bf2a
4
+ data.tar.gz: fe4847688c79d5b050dd23ba459c55b587fc5d73e1b47f2bfe8ee2e93e664bf9
5
5
  SHA512:
6
- metadata.gz: cdc44455fc6bded16dfca21f21200155928d740aabe4d18e7ea98b1af6003ac8a3a760ebc168324e709a9c5d05c31401f0fc2a46490f46a5627f987de8cfb40c
7
- data.tar.gz: f89b6a0320e8f86bb5deebb2e5bed9a4e3f4522c41b224b419779b4f17c6ba4994737a4efdff7cdbb30ec97ceb05ebe902f978782e7d1d8a7400fa2d5d166acd
6
+ metadata.gz: b36f6086096b46d04152430c727acd83374ef14aa5db58b0f10ea3074c7c06b29f26d3d819af2d01cae3579f5e4c774a602c7728094219054622019568d2420d
7
+ data.tar.gz: 99a979278bd1fd879a9604aaf70cff1bdf10d2ba485435a61002d7ef7c695cf432ea578ee24c7f59d2daa708b9195bec960eeeff9db6933834b17b2b213e48ce
@@ -1,10 +1,11 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.0.0
3
+ - 2.4.5
4
+ - 2.5.3
5
+ - 2.6.0
4
6
  install:
5
7
  - mkdir /tmp/dynamodb
6
- #- wget -O - http://dynamodb-local.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest | tar xz --directory /tmp/dynamodb
7
- - wget -O - http://dynamodb-preview.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest_preview.tar.gz | tar xz --directory /tmp/dynamodb
8
+ - wget -O - https://s3-us-west-2.amazonaws.com/dynamodb-local/dynamodb_local_latest.tar.gz | tar xz --directory /tmp/dynamodb
8
9
  before_script:
9
10
  - java -Djava.library.path=/tmp/dynamodb/DynamoDBLocal_lib -jar /tmp/dynamodb/DynamoDBLocal.jar -inMemory &
10
11
  script:
data/README.md CHANGED
@@ -202,7 +202,7 @@ Scan (SELECT ALL), QueryFilter (HAVING)
202
202
  Ryby
203
203
  query | ruby_script
204
204
 
205
- ex) SELECT ALL * FROM employees WHERE gender = 'M' | birth_date.map {|i| Time.parse(i) };
205
+ ex) SELECT ALL * FROM employees WHERE gender = 'M' | map {|i| Time.parse(i["birth_date"]) };
206
206
  [
207
207
  "1957-09-16 00:00:00 +0900",
208
208
  "1954-12-16 00:00:00 +0900",
@@ -245,7 +245,7 @@ Append
245
245
  # Test
246
246
 
247
247
  ```sh
248
- # http://dynamodb-preview.s3-website-us-west-2.amazonaws.com/dynamodb_local_latest_preview.tar.gz
248
+ # see https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html
249
249
  java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar &
250
250
  bundle install
251
251
  bundle exec rake
@@ -6,7 +6,6 @@ require 'ddbcli/ddb-driver'
6
6
  require 'ddbcli/ddb-endpoint'
7
7
  require 'ddbcli/ddb-error'
8
8
  require 'ddbcli/ddb-iteratorable'
9
- require 'ddbcli/ddb-rubyext'
10
9
 
11
10
  # CLI
12
11
  require 'ddbcli/cli/functions'
@@ -132,7 +132,7 @@ Scan (SELECT ALL), QueryFilter (HAVING)
132
132
  Ryby
133
133
  query | ruby_script
134
134
 
135
- ex) SELECT ALL * FROM employees WHERE gender = 'M' | birth_date.map {|i| Time.parse(i) };
135
+ ex) SELECT ALL * FROM employees WHERE gender = 'M' | map {|i| Time.parse(i["birth_date"]) };
136
136
  [
137
137
  "1957-09-16 00:00:00 +0900",
138
138
  "1954-12-16 00:00:00 +0900",
@@ -13,6 +13,7 @@ module DynamoDB
13
13
  'dynamodb.ap-southeast-1.amazonaws.com' => 'ap-southeast-1',
14
14
  'dynamodb.ap-southeast-2.amazonaws.com' => 'ap-southeast-2',
15
15
  'dynamodb.ap-northeast-1.amazonaws.com' => 'ap-northeast-1',
16
+ 'dynamodb.ap-northeast-2.amazonaws.com' => 'ap-northeast-2',
16
17
  'dynamodb.sa-east-1.amazonaws.com' => 'sa-east-1',
17
18
  }
18
19
 
@@ -1,3 +1,3 @@
1
1
  module DynamoDB
2
- VERSION = "0.5.4"
2
+ VERSION = "0.6.0"
3
3
  end
@@ -30,7 +30,7 @@ describe 'ddbcli' do
30
30
 
31
31
  expect(out).to eq(
32
32
  {"AttributeDefinitions"=>[{"AttributeName"=>"id", "AttributeType"=>"N"}],
33
- "StreamSpecification" => {"StreamEnabled"=>false},
33
+ "TableArn"=>"arn:aws:dynamodb:ddblocal:000000000000:table/foo",
34
34
  "TableName"=>"foo",
35
35
  "KeySchema"=>[{"AttributeName"=>"id", "KeyType"=>"HASH"}],
36
36
  "TableStatus"=>"ACTIVE",
@@ -61,7 +61,7 @@ describe 'ddbcli' do
61
61
  {"AttributeDefinitions"=>
62
62
  [{"AttributeName"=>"id", "AttributeType"=>"N"},
63
63
  {"AttributeName"=>"val", "AttributeType"=>"S"}],
64
- "StreamSpecification" => {"StreamEnabled"=>false},
64
+ "TableArn"=>"arn:aws:dynamodb:ddblocal:000000000000:table/foo",
65
65
  "TableName"=>"foo",
66
66
  "KeySchema"=>
67
67
  [{"AttributeName"=>"id", "KeyType"=>"HASH"},
@@ -96,7 +96,7 @@ describe 'ddbcli' do
96
96
  [{"AttributeName"=>"id", "AttributeType"=>"N"},
97
97
  {"AttributeName"=>"val", "AttributeType"=>"S"},
98
98
  {"AttributeName"=>"val2", "AttributeType"=>"S"}],
99
- "StreamSpecification" => {"StreamEnabled"=>false},
99
+ "TableArn"=>"arn:aws:dynamodb:ddblocal:000000000000:table/foo",
100
100
  "TableName"=>"foo",
101
101
  "KeySchema"=>
102
102
  [{"AttributeName"=>"id", "KeyType"=>"HASH"},
@@ -111,7 +111,8 @@ describe 'ddbcli' do
111
111
  "TableSizeBytes"=>0,
112
112
  "ItemCount"=>0,
113
113
  "LocalSecondaryIndexes"=>
114
- [{"IndexName"=>"idx_bar",
114
+ [{"IndexArn"=>"arn:aws:dynamodb:ddblocal:000000000000:table/foo/index/idx_bar",
115
+ "IndexName"=>"idx_bar",
115
116
  "KeySchema"=>
116
117
  [{"AttributeName"=>"id", "KeyType"=>"HASH"},
117
118
  {"AttributeName"=>"val2", "KeyType"=>"RANGE"}],
@@ -139,7 +140,7 @@ describe 'ddbcli' do
139
140
  [{"AttributeName"=>"id", "AttributeType"=>"N"},
140
141
  {"AttributeName"=>"val", "AttributeType"=>"S"},
141
142
  {"AttributeName"=>"val2", "AttributeType"=>"S"}],
142
- "StreamSpecification" => {"StreamEnabled"=>false},
143
+ "TableArn"=>"arn:aws:dynamodb:ddblocal:000000000000:table/foo",
143
144
  "TableName"=>"foo",
144
145
  "KeySchema"=>
145
146
  [{"AttributeName"=>"id", "KeyType"=>"HASH"},
@@ -154,7 +155,8 @@ describe 'ddbcli' do
154
155
  "TableSizeBytes"=>0,
155
156
  "ItemCount"=>0,
156
157
  "GlobalSecondaryIndexes"=>
157
- [{"IndexName"=>"idx_bar",
158
+ [{"IndexArn"=>"arn:aws:dynamodb:ddblocal:000000000000:table/foo/index/idx_bar",
159
+ "IndexName"=>"idx_bar",
158
160
  "KeySchema"=>[{"AttributeName"=>"val2", "KeyType"=>"HASH"}],
159
161
  "Projection"=>{"ProjectionType"=>"ALL"},
160
162
  "IndexStatus"=>"ACTIVE",
@@ -184,7 +186,7 @@ describe 'ddbcli' do
184
186
  [{"AttributeName"=>"id", "AttributeType"=>"N"},
185
187
  {"AttributeName"=>"val", "AttributeType"=>"S"},
186
188
  {"AttributeName"=>"val2", "AttributeType"=>"S"}],
187
- "StreamSpecification" => {"StreamEnabled"=>false},
189
+ "TableArn"=>"arn:aws:dynamodb:ddblocal:000000000000:table/foo",
188
190
  "TableName"=>"foo",
189
191
  "KeySchema"=>
190
192
  [{"AttributeName"=>"id", "KeyType"=>"HASH"},
@@ -199,7 +201,8 @@ describe 'ddbcli' do
199
201
  "TableSizeBytes"=>0,
200
202
  "ItemCount"=>0,
201
203
  "GlobalSecondaryIndexes"=>
202
- [{"IndexName"=>"idx_bar",
204
+ [{"IndexArn"=>"arn:aws:dynamodb:ddblocal:000000000000:table/foo/index/idx_bar",
205
+ "IndexName"=>"idx_bar",
203
206
  "KeySchema"=>[{"AttributeName"=>"val2", "KeyType"=>"HASH"}],
204
207
  "Projection"=>{"ProjectionType"=>"ALL"},
205
208
  "IndexStatus"=>"ACTIVE",
@@ -240,11 +243,12 @@ describe 'ddbcli' do
240
243
  "NumberOfDecreasesToday"=>0,
241
244
  "ReadCapacityUnits"=>2,
242
245
  "WriteCapacityUnits"=>2},
243
- "StreamSpecification" => {"StreamEnabled"=>false},
246
+ "TableArn"=>"arn:aws:dynamodb:ddblocal:000000000000:table/foo2",
244
247
  "TableSizeBytes"=>0,
245
248
  "ItemCount"=>0,
246
249
  "GlobalSecondaryIndexes"=>
247
- [{"IndexName"=>"idx_bar",
250
+ [{"IndexArn"=>"arn:aws:dynamodb:ddblocal:000000000000:table/foo2/index/idx_bar",
251
+ "IndexName"=>"idx_bar",
248
252
  "KeySchema"=>[{"AttributeName"=>"val2", "KeyType"=>"HASH"}],
249
253
  "Projection"=>{"ProjectionType"=>"ALL"},
250
254
  "IndexStatus"=>"ACTIVE",
@@ -274,7 +274,6 @@ VALUES
274
274
  "emp_no"=>1,
275
275
  "first_name"=>"Katsuyuki",
276
276
  "gender"=>"F",
277
- "hire_date"=>nil,
278
277
  "hire_date"=>"1989-12-28",
279
278
  "last_name"=>"Weedon"},
280
279
  {"birth_date"=>"1964-12-29",
@@ -470,7 +469,6 @@ VALUES
470
469
  "emp_no"=>1,
471
470
  "first_name"=>"Katsuyuki",
472
471
  "gender"=>"F",
473
- "hire_date"=>true,
474
472
  "hire_date"=>"1989-12-28",
475
473
  "last_name"=>"Weedon"},
476
474
  {"birth_date"=>"1964-12-29",
@@ -540,7 +538,6 @@ VALUES
540
538
  "emp_no"=>1,
541
539
  "first_name"=>"Katsuyuki",
542
540
  "gender"=>"F",
543
- "hire_date"=>false,
544
541
  "hire_date"=>"1989-12-28",
545
542
  "last_name"=>"Weedon"},
546
543
  {"birth_date"=>"1964-12-29",
@@ -610,7 +607,6 @@ VALUES
610
607
  "emp_no"=>1,
611
608
  "first_name"=>"Katsuyuki",
612
609
  "gender"=>"F",
613
- "hire_date"=>[1, 2, ["foo", "bar"]],
614
610
  "hire_date"=>"1989-12-28",
615
611
  "last_name"=>"Weedon"},
616
612
  {"birth_date"=>"1964-12-29",
@@ -680,7 +676,6 @@ VALUES
680
676
  "emp_no"=>1,
681
677
  "first_name"=>"Katsuyuki",
682
678
  "gender"=>"F",
683
- "hire_date"=>{"foo"=>"bar", "zoo"=>[1, 2, 3]},
684
679
  "hire_date"=>"1989-12-28",
685
680
  "last_name"=>"Weedon"},
686
681
  {"birth_date"=>"1964-12-29",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ddbcli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.4
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-10-24 00:00:00.000000000 Z
11
+ date: 2019-01-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -97,7 +97,6 @@ files:
97
97
  - lib/ddbcli/ddb-iteratorable.rb
98
98
  - lib/ddbcli/ddb-parser.tab.rb
99
99
  - lib/ddbcli/ddb-parser.y
100
- - lib/ddbcli/ddb-rubyext.rb
101
100
  - lib/ddbcli/version.rb
102
101
  - spec/ddbcli_spec.rb
103
102
  - spec/delete_spec.rb
@@ -125,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
124
  version: '0'
126
125
  requirements: []
127
126
  rubyforge_project:
128
- rubygems_version: 2.6.13
127
+ rubygems_version: 2.7.6
129
128
  signing_key:
130
129
  specification_version: 4
131
130
  summary: ddbcli is an interactive command-line client of Amazon DynamoDB.
@@ -1,43 +0,0 @@
1
- class Array
2
- def sum
3
- self.inject {|r, i| r + i }
4
- end
5
-
6
- def avg
7
- self.sum / self.length
8
- end
9
-
10
- def group_by(name, &block)
11
- item_h = {}
12
-
13
- self.each do |item|
14
- key = item[name.to_s]
15
- item_h[key] ||= []
16
- item_h[key] << item
17
- end
18
-
19
- return item_h unless block
20
-
21
- new_item_h = {}
22
-
23
- item_h.each do |key, item_list|
24
- if block.arity == 2
25
- new_item_h[key] = block.call(item_listm key)
26
- else
27
- new_item_h[key] = block.call(item_list)
28
- end
29
- end
30
-
31
- return new_item_h
32
- end
33
-
34
- def method_missing(method_name, *args, &block)
35
- case method_name.to_s
36
- when /=\Z/
37
- self.each {|i| i[method_name.to_s.sub(/=\Z/, '')] = *args }
38
- self
39
- else
40
- self.map {|i| i[method_name.to_s] }
41
- end
42
- end
43
- end