Skip to content

Commit 25e9166

Browse files
authored
Update Impoortmaps::Command#puts_table to be markdown compatible (#222)
1 parent 59b6862 commit 25e9166

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/importmap/commands.rb

+2-3
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,13 @@ def puts_table(array)
121121
row.each_with_index.map{ |iterand, index| [lengths[index] || 0, iterand.to_s.length].max }
122122
end
123123

124-
puts head = "+" + (column_sizes.map { |s| "-" * (s + 2) }.join('+')) + '+'
124+
divider = "|" + (column_sizes.map { |s| "-" * (s + 2) }.join('|')) + '|'
125125
array.each_with_index do |row, row_number|
126126
row = row.fill(nil, row.size..(column_sizes.size - 1))
127127
row = row.each_with_index.map { |v, i| v.to_s + " " * (column_sizes[i] - v.to_s.length) }
128128
puts "| " + row.join(" | ") + " |"
129-
puts head if row_number == 0
129+
puts divider if row_number == 0
130130
end
131-
puts head
132131
end
133132
end
134133

0 commit comments

Comments
 (0)