This pull request brings in a progress bar that will be displayed while downloading gems. This is particularly useful when downloading large gems such as qtbindings on Windows. If the extra STDOUT output is undesirable, it would be easy to modify it to only output for large files (maybe > 1 Mb?). I like the feedback for all file sizes personally. Let me know what you think.
Add progress bar during gem downloads. Will help with large downloads…
… such as qtbindings on Windows
Add progressbar file from the progressbar gem which is Ruby Licensed
I like it, however I'm not sure of including ProgressBar globally.
Saying this because there is a progressbar gem: https://rubygems.org/gems/progressbar and it might clash.
Rubinius guys did a simple implementation:
That did not depend on the the additional class.
We also need to check how this could affect the automated output, specially for projects like Bundler and such.
Namespace the progressbar class
I added the progressbar class to the gem namespace, so it shouldn't conflict with anything now.
I think the good idea will be remove ProgressBar at all.
Also, all the remote operations are been handled by this, so fetching of specs and everything is streamed.
There is also another problem, it doesn't work with 1.8.7:
ERROR: While executing gem ... (NoMethodError)oooooooooooooooo| ETA: 00:00:00
undefined method `body=' for #Net::HTTPOK 200 OK readbody=true
Tested with ruby -Ilib bin/gem fetch qtbindings
ruby -Ilib bin/gem fetch qtbindings
See my patch to only generate the progress report when a gem is being downloaded: http://gist.github.com/600349
Fix for Ruby 1.8.7, Remove ProgessBar class, Incorporate Luis's ideas
I updated it to remove the progressbar class and to use a single line that gets redrawn as suggested in your gist. Also updated to work with 1.8.7.
Thank you Ryan
Posted about this to rubygems-devel:
Waiting for feedback there before decide to integrate it.
wrap printing methods in say-like statements
Hi Luis, I believe I addressed your issue of using print and flush directly by wrapping them in say-like statements. As no one has commented, can we get this incorporated?
I bring this topic to RubyGems about making the progress bar something part of UI component to have better control of it.
Also, this print/flush approach do not work nice with remote automations like Chef, so move of this to the UI and have an option to turn it of will be the best.
See my thread and further comments there:
This should be integrated, but to my bad, I'm not 100 percent sure on the approach and to my bad haven't received the feedback from other RubyGems maintainers
Will keep you posted.
add size to progress and use console width to clear line
I'm working today on extend UserInteraction to support a configurable Download reporter, in that way, it will make more easy for non-tty interfaces to work and not generate a bunch of output.
Thank you again for your contribution. Will post a link to the commits once I'm done for you to test and review.
Been wanting this forever. Any kind of feedback when gem install happens would be AWESOME.
I defer to Luis (who needs to stop deferring to the list).
I've posted this to the list for review:
I've implemented Ryan idea into a more modular and non-tty friendly version under download-reporter branch:
Let me know your thoughts guys.
Wanted to let you know this has been merged into master (slightly different code, same idea) into master:
Closing this out.
Ryan, thank you for your contribution, patience and initial code for this implementation.