Avoid interleaving status output with file listing.

Before:

[
Getting snapshot pages.. found 1 snaphots to consider.

{"file_url":"http://www.trackpedia.com:80/forums/archive/index.php/f-115.html","timestamp":20131221124252,"file_id":"forums/archive/index.php/f-115.html"},
]

After:

Getting snapshot pages.. found 1 snaphots to consider.

[
{"file_url":"http://www.trackpedia.com:80/forums/archive/index.php/f-115.html","timestamp":20131221124252,"file_id":"forums/archive/index.php/f-115.html"},
]
This commit is contained in:
Oleg Pudeyev 2017-03-15 17:19:34 -04:00
parent 6b8c1aa194
commit 65b1948517

View File

@ -135,8 +135,11 @@ class WaybackMachineDownloader
end end
def list_files def list_files
# retrieval produces its own output
files = get_file_list_by_timestamp
# ... hence delay printing the opening bracket
puts "[" puts "["
get_file_list_by_timestamp.each do |file| files.each do |file|
puts file.to_json + "," puts file.to_json + ","
end end
puts "]" puts "]"