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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/markdown-tables.rb +3 -3
  3. metadata +3 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 32106fcf23ba3591f4330de1e9a6e1f4b45712371c23719a975a513fe1cd1940
4
- data.tar.gz: 6a4199314024cf80d5babf546e6057118b56198eab7f634f7fe84730b4cc5efb
3
+ metadata.gz: 5f9a4a8a0af1a3674057900b23c880cd290a41f9221d396f4bf9938a4fc1ec56
4
+ data.tar.gz: 42111e3deed6d67e98514cbd1cda671c7e20beaa31a1cf55438070cb2f38f35d
5
5
  SHA512:
6
- metadata.gz: a0bb9614c538cb22d194ab93f224d33becc20187fd93d490827e5f9180e89031f88b435b491716e13cbdda51366f7d49bd856cd31939c24ab34cac822332dd48
7
- data.tar.gz: 30d151838b13904c1528eca4bde980e8bad49cf58f90d0c1e208cbbd9a5801c2e4ebc67c5754a8a3ec9381b80a2b9793252e8887e47f4647177b2a661fabac06
6
+ metadata.gz: 2b1a76e5fcdc1e030251ca13e164ec79d6ffde0573156693f1211b469f9522b497bdec24bced8cb2b927df7800d8bd7c05224aaec3d11ddd7c9cca1e4566c23b
7
+ data.tar.gz: 81880eec0b6c8d4f3595074aaa6d36c741c722323131a27d2eed68cfc1f64fa555257338924c09cfa04eaaeea424f8da0a6f30d953a32b74a034bd3efbada1c6
@@ -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.2
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: 2018-06-10 00:00:00.000000000 Z
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
- rubyforge_project:
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