rgviz 0.24 → 0.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. data/lib/rgviz/html_renderer.rb +13 -13
  2. data/lib/rgviz.rb +1 -0
  3. metadata +3 -3
@@ -1,29 +1,29 @@
1
1
  module Rgviz
2
2
  module HtmlRenderer
3
3
  def self.render(table)
4
- @string = "<html>\n"
5
- @string += "<body>\n"
6
- @string += "<table border=\"1\" cellpadding=\"2\" cellspacing=\"0\">\n"
4
+ string = "<html>\n"
5
+ string << "<body>\n"
6
+ string << "<table border=\"1\" cellpadding=\"2\" cellspacing=\"0\">\n"
7
7
 
8
- @string += "<tr style=\"font-weight: bold; background-color: #aaa;\">\n"
8
+ string << "<tr style=\"font-weight: bold; background-color: #aaa;\">\n"
9
9
  table.cols.each do |row|
10
- @string += "<td>#{row.label}</td>\n"
10
+ string << "<td>#{row.label}</td>\n"
11
11
  end
12
- @string += "<tr>\n"
12
+ string << "<tr>\n"
13
13
 
14
14
  table.rows.each_with_index do |row, i|
15
15
  color = i % 2 == 0 ? '#f0f0f0' : '#ffffff'
16
- @string += "<tr style=\"background-color: #{color}\">\n"
16
+ string << "<tr style=\"background-color: #{color}\">\n"
17
17
  row.c.each do |col|
18
- @string += "<td>#{col.f || col.v}</td>\n"
18
+ string << "<td>#{col.f || col.v}</td>\n"
19
19
  end
20
- @string += "<tr>\n"
20
+ string << "<tr>\n"
21
21
  end
22
22
 
23
- @string += "</table>\n"
24
- @string += "</body>\n"
25
- @string += "</html>\n"
26
- @string
23
+ string << "</table>\n"
24
+ string << "</body>\n"
25
+ string << "</html>\n"
26
+ string
27
27
  end
28
28
  end
29
29
  end
data/lib/rgviz.rb CHANGED
@@ -4,6 +4,7 @@ require File.dirname(__FILE__) + '/rgviz/parser'
4
4
  require File.dirname(__FILE__) + '/rgviz/nodes'
5
5
  require File.dirname(__FILE__) + '/rgviz/visitor'
6
6
  require File.dirname(__FILE__) + '/rgviz/table'
7
+ require File.dirname(__FILE__) + '/rgviz/csv_renderer'
7
8
  require File.dirname(__FILE__) + '/rgviz/html_renderer'
8
9
 
9
10
  class ParseException < Exception
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rgviz
3
3
  version: !ruby/object:Gem::Version
4
- hash: 59
4
+ hash: 57
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 24
9
- version: "0.24"
8
+ - 25
9
+ version: "0.25"
10
10
  platform: ruby
11
11
  authors:
12
12
  - Ary Borenszweig