lib/kpm/formatter.rb in kpm-0.8.2 vs lib/kpm/formatter.rb in kpm-0.9.0
- old
+ new
@@ -95,11 +95,11 @@
formatted = "\n#{border}\n"
formatted += Kernel.format("#{format_string}\n", *labels_format_argument)
formatted += "#{border}\n"
- data.keys.each do |key|
+ data.each_key do |key|
v = data[key]
arguments = []
labels.inject(arguments) do |res, e|
formatter = e[:formatter].nil? ? DefaultFormatter.new(e[:label], v[e[:label]]) : e[:formatter].to_class.new(e[:label], v[e[:label]])
@@ -129,10 +129,10 @@
# Return labels for each row and update the labels hash with the size of each column
def compute_labels(data, labels)
seen_labels = Set.new
labels_format_argument = []
- data.keys.each do |key|
+ data.each_key do |key|
v = data[key]
labels.each do |e|
# sanitize entry at the same time
v[e[:label]] = v[e[:label]] || '???'