lib/ayadn/client-http.rb in ayadn-0.6.3 vs lib/ayadn/client-http.rb in ayadn-0.6.4

- old
+ new

@@ -24,11 +24,11 @@ exit when 403 puts "\nForbidden.\n\n".red exit when 404 - puts "\nDoes not exist (or has been deleted).\n\n".red + puts "\nDoes not exist (or has been deleted) => \n\n#{code}\n\n".red exit when 429 puts "\nToo many requests.\n\n".red exit when 507 @@ -52,20 +52,20 @@ return response.body else #print "\rConnecting to #{uri.host}#{uri.path}".cyan body = '' https.request(request) do |res| - fileSize = res['Content-Length'].to_i - bytesTransferred = 0 + #fileSize = res['Content-Length'].to_i + #bytesTransferred = 0 res.read_body do |part| - bytesTransferred += part.length - rounded = bytesTransferred.percent_of(fileSize).round(2) - print "\rFetching data: ".cyan + "#{rounded} ".brown + #bytesTransferred += part.length + #rounded = bytesTransferred.percent_of(fileSize).round(2) + #print "\rFetching data: ".cyan + "#{rounded} ".brown # print "\rDownloading response from App.net\t#{bytesTransferred.to_filesize}" body << part end end - print "\r " + #print "\r " #puts "" check_http_error_code(body) return body end end