lib/cl/help/table.rb in cl-1.0.0 vs lib/cl/help/table.rb in cl-1.0.1
- old
+ new
@@ -40,12 +40,15 @@
end
def widths
cols.map.with_index do |col, ix|
max = col.compact.max_by(&:size)
- width = max ? max.size : 0
- ix < cols.size - 2 ? width : width + padding.to_i
+ pad(max ? max.size : 0, ix)
end
+ end
+
+ def pad(width, ix)
+ ix < cols.size - 2 ? width : width + padding.to_i
end
def cols
@cols ||= data.transpose
end