lib/ddbcli/ddb-driver.rb in ddbcli-0.2.4 vs lib/ddbcli/ddb-driver.rb in ddbcli-0.2.5
- old
+ new
@@ -112,9 +112,15 @@
IO.popen(script, "r+") do |f|
f.puts(retval.kind_of?(Array) ? retval.map {|i| i.to_s }.join("\n") : retval.to_s)
f.close_write
f.read
end
+ when :overwrite
+ open(script, 'wb') {|f| print_json(retval, f, opts) }
+ retval = nil
+ when :append
+ open(script, 'ab') {|f| print_json(retval, f, opts) }
+ retval = nil
else
retval
end
rescue Exception => e
raise DynamoDB::Error, e.message, e.backtrace