paul / progress_bar

A Ruby terminal progress_bar
Do What The F*ck You Want To Public License
623 stars 49 forks source link

Adds ProgressBar#puts #56

Closed paul closed 4 years ago

paul commented 4 years ago

Adds support to print messages without interfering with the output of the bar.

See README and examples/printing_messages.rb.

Some long text
that contains newlines
Halfway there!
Almost done!
[##################################] [100/100] [100%] [00:10] [00:00] [  9.98/s]
paul commented 4 years ago

@TRex22 @BenjiWiebe I'll probably merge and release this weekend, but I wanted to see if you had any thoughts before I do.

TRex22 commented 4 years ago

Cool Ill look over now

paul commented 4 years ago

@TRex22 The reason I chose puts is because of the symmetry with other IO-like object in Ruby. I don't know if we will, but it might be nice if you could supply an instance of ProgressBar in place of other things like $stdout that expect to be able to puts, and it wouldn't be too hard to add print and write, should the need arise.

ppkn commented 4 years ago

Is this going to get rolled up into a release?

paul commented 4 years ago

@ppkn I think I was waiting for feedback in the other PRs, then forgot all about it. I'll cut a new release today!

paul commented 4 years ago

@ppkn done, released 1.3.2: https://rubygems.org/gems/progress_bar