11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
# File 'lib/vagrant-plugins/ui.rb', line 11
def print_columns(data, opts=nil)
defaults = { :prefix => false }
opts = defaults.merge(opts ||= {})
columns = opts.delete(:column_order)
data = clean(data, opts)
size = sizes(data)
table_head = columnize_row(columns.zip(columns), size, columns) + "\n"
table_head << (table_head.gsub(/[^\t]/, '-')) + "\n"
table_body = data.map { |line| columnize_row(line, size, columns) }.join("\n")
say :info, table_head << table_body, opts
end
|