lib/ddbcli/ddb-driver.rb in ddbcli-0.2.1 vs lib/ddbcli/ddb-driver.rb in ddbcli-0.2.2
- old
+ new
@@ -196,10 +196,16 @@
h[table_name] = {}
%w(TableStatus ItemCount TableSizeBytes).each do |i|
h[table_name][i] = table_info[i]
end
+
+ provisioned_throughput = table_info['ProvisionedThroughput']
+
+ %w(ReadCapacityUnits WriteCapacityUnits).each do |i|
+ h[table_name][i] = provisioned_throughput[i]
+ end
end
return h
end
@@ -282,10 +288,21 @@
@client.query('UpdateTable', req_hash)
nil
end
def do_use(parsed)
- set_endpoint_and_region(parsed.endpoint_or_region)
+ eor = parsed.endpoint_or_region
+
+ if %r|\A\w+://| =~ eor or /:\d+\Z/ =~ eor
+ eor = "http://#{eor}" unless eor =~ %r|\A\w+://|
+ eor = URI.parse(eor)
+
+ unless /\Ahttps?\Z/ =~ eor.scheme
+ raise URI::InvalidURIError, "invalid shceme: #{parsed.endpoint_or_region}"
+ end
+ end
+
+ set_endpoint_and_region(eor)
nil
end
def do_create(parsed)
req_hash = {