awful 0.0.108 → 0.0.109

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
2
  SHA1:
3
- metadata.gz: ad58f56271094f479fc3a6fa01e4cf87e3333889
4
- data.tar.gz: a30c008fac5e928d5dc13b9a32833ff88b8eb215
3
+ metadata.gz: 6060e768225214a8061288856c250a775094131e
4
+ data.tar.gz: f0e36a914b34a574950d9dccc0f1aee733bb4762
5
5
  SHA512:
6
- metadata.gz: 82a83a209db9cc377a991570bc81847e1697a6caf815d948131915b2ce92bdb7709e892a9787183f2d6ffdb992a7628b89cd1e07439ca153f36eac0c66d746d4
7
- data.tar.gz: 187d202f3338fab910de80e02d9716b36f38b2ba847f19e31f8ba451e1bb4a31c9aebb82a5ef5e3b38e3f266c3c53062eea8021d409852dde38ae8416f29c578
6
+ metadata.gz: 307be122697743caccd757097dd16d8aed05b789bff98d21830de31e53adac1f3493a578afd20f43eb84d6a9c16918b3dd051a6e2a7024f4c4e6b1f0234a758e
7
+ data.tar.gz: 48f3f05ab752ac1dfed9ccf5bb66311952f56231c0e4cb4125b2b42ce538a684914280e6b16bd4ebc8e640120e19776b421fa87328a430f4cc45e1256a2b4023
@@ -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
- scan_to_file(name, exclusive_start_key, fd)
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
 
@@ -1,3 +1,3 @@
1
1
  module Awful
2
- VERSION = '0.0.108'
2
+ VERSION = '0.0.109'
3
3
  end
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.108
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-26 00:00:00.000000000 Z
11
+ date: 2016-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler