Skip to content

Commit

Permalink
chore: remove ruby warning about unused variable
Browse files Browse the repository at this point in the history
  • Loading branch information
flavorjones committed May 31, 2021
1 parent a6c83cf commit 019bd62
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions lib/mini_portile2/mini_portile.rb
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,6 @@ def download_file(url, full_path, count = 3)
def download_file_http(url, full_path, count = 3)
filename = File.basename(full_path)
with_tempfile(filename, full_path) do |temp_file|
progress = 0
total = 0
params = {
"Accept-Encoding" => 'identity',
Expand All @@ -482,7 +481,6 @@ def download_file_http(url, full_path, count = 3)
if total
new_progress = (bytes * 100) / total
message "\rDownloading %s (%3d%%) " % [filename, new_progress]
progress = new_progress
else
# Content-Length is unavailable because Transfer-Encoding is chunked
message "\rDownloading %s " % [filename]
Expand Down Expand Up @@ -532,14 +530,12 @@ def download_file_file(uri, full_path)
def download_file_ftp(uri, full_path)
filename = File.basename(uri.path)
with_tempfile(filename, full_path) do |temp_file|
progress = 0
total = 0
params = {
:content_length_proc => lambda{|length| total = length },
:progress_proc => lambda{|bytes|
new_progress = (bytes * 100) / total
message "\rDownloading %s (%3d%%) " % [filename, new_progress]
progress = new_progress
}
}
if ENV["ftp_proxy"]
Expand Down

0 comments on commit 019bd62

Please sign in to comment.