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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: d8938d067b2f19935a1bb9d11a4fe5c563415fc2
4
- data.tar.gz: 8746fc35347518325a855234973096384e4aed4e
2
+ SHA256:
3
+ metadata.gz: 74a3f94f4924214594eb602953443dbe5adc068c9e768cb58825dd2a6144bbaa
4
+ data.tar.gz: 9a7a70379585a2889d1ce10e7ca0d86d242041da7b37650a534328a01f01d925
5
5
  SHA512:
6
- metadata.gz: cd992b5a66bfe5e7c9637a31a828b5017fac34ca1025449cb12e64207d3cac80567c5d53cd5f9248d15d5a4108239feda977217a35cccbf6b6553376beecd30f
7
- data.tar.gz: d1b6e130f0d119c7b64e08a9af7013e2675cbb60f9f855d4386ea39e6eb870d676767225809e78813f85da011febcc10a6e4063e14209fdda709cf55096d3546
6
+ metadata.gz: 6a40c99b50a6fd999e3d81123048cf43b5103dbf43bc25582c013b64015d71f97970e7daeb6f7d3ace478566328640d2b6518cbd1ae036995e710aaece47bd4e
7
+ data.tar.gz: d7b600474bf1cae60ae05788f903dd23a06fe91fe6ac0afc16ca2f85610a170531a25520c7bbcb51225e73a68b25cc334bbf29558a5d42c7881d1e0f9bc46c8a
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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
- widths = ([(fields + ['']).take(a.first.length)] +
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.5.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
- MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
14
- YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
15
- 8ixkARkWAmV1MB4XDTE3MDkwNjExNTY0OFoXDTE4MDkwNjExNTY0OFowSDESMBAG
16
- A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
- EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
- ggEBANMzRKAQ4QqtTKx2TzuG01Qkl29pye6ODCkt934jWLMI8jiWZf6UIbvi4kz4
19
- KAq6XX4wGdR0q2K11csEDH1HtNXBma57f5Y3utj3KJ/KPOit8nAv2DrRiQHcuQuk
20
- d7N1dL1u1aK6yirKoNYpqkoYrYWxjCmWBxWPcqy5cCaijUqgg5++a4e1RZD+jDzB
21
- u4m1guS3MR4Jw8XObIRudqHUDuSYRA1lERa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bNyBluMBs34CanhXhCB79bQj/UpSlvCDoGdIA+omItAz352
34
+ fCRiTnWWk4ZZq9afsY6r031JMXPBRRmajSvijwh9/vzO3Kir/Vg0fHls+3aM0vX4
35
+ QkN6g5cVjI7UG/Nt/FtwczGA26N85iGdqVPWE9AHT1oVUQiw3i2nwT9+5ZV0gQ+J
36
+ N57xZmcfbl5HIXM+VKr8LbZg
33
37
  -----END CERTIFICATE-----
34
- date: 2018-03-06 00:00:00.000000000 Z
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
- rubyforge_project:
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