lib/ztk/report/list.rb in ztk-2.1.0 vs lib/ztk/report/list.rb in ztk-2.1.1

- old
+ new

@@ -41,17 +41,17 @@ end rows.compact! if rows.count > 0 max_key_length = headers.collect{ |header| header.to_s.length }.max - max_value_length = rows.collect{ |row| headers.collect{ |header| row.send(:table)[header].to_s.length }.max }.max + max_value_length = rows.collect{ |row| headers.collect{ |header| (row.send(:table) rescue row)[header].to_s.length }.max }.max width = (max_key_length + max_value_length + 2 + 2 + 2) rows.each do |row| config.ui.stdout.puts("+#{"-" * width}+") headers.each do |header| - entry_line = format_entry(header, max_key_length, row.send(:table)[header], max_value_length) + entry_line = format_entry(header, max_key_length, (row.send(:table) rescue row)[header], max_value_length) config.ui.stdout.puts(entry_line) end end config.ui.stdout.puts("+#{"-" * width}+") OpenStruct.new(:rows => rows, :max_key_length => max_key_length, :max_value_length => max_value_length, :width => width)