table-formatter 0.1.8 → 0.1.9

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: f189f28298623d39cbc5dfe7472e6e1b0004d74a
4
- data.tar.gz: d1b8388ef949406c43c754c3f28ece615927f0b4
3
+ metadata.gz: 55d7d117511c03581216fed4ed7b730af3dc2735
4
+ data.tar.gz: b11665ac25129a1a455bce648b330ea715dedfdd
5
5
  SHA512:
6
- metadata.gz: 5d9bdb0fa2d4bc236616f71dd5c773b43a375d83d0eaa890ec3df8a74539325205b7cb3ff565f5be2c4ebd0c308626cdc9bd396650679bea2471da820f8714d9
7
- data.tar.gz: 7542f4ed68995942f3b16501dc88b696fbcea78551c51ad22982175acbd28eab0611ddd8e3d602b63301d2e8aea70b42fff0ae2eb31de5ebb0f32edacfd97038
6
+ metadata.gz: d1f349c1b04c4eaf618b486d464d1bfdd48af3200a5d66403458700305ea1a1156024684db35daa230fd1eb2df468b241f4f253fdf98ed39b4f433d08351e049
7
+ data.tar.gz: 48a4e9f34f2f5ba660ed19703c7f5f90c3fb3ce598886f05f0d4ae8869affba15bbbf164cb289d130dc453be6c29a5a40e24cbd7bd1c717b89f11274c95e6a25
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -71,17 +71,18 @@ class TableFormatter
71
71
  end
72
72
 
73
73
  def format_cols(row, col_widths)
74
+
74
75
  bar = ''
75
76
  bar = '|' if border == true
76
- bar = divider if divider
77
77
 
78
- buffer = divider ? '' : bar #unless divider
78
+ buffer = bar
79
+
79
80
  row.each_with_index do |col, i|
80
81
 
81
82
  align = @align_cols ? @align_cols[i] : :ljust
82
83
  buffer += col.method(align).call(col_widths[i] + 2) + bar
83
84
  end
84
- buffer.sub!(/#{bar}$/,'') if divider
85
+
85
86
  buffer
86
87
  end
87
88
 
@@ -99,7 +100,13 @@ class TableFormatter
99
100
  end
100
101
  end
101
102
 
102
- a.map {|row| format_cols(row, col_widths)}
103
+ a.map do |row|
104
+ if divider then
105
+ row.join(divider)
106
+ else
107
+ format_cols(row, col_widths)
108
+ end
109
+ end
103
110
  end
104
111
 
105
112
  def just(x)
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.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -29,7 +29,7 @@ cert_chain:
29
29
  87MJlDPDYzp5yHAWkCW+L5wNO0Z0kdkibE/RZ9yGgZ7rSPRUUBqwsxNfwvyVh8Gl
30
30
  Ld73E8JjE0JpECfuT5M6ch5PUBtf1txl
31
31
  -----END CERTIFICATE-----
32
- date: 2013-10-24 00:00:00.000000000 Z
32
+ date: 2014-01-05 00:00:00.000000000 Z
33
33
  dependencies: []
34
34
  description:
35
35
  email: james@r0bertson.co.uk
@@ -58,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
58
  version: '0'
59
59
  requirements: []
60
60
  rubyforge_project:
61
- rubygems_version: 2.0.0.rc.2
61
+ rubygems_version: 2.1.11
62
62
  signing_key:
63
63
  specification_version: 4
64
64
  summary: table-formatter prints a table in plain text format from an array
metadata.gz.sig CHANGED
Binary file