5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
# File 'lib/ki_middleman/transformations_renderer.rb', line 5
def self.render(transformations)
output = []
longest_origin_format_length = transformations.keys.map(&:length).max
transformations.each do |origin_format, destination_format_array|
last_index = destination_format_array.length - 1
destination_format_array.each_with_index do |destination_format, index|
output <<
"%-#{longest_origin_format_length}s %s %s" %
[render_origin_format(origin_format, index),
render_arrows(index, last_index),
destination_format]
end
end
output.map {|o| o + "\n"}.join
end
|