JEG2/highline — Issue #21: UnevenColumnsAcross doesn't take color into account
Author: yfeldblum
Created: 2011-11-22 16:53:08+00:00
State: open

From JEG2/highline#14:

This patch seems to work fine in the usual case.

ruby-1.9.2-p180 :007 > a = %w(Blah a b c ad e fs f g)
=> ["Blah", "a", "b", "c", "ad", "e", "fs", "f", "g"]
ruby-1.9.2-p180 :008 > puts ui.list(a, :uneven_columns_across, 3)
Blah a b
c ad e
fs f g
=> nil

However, when there's bold formatting on the first row, it doesn't seem to work right:

ruby-1.9.2-p180 :009 > a = [ui.color("Blah", :bold), ui.color("a", :bold), ui.color("b", :bold), "c", "ad", "e", "fs", "f", "g"]
=> ["\e[1mBlah\e[0m", "\e[1ma\e[0m", "\e[1mb\e[0m", "c", "ad", "e", "fs", "f", "g"]
ruby-1.9.2-p180 :010 > puts ui.list(a, :uneven_columns_across, 3)
Blah a b
c ad e
fs f g
=> nil

One specific use case for this issue is the `knife-rackspace` library. [Example](https://github.com/opscode/knife-rackspace/blob/master/lib/chef/knife/rackspace_server_list.rb).