Closed ddoherty03 closed 7 years ago
There's no method in the current version of rainbow for this. But we have PR for exactly this: #54 :)
Thanks, @sickill. I would vote for a less ponderous name, though, than 'strip_ascii_escape', something like 'clear' or 'wipe', etc.
@ddoherty03 @sickill The #54 is now merged.
Is this issue "fixed" with that?
It's called uncolor
now and I'd say that fixes this issue indeed :)
@sickill, yes indeed. Thanks for getting to this.
Thanks, all; closing this issue.
I am using rainbow to build up tables with possibly colored components, and I need to compute the width of a string that may or may not be rainbowized. I would like to have a method on Rainbow that would return just the wrapped string without any escape codes if the string is already wrapped or just the string otherwise.
Then I could calculate the width of an element that may or may not be wrapped with something like
In the meantime, any easy way to do this with current gem? Also, thanks for a great gem.