awful 0.0.50 → 0.0.51
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 +20 -9
- 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: 2888a7ad42f76efc66392da142e9b62773c5c0db
|
4
|
+
data.tar.gz: 6eee728975b75a92630a22e6cb782262491272bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b75300afbde05e5e03698bf2314f634d0137ad5e7340a15d09e6c29f576e7800ef762a3a3be08fab737981e649585db33f5455468c7ae76a9a62679dfb2a4d85
|
7
|
+
data.tar.gz: 309eee4a3dc1dd434c1c582597cacb69e20ea4d007e363b8c070ed04b5dde42639fd88198b0da57ec8c6100be2977a582ef03a28429160ee9dccb99e072b8187
|
data/lib/awful/dynamodb.rb
CHANGED
@@ -66,19 +66,30 @@ module Awful
|
|
66
66
|
end
|
67
67
|
end
|
68
68
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
69
|
+
no_commands do
|
70
|
+
## uses simple_json to get Aws::Plugins::Protocols::JsonRpc output from scan;
|
71
|
+
## this also means request params need to be raw strings and not symbols, etc
|
72
|
+
def scan_to_file(name, exclusive_start_key, fd)
|
73
|
+
r = dynamodb_simple.scan('TableName' => name, 'ExclusiveStartKey' => exclusive_start_key)
|
74
|
+
r['Items'].each do |item|
|
75
|
+
fd.puts JSON.generate(item)
|
76
|
+
end
|
75
77
|
|
76
|
-
|
77
|
-
|
78
|
-
|
78
|
+
## recurse if more data to get
|
79
|
+
if r.has_key?('LastEvaluatedKey')
|
80
|
+
scan_to_file(name, r['LastEvaluatedKey'], fd)
|
81
|
+
end
|
79
82
|
end
|
80
83
|
end
|
81
84
|
|
85
|
+
desc 'scan NAME', 'scan table with NAME'
|
86
|
+
method_option :output, aliases: '-o', type: :string, default: nil, desc: 'Output filename (default: stdout)'
|
87
|
+
def scan(name, exclusive_start_key = nil)
|
88
|
+
fd = options[:output] ? File.open(options[:output], 'w') : $stdout.dup # open output file or stdout
|
89
|
+
scan_to_file(name, exclusive_start_key, fd)
|
90
|
+
fd.close
|
91
|
+
end
|
92
|
+
|
82
93
|
desc 'put_items NAME', 'puts json items into the table with NAME'
|
83
94
|
def put_items(name, file = nil)
|
84
95
|
io = (file and File.open(file)) || ((not $stdin.tty?) and $stdin)
|
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.51
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ric Lister
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|