New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Progress bar defaults to 80 character length when ran through Spring on Rails #69
Comments
@brandonweiss there are multiple places where it gives up and defaults to 80 characters. If you could add some puts statements locally to figure out which one is actually being fired, that would help a lot in tracking down exactly what's going on. |
Ah, OK, what seems to be happening is |
@brandonweiss my guess (and I don't know this for a fact) is that spring is buffering the output through its own IO object first, then it's outputting it to the screen. Because of this, the bar has no console with which to check it's width. Your only option for a full width bar at that point would be to manually set the ENV variable that progressbar checks before it does it's calculation. |
@brandonweiss I'm going to leave this issue open as long as it's still being researched. I want to make sure it's not a problem with |
Yeah I'm researching it now. Will do! |
Also, off the subject, but just wait till you see what I have in store for the next version of the gem. 😄 It'll be especially applicable to a test reporter. I'm going to add "buckets" to the bar. So that you'll essentially be able to do something like this:
Where the '+' might be a red |
Yes! I was initially trying to do that, until I realized that it's not possible in the way a normal reporter with dots can do it, because the bar is redrawn every time. So I settled for the whole bar changing color. But it would certainly be awesome to be able to colorize part of it. |
Hey @brandonweiss any progress on this? |
Sorry, I've got an issue open (rails/spring#296) on spring, I just haven't heard back yet. |
@brandonweiss awesome. No problem. Tell ya what, I'm going to close this issue for now since it's not really an issue with the progressbar. If/when they get back to you, just ping me back on this issue and I'll reopen in. |
👍 |
Just if someone needs a temporary solution (this is guard+rspec+spring+fuubar on OS X example): guard :rspec, cmd: 'RUBY_PROGRESS_BAR_LENGTH=`tput cols` bin/rspec' do
end or add this line in #!/usr/bin/env ruby
begin
ENV['RUBY_PROGRESS_BAR_LENGTH'] ||= `tput cols`.chomp # <---
load File.expand_path("../spring", __FILE__)
rescue LoadError
end
require 'bundler/setup'
load Gem.bin_path('rspec-core', 'rspec') |
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. |
I've been working on improving the ProgressReporter on minitest-reporters, and I recently switched it from using PowerBar to ruby-progressbar. This fixed a performance issue and enabled a few other improvements, but I noticed an issue minitest-reporters/minitest-reporters#106.
As I mentioned in the issue I read through
LengthCalculator
but my knowledge of how terminals work isn't deep enough to understand why this is happening or if there's a fix, and if that fix should be on ruby-progressbar or not. Thoughts?The text was updated successfully, but these errors were encountered: