Skip to content

Instantly share code, notes, and snippets.

@7kaji
Created December 6, 2014 18:38
Show Gist options
  • Save 7kaji/945f75dbef27419157d5 to your computer and use it in GitHub Desktop.
Save 7kaji/945f75dbef27419157d5 to your computer and use it in GitHub Desktop.
require 'ruby-progressbar'
image_file_size = File.size(image_file_size)
if File.size(image_url) > 0
progress_bar = ProgressBar.create(:title => "Uploading...",
:starting_at => 0,
:total => image_file_size,
:output => $stderr,
:format => '%a |%b>>%i| %p%% %t'
)
end
progress_proc: proc do |step|
progress_bar.progress = step
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment