terminal-table-unicode 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/terminal/table/cell.rb +1 -0
- data/lib/terminal/table/table.rb +4 -3
- data/lib/terminal/table/unicode/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e82857fbd781ffcb46e9fedb14f7fadc785ca68
|
4
|
+
data.tar.gz: dc8c3650797f52c2a5f463edd5f4029a8cfc8220
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 887a7592a8772438037f364a48e0a21275ba9a00fa8e41539ecef55b49c7d4949361d5445ca9983dd6ed41eda55ae02466319c107285ba280498e4d8dddcbe6e
|
7
|
+
data.tar.gz: e1675f7c878de49f6ae1c551d0d084970b1cadaa3f14009e40ea015ce28c45806b91aa354b03a900a28c95b277b640e29874895ffa1439cca4bbd5e9616e95b5
|
data/lib/terminal/table/cell.rb
CHANGED
data/lib/terminal/table/table.rb
CHANGED
@@ -2,13 +2,14 @@ module Terminal
|
|
2
2
|
class Table
|
3
3
|
private
|
4
4
|
|
5
|
-
|
5
|
+
undef :recalc_column_widths
|
6
|
+
def recalc_column_widths(row)
|
6
7
|
return if row.is_a? Separator
|
7
8
|
i = 0
|
8
9
|
row.cells.each do |cell|
|
9
10
|
colspan = cell.colspan
|
10
11
|
cell_value = cell.value_for_column_width_recalc
|
11
|
-
colspan.downto(1) do |
|
12
|
+
colspan.downto(1) do |_j|
|
12
13
|
# cell_length = cell_value.to_s.length
|
13
14
|
cell_length = cell_value.to_s.display_width
|
14
15
|
if colspan > 1
|
@@ -19,7 +20,7 @@ module Terminal
|
|
19
20
|
if @column_widths[i].to_i < cell_length
|
20
21
|
@column_widths[i] = cell_length
|
21
22
|
end
|
22
|
-
i
|
23
|
+
i += 1
|
23
24
|
end
|
24
25
|
end
|
25
26
|
end
|