Created
March 4, 2014 21:36
-
-
Save livoffgrid/9356313 to your computer and use it in GitHub Desktop.
I have some formatted benchmarks going to stdout and I'd like to colorize them. Trouble is when I send a colorized string though the formatter the white space between columns gets ignored.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Who wants to shave this yak? | |
| # $ irb | |
| # > require 'colorize | |
| # > puts " %-20s %05d" % ['hello', 12] | |
| # hello 00012 | |
| # > puts " %-20s %05d" % ['hello'.blue, 12] | |
| # hello 00012 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment