table-formatter 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/lib/table-formatter.rb +9 -3
- metadata +47 -24
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 74a3f94f4924214594eb602953443dbe5adc068c9e768cb58825dd2a6144bbaa
|
4
|
+
data.tar.gz: 9a7a70379585a2889d1ce10e7ca0d86d242041da7b37650a534328a01f01d925
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a40c99b50a6fd999e3d81123048cf43b5103dbf43bc25582c013b64015d71f97970e7daeb6f7d3ace478566328640d2b6518cbd1ae036995e710aaece47bd4e
|
7
|
+
data.tar.gz: d7b600474bf1cae60ae05788f903dd23a06fe91fe6ac0afc16ca2f85610a170531a25520c7bbcb51225e73a68b25cc334bbf29558a5d42c7881d1e0f9bc46c8a
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/table-formatter.rb
CHANGED
@@ -2,10 +2,11 @@
|
|
2
2
|
|
3
3
|
# file: table-formatter.rb
|
4
4
|
|
5
|
+
require 'c32'
|
5
6
|
require 'rdiscount'
|
6
7
|
|
7
|
-
|
8
8
|
class TableFormatter
|
9
|
+
using ColouredText
|
9
10
|
|
10
11
|
attr_accessor :source, :labels, :border, :divider, :markdown, :col_justify
|
11
12
|
|
@@ -50,6 +51,8 @@ class TableFormatter
|
|
50
51
|
def display(width=nil, widths: nil, markdown: @markdown)
|
51
52
|
|
52
53
|
@align_cols = []
|
54
|
+
@labels ||= [''] * @source.first.length
|
55
|
+
|
53
56
|
if @labels then
|
54
57
|
|
55
58
|
labels = []
|
@@ -93,7 +96,7 @@ class TableFormatter
|
|
93
96
|
|
94
97
|
private
|
95
98
|
|
96
|
-
def display_markdown(a, fields)
|
99
|
+
def display_markdown(a, fields)
|
97
100
|
|
98
101
|
print_row = -> (row, widths) do
|
99
102
|
'| ' + row.map\
|
@@ -154,8 +157,11 @@ class TableFormatter
|
|
154
157
|
end
|
155
158
|
end
|
156
159
|
|
157
|
-
|
160
|
+
puts ('fields: ' + fields.inspect).debug if @debug
|
161
|
+
if fields then
|
162
|
+
widths = ([(fields + ['']).take(a.first.length)] +
|
158
163
|
vals).transpose.map{|x| x.max_by(&:length).length}
|
164
|
+
end
|
159
165
|
|
160
166
|
th = if @labels then
|
161
167
|
print_row.call(fields, widths)
|
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
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -10,29 +10,53 @@ bindir: bin
|
|
10
10
|
cert_chain:
|
11
11
|
- |
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
13
|
+
MIIEXjCCAsagAwIBAgIBATANBgkqhkiG9w0BAQsFADAsMSowKAYDVQQDDCFnZW1t
|
14
|
+
YXN0ZXIvREM9amFtZXNyb2JlcnRzb24vREM9ZXUwHhcNMTkwMzExMTIxMzQ5WhcN
|
15
|
+
MjAwMzEwMTIxMzQ5WjAsMSowKAYDVQQDDCFnZW1tYXN0ZXIvREM9amFtZXNyb2Jl
|
16
|
+
cnRzb24vREM9ZXUwggGiMA0GCSqGSIb3DQEB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
+
sg80q+dyu649lDpg3KSinPeFURRgFyIY+vAHxoF85B33VhpYVQR8r5Al7PP8mah8
|
32
|
+
skPnJdq3FvFUw2YJuGjbsi/pD+om/OHtGE6ZycdcZZBr4n4vIp5saPycpsO1RaUL
|
33
|
+
wuVLs4gkq9womUiIBbNyBluMBs34CanhXhCB79bQj/UpSlvCDoGdIA+omItAz352
|
34
|
+
fCRiTnWWk4ZZq9afsY6r031JMXPBRRmajSvijwh9/vzO3Kir/Vg0fHls+3aM0vX4
|
35
|
+
QkN6g5cVjI7UG/Nt/FtwczGA26N85iGdqVPWE9AHT1oVUQiw3i2nwT9+5ZV0gQ+J
|
36
|
+
N57xZmcfbl5HIXM+VKr8LbZg
|
33
37
|
-----END CERTIFICATE-----
|
34
|
-
date:
|
38
|
+
date: 2019-03-11 00:00:00.000000000 Z
|
35
39
|
dependencies:
|
40
|
+
- !ruby/object:Gem::Dependency
|
41
|
+
name: c32
|
42
|
+
requirement: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - "~>"
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0.1'
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 0.1.2
|
50
|
+
type: :runtime
|
51
|
+
prerelease: false
|
52
|
+
version_requirements: !ruby/object:Gem::Requirement
|
53
|
+
requirements:
|
54
|
+
- - "~>"
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: '0.1'
|
57
|
+
- - ">="
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: 0.1.2
|
36
60
|
- !ruby/object:Gem::Dependency
|
37
61
|
name: rdiscount
|
38
62
|
requirement: !ruby/object:Gem::Requirement
|
@@ -79,8 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
79
103
|
- !ruby/object:Gem::Version
|
80
104
|
version: '0'
|
81
105
|
requirements: []
|
82
|
-
|
83
|
-
rubygems_version: 2.6.13
|
106
|
+
rubygems_version: 3.0.1
|
84
107
|
signing_key:
|
85
108
|
specification_version: 4
|
86
109
|
summary: table-formatter prints a table in plain text format or Markdown format from
|
metadata.gz.sig
CHANGED
Binary file
|