markdown-tables 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/markdown-tables.rb +3 -3
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5f9a4a8a0af1a3674057900b23c880cd290a41f9221d396f4bf9938a4fc1ec56
|
4
|
+
data.tar.gz: 42111e3deed6d67e98514cbd1cda671c7e20beaa31a1cf55438070cb2f38f35d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b1a76e5fcdc1e030251ca13e164ec79d6ffde0573156693f1211b469f9522b497bdec24bced8cb2b927df7800d8bd7c05224aaec3d11ddd7c9cca1e4566c23b
|
7
|
+
data.tar.gz: 81880eec0b6c8d4f3595074aaa6d36c741c722323131a27d2eed68cfc1f64fa555257338924c09cfa04eaaeea424f8da0a6f30d953a32b74a034bd3efbada1c6
|
data/lib/markdown-tables.rb
CHANGED
@@ -25,7 +25,7 @@ class MarkdownTables
|
|
25
25
|
align.map! {|a| a =~ /[lr]/i ? a.downcase : 'c'}
|
26
26
|
|
27
27
|
# Generate the column labels and alignment line.
|
28
|
-
header_line = labels.join('|')
|
28
|
+
header_line = labels.join('|').prepend('|') << '|'
|
29
29
|
alignment_line = parse_alignment(align, labels.length)
|
30
30
|
|
31
31
|
# Pad the data arrays so that it can be transposed if necessary.
|
@@ -33,7 +33,7 @@ class MarkdownTables
|
|
33
33
|
data.map! {|datum| fill(datum, max_len)}
|
34
34
|
|
35
35
|
# Generate the table rows.
|
36
|
-
rows = (is_rows ? data : data.transpose).map {|row| row.join('|')}
|
36
|
+
rows = (is_rows ? data : data.transpose).map {|row| row.join('|').prepend('|') << '|' }
|
37
37
|
|
38
38
|
return [header_line, alignment_line, rows.join("\n")].join("\n")
|
39
39
|
end
|
@@ -131,7 +131,7 @@ class MarkdownTables
|
|
131
131
|
alignments = align.map {|a| align_map[a]}
|
132
132
|
# If not enough values were given, center the remaining columns.
|
133
133
|
alignments.length < n && alignments += [':-:'] * (n - alignments.length)
|
134
|
-
return alignments.join('|')
|
134
|
+
return alignments.join('|').prepend('|') << '|'
|
135
135
|
end
|
136
136
|
|
137
137
|
# Align some text in a cell.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: markdown-tables
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris de Graaf
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: chrisadegraaf@gmail.com
|
@@ -36,8 +36,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
36
36
|
- !ruby/object:Gem::Version
|
37
37
|
version: '0'
|
38
38
|
requirements: []
|
39
|
-
|
40
|
-
rubygems_version: 2.7.6
|
39
|
+
rubygems_version: 3.0.3
|
41
40
|
signing_key:
|
42
41
|
specification_version: 4
|
43
42
|
summary: Utilities for creating and displaying Markdown tables in Ruby
|