awful 0.0.108 → 0.0.109
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/awful/dynamodb.rb +9 -19
- data/lib/awful/version.rb +1 -1
- 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: 6060e768225214a8061288856c250a775094131e
|
4
|
+
data.tar.gz: f0e36a914b34a574950d9dccc0f1aee733bb4762
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 307be122697743caccd757097dd16d8aed05b789bff98d21830de31e53adac1f3493a578afd20f43eb84d6a9c16918b3dd051a6e2a7024f4c4e6b1f0234a758e
|
7
|
+
data.tar.gz: 48f3f05ab752ac1dfed9ccf5bb66311952f56231c0e4cb4125b2b42ce538a684914280e6b16bd4ebc8e640120e19776b421fa87328a430f4cc45e1256a2b4023
|
data/lib/awful/dynamodb.rb
CHANGED
@@ -156,24 +156,6 @@ module Awful
|
|
156
156
|
end
|
157
157
|
end
|
158
158
|
|
159
|
-
no_commands do
|
160
|
-
|
161
|
-
## uses simple_json to get Aws::Plugins::Protocols::JsonRpc output from scan;
|
162
|
-
## this also means request params need to be raw strings and not symbols, etc
|
163
|
-
def scan_to_file(name, exclusive_start_key, fd)
|
164
|
-
r = dynamodb_simple.scan('TableName' => name, 'ExclusiveStartKey' => exclusive_start_key)
|
165
|
-
r['Items'].each do |item|
|
166
|
-
fd.puts JSON.generate(item)
|
167
|
-
end
|
168
|
-
|
169
|
-
## recurse if more data to get
|
170
|
-
if r.has_key?('LastEvaluatedKey')
|
171
|
-
scan_to_file(name, r['LastEvaluatedKey'], fd)
|
172
|
-
end
|
173
|
-
end
|
174
|
-
|
175
|
-
end
|
176
|
-
|
177
159
|
desc 'copy [region/]SRC [region/]DEST', 'copy data from table region/SRC to table region/DEST'
|
178
160
|
method_option :dots, aliases: '-d', type: :boolean, default: false, desc: 'Show dots for put_item progress'
|
179
161
|
method_option :no_clobber, aliases: '-n', type: :boolean, default: false, desc: 'Do not overwrite existing items'
|
@@ -230,7 +212,15 @@ module Awful
|
|
230
212
|
method_option :output, aliases: '-o', type: :string, default: nil, desc: 'Output filename (default: stdout)'
|
231
213
|
def scan(name, exclusive_start_key = nil)
|
232
214
|
fd = options[:output] ? File.open(options[:output], 'w') : $stdout.dup # open output file or stdout
|
233
|
-
|
215
|
+
exclusive_start_key = nil
|
216
|
+
loop do
|
217
|
+
r = dynamodb_simple.scan('TableName' => name, 'ExclusiveStartKey' => exclusive_start_key)
|
218
|
+
r['Items'].each do |item|
|
219
|
+
fd.puts JSON.generate(item)
|
220
|
+
end
|
221
|
+
exclusive_start_key = r['LastEvaluatedKey']
|
222
|
+
break unless exclusive_start_key
|
223
|
+
end
|
234
224
|
fd.close
|
235
225
|
end
|
236
226
|
|
data/lib/awful/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awful
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.109
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ric Lister
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|