tablesmith 0.4.0 → 0.4.1

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
2
  SHA1:
3
- metadata.gz: 96ab0a18c776e80aa103908884db53eb98cf7a89
4
- data.tar.gz: a645ccf65e779cd8b5311b7bd6429d3a48ea752d
3
+ metadata.gz: e676306e2580d63feec58ebd3c104c7b278f5fae
4
+ data.tar.gz: 7f2ab47bbdaf6f57bbfec225a82ef9bf9b8263f3
5
5
  SHA512:
6
- metadata.gz: 8e1d90632da2e260c393346d9a4a230dc747bdf1820ab3a95243efd612ad14f6578ba0ae6062300d1685f3dc811617d5c65eaa0e93caca67c37ad7739570985f
7
- data.tar.gz: 5162cfc4edc75df6c4019333a87ecd3b867f57f923b9b13cd96b7c6952880cd4202c01cce5a2e145e697eaaec5e3a94c9e31aa5f49ab774dcac8bd64149e781d
6
+ metadata.gz: 4e597fb0ce8ff13bb8861ad85f5e7e649e5c4c9eece9a815c3f1772db569bf656183b5db31b4aa7e74e507833c076865f341638172ea03cdf80d0882e1931471
7
+ data.tar.gz: 7948c55b4079002e3c48752cf4fa1ddb0ce3dfb8a925430808738925061898b2e74866eb5f0e35a5c4c5549902e61cb80faa4564fbcff9f417b2abbbb570e94b
@@ -21,34 +21,31 @@ class HtmlFormatter
21
21
 
22
22
  def append_table_head
23
23
  @lines << "#{indent}<thead>"
24
- @lines << "#{indent}<tr>"
25
24
  unless @table.empty?
26
25
  rows = @table.text_table.rows[0..0]
27
26
  append_rows(rows, 'th')
28
27
  end
29
- @lines << "#{indent}</tr>"
30
28
  @lines << "#{indent}</thead>"
31
29
  end
32
30
 
33
31
  def append_table_body
34
32
  @lines << "#{indent}<tbody>"
35
- @lines << "#{indent}<tr>"
36
-
37
33
  unless @table.empty?
38
34
  rows = @table.text_table.rows[2..-1]
39
35
  append_rows(rows, 'td')
40
36
  end
41
- @lines << "#{indent}</tr>"
42
37
  @lines << "#{indent}</tbody>"
43
38
  end
44
39
 
45
40
  def append_rows(rows, tag)
46
41
  rows.each do |row|
47
42
  next if row == :separator
43
+ @lines << "#{indent}<tr>"
48
44
  row.map do |cell|
49
45
  value = cell_value(cell)
50
46
  @lines << "#{indent}#{indent}<#{tag}>#{value}</#{tag}>"
51
47
  end
48
+ @lines << "#{indent}</tr>"
52
49
  end
53
50
  end
54
51
 
@@ -1,3 +1,3 @@
1
1
  module Tablesmith
2
- VERSION = '0.4.0'.freeze
2
+ VERSION = '0.4.1'.freeze
3
3
  end
data/spec/table_spec.rb CHANGED
@@ -54,7 +54,7 @@ describe Table do
54
54
  end
55
55
 
56
56
  it 'should output html' do
57
- actual = [%w[a b c], %w[d e f]]
57
+ actual = [%w[a b c], %w[d e f], %w[g h i]]
58
58
  expected = <<~TABLE
59
59
  <table>
60
60
  <thead>
@@ -70,6 +70,11 @@ describe Table do
70
70
  <td>e</td>
71
71
  <td>f</td>
72
72
  </tr>
73
+ <tr>
74
+ <td>g</td>
75
+ <td>h</td>
76
+ <td>i</td>
77
+ </tr>
73
78
  </tbody>
74
79
  </table>
75
80
  TABLE
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tablesmith
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - chrismo