Giter VIP home page Giter VIP logo

Comments (5)

jfelchner avatar jfelchner commented on August 25, 2024

Why don't you just pass in the output option when creating the bar?

from ruby-progressbar.

minad avatar minad commented on August 25, 2024

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.

jfelchner avatar jfelchner commented on August 25, 2024

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.

minad avatar minad commented on August 25, 2024

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.

github-actions avatar github-actions commented on August 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.