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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/table-formatter.rb +11 -4
- metadata +3 -3
- 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: 55d7d117511c03581216fed4ed7b730af3dc2735
|
4
|
+
data.tar.gz: b11665ac25129a1a455bce648b330ea715dedfdd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d1f349c1b04c4eaf618b486d464d1bfdd48af3200a5d66403458700305ea1a1156024684db35daa230fd1eb2df468b241f4f253fdf98ed39b4f433d08351e049
|
7
|
+
data.tar.gz: 48a4e9f34f2f5ba660ed19703c7f5f90c3fb3ce598886f05f0d4ae8869affba15bbbf164cb289d130dc453be6c29a5a40e24cbd7bd1c717b89f11274c95e6a25
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/table-formatter.rb
CHANGED
@@ -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 =
|
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
|
-
|
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
|
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.
|
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:
|
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.
|
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
|