Closed d-m-u closed 4 years ago
Can you show a before/after? I can't really understand what the issue was (i.e was the column too long or too short).
hey @Fryguy and @kbrock, thanks for the review on this, could I please ask you to take another look?
Do we want to remove the color completely, or just for the field length?
it was only line 121, until the comment yesterday
and when I asked about it again, here's what I got:
Jul 07 17:31
that method totally looks right though
thanks. this looks nice @d-m-u
work for you @Fryguy ?
@d-m-u Accidental close?
@Fryguy no, we're going to implement it in benchmark-sweet and not rely on this dependency.
ok...I still like the feature, so I'll probably reopen at some point.
Updated with the code snippet from https://github.com/ManageIQ/more_core_extensions/pull/87#discussion_r455286172 and added a bunch more tests for the edge cases.
@bdunne Please review.
@Fryguy Can you add a test with multiple colors?
Updated with a better algorithm that determines matching escape sequences that fall into the expected width. Still need to add the specs.
spec/core_ext/array/tableize_spec.rb
<<~
instead of <<-
.EOF
is not aligned with expected = <<-EOF
.<<~
instead of <<-
.EOF
is not aligned with expected = <<-EOF
.<<~
instead of <<-
.EOF
is not aligned with expected = <<-EOF
.<<~
instead of <<-
.EOF
is not aligned with expected = <<-EOF
.<<~
instead of <<-
.EOF
is not aligned with expected = <<-EOF
.<<~
instead of <<-
.EOF
is not aligned with expected = <<-EOF
.<<~
instead of <<-
.EOF
is not aligned with expected = <<-EOF
.<<~
instead of <<-
.EOF
is not aligned with expected = <<-EOF
.
It'd be cool if the length calculation here didn't include color codes.
also it's something that if it were right I expect Keenan might back