HTTP downloader clears the download line once its complete so that the log output doesn't wrap
This commit is contained in:
parent
3d220ef5c8
commit
f5f1405a7c
|
@ -28,6 +28,8 @@ module Vagrant
|
|||
destination_file.write(segment)
|
||||
end
|
||||
end
|
||||
|
||||
complete_progress
|
||||
end
|
||||
|
||||
def report_progress(progress, total)
|
||||
|
@ -35,6 +37,11 @@ module Vagrant
|
|||
print "#{CL_RESET}Download Progress: #{percent.to_i}% (#{progress} / #{total})"
|
||||
$stdout.flush
|
||||
end
|
||||
|
||||
def complete_progress
|
||||
# Just clear the line back out
|
||||
print "#{CL_RESET}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -4,6 +4,7 @@ class HttpDownloaderTest < Test::Unit::TestCase
|
|||
setup do
|
||||
@downloader, @tempfile = mock_downloader(Vagrant::Downloaders::HTTP)
|
||||
@downloader.stubs(:report_progress)
|
||||
@downloader.stubs(:complete_progress)
|
||||
@uri = "foo.box"
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue