table-formatter 0.4.0 → 0.4.1
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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +3 -4
- data/lib/table-formatter.rb +5 -5
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03a4c83a58f33e614548562f0343f2fe5274718b
|
4
|
+
data.tar.gz: 5f92da132883f92fb39d3397a6a975fd28fd7a88
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05d9086ee08f11fbbea30d348d1e444f24df3ced4586ff34acdd951693e99ee653f617028548b0d5ae96dd2821e3f99a69a024035d55be8dbdb50ac83f3608ff
|
7
|
+
data.tar.gz: 1ab0a258255809694fb233386da7c5222f30956da2544c27a819a7a4030ad56c6a289f413dd0d4017958a4ed18bd0bded992620c404490663db6ac15144cbe50
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
|
-
�
|
3
|
-
�
|
4
|
-
�-�sL53���
|
1
|
+
O|V�@�Df�C��x��j^t�5o�� e��Ma������4�I����J��z��w#6���_����`�Eh�^u��Q.����lm.����
|
2
|
+
0�r����J��ҙ��Ԛ�����?8���/єDZl~�8�x i
|
3
|
+
��̱�f`�� �qMT�D����8}u��A�۪�I�X��*�xV��K�;�{�
|
data/lib/table-formatter.rb
CHANGED
@@ -44,19 +44,19 @@ class TableFormatter
|
|
44
44
|
|
45
45
|
def display(width=nil, widths: nil, markdown: @markdown)
|
46
46
|
|
47
|
+
@align_cols = []
|
47
48
|
if @labels then
|
48
49
|
|
49
|
-
|
50
|
+
labels = []
|
50
51
|
|
51
52
|
@labels.each do |raw_label|
|
52
|
-
|
53
53
|
col_just, label = just(raw_label)
|
54
54
|
@align_cols << col_just
|
55
55
|
labels << label
|
56
56
|
end
|
57
57
|
|
58
58
|
end
|
59
|
-
|
59
|
+
|
60
60
|
@col_justify = @align_cols.map do |col|
|
61
61
|
{ljust: :l, rjust: :r, center: :c}[col]
|
62
62
|
end
|
@@ -127,7 +127,7 @@ class TableFormatter
|
|
127
127
|
end
|
128
128
|
|
129
129
|
def format_cols(row, col_widths, bar='')
|
130
|
-
|
130
|
+
|
131
131
|
outer_bar, inner_spacer = '', ''
|
132
132
|
(outer_bar = bar = '|'; inner_spacer = ' ') if border == true
|
133
133
|
col_spacer = @divider ? 0 : 2
|
@@ -137,7 +137,7 @@ class TableFormatter
|
|
137
137
|
|
138
138
|
row.each_with_index do |col, i|
|
139
139
|
|
140
|
-
align = @align_cols ? @align_cols[i] : :ljust
|
140
|
+
align = @align_cols.any? ? @align_cols[i] : :ljust
|
141
141
|
|
142
142
|
val, next_bar = if (i < row.length - 1 || border) then
|
143
143
|
[col.method(align).call(col_widths[i] + col_spacer), bar]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: table-formatter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -31,10 +31,10 @@ cert_chain:
|
|
31
31
|
3N7fAlUbFYq1qPg9cSfZni7dwYupZfs1vLjUbKCYyF3LGUR1jnLn4hkP1lFClWwy
|
32
32
|
wGnSddXdhZVZSQ==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
34
|
+
date: 2017-01-04 00:00:00.000000000 Z
|
35
35
|
dependencies: []
|
36
36
|
description:
|
37
|
-
email: james@
|
37
|
+
email: james@jamesrobertson.eu
|
38
38
|
executables: []
|
39
39
|
extensions: []
|
40
40
|
extra_rdoc_files: []
|
@@ -60,7 +60,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
60
60
|
version: '0'
|
61
61
|
requirements: []
|
62
62
|
rubyforge_project:
|
63
|
-
rubygems_version: 2.
|
63
|
+
rubygems_version: 2.6.8
|
64
64
|
signing_key:
|
65
65
|
specification_version: 4
|
66
66
|
summary: table-formatter prints a table in plain text format or Markdown format from
|
metadata.gz.sig
CHANGED
Binary file
|