table-formatter 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f6a98e686c8d03b85eb0ba220988a354cd432e3
4
- data.tar.gz: 98ec59477c8a5c39fbd879533f2eb4750335fb94
3
+ metadata.gz: 03a4c83a58f33e614548562f0343f2fe5274718b
4
+ data.tar.gz: 5f92da132883f92fb39d3397a6a975fd28fd7a88
5
5
  SHA512:
6
- metadata.gz: ad30b923559dd72717a87ec8451a1f3959fd78c851b9e1ef132efc21192bf9f1c47ab07e4ce1c3af653360952dad38b17e430f57db29d624d2d238c79a9238a3
7
- data.tar.gz: 1c63d521280423e4b66f91b7eb4d37f4ad0f29be0ade538c117466015be1a7deecafd02a937b4d03d23b5a97c77ce4fbed32fd45ae1616db777ccb4ec9e19698
6
+ metadata.gz: 05d9086ee08f11fbbea30d348d1e444f24df3ced4586ff34acdd951693e99ee653f617028548b0d5ae96dd2821e3f99a69a024035d55be8dbdb50ac83f3608ff
7
+ data.tar.gz: 1ab0a258255809694fb233386da7c5222f30956da2544c27a819a7a4030ad56c6a289f413dd0d4017958a4ed18bd0bded992620c404490663db6ac15144cbe50
Binary file
data.tar.gz.sig CHANGED
@@ -1,4 +1,3 @@
1
- h/�6}�D4ag���d��R���FMyď��X��>ڠ�$b�a�\C��GƘ �O&)b�R���S���
2
- )Y1'���\�D��\�kS.Ie+�r o�����$�Y�x�@@�J�i��adi� �9�;��/'n�E�j ���hq3әG�����m��o}i"ᄌn_��� Q={Ȉ�OC�n�������O�����Up����(.;G�
3
-
4
- �-�sL53���
1
+ O|V�@�Df�C��x��j^t5o�� e��Ma������4I����J��z��w#6���_����`�Eh�^u��Q.����lm.����
2
+ 0�r����J��ҙ��Ԛ�����?8���/єDZl~�8x i
3
+ ��̱�f`�� qMT�D����8}u��A�۪�I�X��*�xV��K�;�{�
@@ -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
- @align_cols, labels = [], []
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.0
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: 2016-11-07 00:00:00.000000000 Z
34
+ date: 2017-01-04 00:00:00.000000000 Z
35
35
  dependencies: []
36
36
  description:
37
- email: james@r0bertson.co.uk
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.5.1
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