Comments (5)
Why don't you just pass in the output
option when creating the bar?
from ruby-progressbar.
No, I want it vice versa. I want progress bar to take somehow control or fix the output so that it stays at the bottom. And I don't want to write the code (and write some output/logger object which does everything) -- I mean it would be nice if it would be provided, like this shitty stdout redirector from above. Otherwise I have to write so much boilerplate code, then I could just replace the library with my own code which does only what I want. But as I said, I don't want that. I want to reuse code...
More complete redirector: https://github.com/minad/iruby/blob/master/lib/iruby/ostream.rb
from ruby-progressbar.
Ok, I now understand what you're saying here, but this is not something I'm going to provide in the gem. If you want to create a separate library that does this, I'll be happy to link to it from the README, but this is a pretty specialized use case.
For most people, they either wrap the bar and output things first such as with fuubar
, or they use log
, which properly outputs messages, or they have no output other than the bar.
Even if we did provide a solution like this for the most common case of $stdout
, any code that points specifically to STDOUT
would cause the same problems as would any code that is out of band of the Ruby process (for example shelling out).
Like I said, I get what you're saying and what you want to do, but I'm going to keep this library focused on doing one thing and doing one thing well.
from ruby-progressbar.
Yes, STDOUT always outputs to real stdout. However such an addition would allow you to allow normal code (using only puts etc) in a non-obtrusive and decoupled way. I don't say this should be standard behaviour, but it would be a nice utility. Creating an additional library for such a thing is overkill imho.
from ruby-progressbar.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from ruby-progressbar.
Related Issues (20)
- Incorrect ETA calculation if starting_at HOT 7
- Am I being obtuse, or is there a usage gap? HOT 5
- Use `Logger` class with `ProgressBar#log` HOT 2
- Smoothing window HOT 4
- Optionally allow progress beyond the set total HOT 2
- Test failure HOT 5
- Clearing progress HOT 2
- Bar refuses to update on the first increment HOT 2
- cannot load such file -- enumerator (LoadError) HOT 7
- #reset is still making the timer fail in 1.11.0 HOT 3
- Support for FiraCode progressbar HOT 2
- ProgressBar is whiny HOT 1
- Certificat expired HOT 3
- Enable logging for the enumberable extension
- Pass ProgressBar instance to with_progressbar HOT 10
- uninitialized constant ProgressBar::Base::Timer HOT 4
- Format time including number of days. HOT 1
- Improve wiki docs for formatting
- Remove progress after 100% complete HOT 1
- Calculate the ETA based on the last N increment or last X seconds HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ruby-progressbar.