st_html_table 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE.txt +21 -0
- data/README.md +20 -0
- data/lib/st_html_table.rb +12 -0
- data/lib/st_html_table/cell.rb +76 -0
- data/lib/st_html_table/row.rb +124 -0
- data/lib/st_html_table/table.rb +89 -0
- data/lib/st_html_table/version.rb +3 -0
- data/test/cell_lib_spec.rb +58 -0
- data/test/table_lib_spec.rb +39 -0
- data/test/test.html +70 -0
- metadata +87 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 9e8c0354612db1e00143ffc4adf6b6371a5760ae
|
4
|
+
data.tar.gz: 468dd0fb9f9aa78950afe172f5fffed7760b8ac1
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 39c5ef3a76ff3306952564764f18dc91596d2a8f53d252a5d08f044c47e2ac38c7ac242c85de16b1fda9c33e696207ca1c1703b6346cbd69c95e71429b630fa6
|
7
|
+
data.tar.gz: ba7a3ea3fded9d6484d44b20775c7cc850e62385d65643163b4ed4eb0165ced33b565d0ed2560153b18ee89c74496d444b8aa113514f75f45efb580878ec3670
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Stan Zhuravlev
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# StHtmlTable
|
2
|
+
|
3
|
+
Библиотека StHtmlTable позволяет формировать красиво форматированные таблицы в формате HTML, например,
|
4
|
+
для передаче по электроннйо почты. Библиотека предназначена для использования в составе различных CLI-скриптов,
|
5
|
+
в частности, в составе библиотеки [cli_application](https://github.com/StanZhuravlev/cli_application).
|
6
|
+
|
7
|
+
Библиотека имеет ограниченные возможности по созданию таблиц, поскольку ее изначальная цель - отсылка админстраторам
|
8
|
+
писем с различными статусами. Поэтому вся таблица имеет несколько вариантов оформления строк. В частности:
|
9
|
+
|
10
|
+
|Тип строки|Значение|
|
11
|
+
-----
|
12
|
+
|:success|Черный текст на бледно-зеленом фоне|
|
13
|
+
|:fail|Черный текст на бледно-крансом фоне|
|
14
|
+
|:warn|Черный текст на желтом фоне|
|
15
|
+
|:neutral|Черный текст на сером фоне|
|
16
|
+
|
17
|
+
Тип строки задается для каждой строки таблицы.
|
18
|
+
|
19
|
+
## Создание таблицы
|
20
|
+
|
@@ -0,0 +1,76 @@
|
|
1
|
+
module StHtmlTable
|
2
|
+
class Cell
|
3
|
+
attr_accessor :text
|
4
|
+
attr_reader :row
|
5
|
+
attr_reader :table
|
6
|
+
attr_accessor :is_header
|
7
|
+
attr_accessor :cols
|
8
|
+
attr_accessor :col_id
|
9
|
+
attr_accessor :row_id
|
10
|
+
attr_accessor :bold
|
11
|
+
attr_accessor :italic
|
12
|
+
attr_accessor :align
|
13
|
+
attr_accessor :valign
|
14
|
+
attr_accessor :type
|
15
|
+
|
16
|
+
def initialize(table, row)
|
17
|
+
@text = ' '
|
18
|
+
@row = row
|
19
|
+
@table = table
|
20
|
+
@is_header = false
|
21
|
+
@cols = 1
|
22
|
+
@col_id = 0
|
23
|
+
@row_id = 0
|
24
|
+
@type = :neutral
|
25
|
+
@valign = :top
|
26
|
+
|
27
|
+
@bold = false
|
28
|
+
@italic = false
|
29
|
+
@align = :left
|
30
|
+
|
31
|
+
@ident = 6
|
32
|
+
end
|
33
|
+
|
34
|
+
def prefix=(value)
|
35
|
+
@prefix = value
|
36
|
+
end
|
37
|
+
|
38
|
+
def suffix=(value)
|
39
|
+
@suffix = value
|
40
|
+
end
|
41
|
+
|
42
|
+
def to_s
|
43
|
+
@text.gsub(%r{</?[^>]+?>}, '')
|
44
|
+
end
|
45
|
+
|
46
|
+
def to_html
|
47
|
+
type = @is_header ? 'th' : 'td'
|
48
|
+
|
49
|
+
out = Array.new
|
50
|
+
out << (' ' * @ident) + build_cell_arguments(type)
|
51
|
+
out << (' ' * (@ident + 2)) + @text.to_s
|
52
|
+
out << (' ' * @ident) + "</#{type}>"
|
53
|
+
out.join("\n")
|
54
|
+
end
|
55
|
+
|
56
|
+
private
|
57
|
+
|
58
|
+
|
59
|
+
def build_cell_arguments(type)
|
60
|
+
out = Array.new
|
61
|
+
style = Array.new
|
62
|
+
|
63
|
+
style << "font-weight:bold;" if @bold
|
64
|
+
style << "font-style:italic;" if @italic
|
65
|
+
style << "border: 1px solid #eaeaea;"
|
66
|
+
|
67
|
+
out << "align=#{@align.to_s.inspect}"
|
68
|
+
out << "valign=#{@valign.to_s.inspect}" if @valign != :top
|
69
|
+
out << "style='#{style.join}'" unless style.empty?
|
70
|
+
out << "cols=\"#{@cols}\"" if @cols != 1
|
71
|
+
"<#{type} " + out.join(' ') + ">"
|
72
|
+
end
|
73
|
+
|
74
|
+
|
75
|
+
end
|
76
|
+
end
|
@@ -0,0 +1,124 @@
|
|
1
|
+
module StHtmlTable
|
2
|
+
class Row
|
3
|
+
|
4
|
+
def initialize(table) # :nodoc:
|
5
|
+
@table = table
|
6
|
+
@cells = Hash.new
|
7
|
+
@id = :none
|
8
|
+
@type = :neutral
|
9
|
+
|
10
|
+
@ident = 4
|
11
|
+
end
|
12
|
+
|
13
|
+
# Метод позволяет установить для строки таблицы один из следующих стилей: [:neutral, :fail, :success, :warn]
|
14
|
+
#
|
15
|
+
# @param [Sym] value тип строки. При изменении типа строки, все ячейи строки таблицы получат эти же значения
|
16
|
+
# @return [None] нет
|
17
|
+
def type=(value)
|
18
|
+
types = [:neutral, :fail, :success, :warn]
|
19
|
+
raise "Ошибка: тип строки должен быть одним из: #{types.inspect}" unless types.include?(value.to_sym)
|
20
|
+
@type = value.to_sym
|
21
|
+
@cells.each { |id, cell| cell.type = @type }
|
22
|
+
end
|
23
|
+
|
24
|
+
# Метод добавляет или изменяет ячейку таблицы, устанавливая ее соедержание, выравнивание, стиль оформления
|
25
|
+
#
|
26
|
+
# @param [Object] col_id идентифкатор столбца таблицы
|
27
|
+
# @param [Object] text содержание ячейки
|
28
|
+
# @param [Object] align выравнивание [:left, :center, :right]
|
29
|
+
# @param [Object] bold жирное начертание
|
30
|
+
# @param [Object] italic наклонное начертание
|
31
|
+
# @return [StHtmlTable::Cell] измененная ячейка
|
32
|
+
def add(col_id, text, align: :left, bold: false, italic: false)
|
33
|
+
add_cell(col_id, text, align, bold, italic)
|
34
|
+
end
|
35
|
+
|
36
|
+
def get_cell(col_id)
|
37
|
+
@cells[col_id]
|
38
|
+
end
|
39
|
+
|
40
|
+
def row_keys
|
41
|
+
@cells.keys
|
42
|
+
end
|
43
|
+
|
44
|
+
def add_header(header)
|
45
|
+
header.each do |id, name|
|
46
|
+
cell = ::StHtmlTable::Cell.new(@table, self)
|
47
|
+
cell.col_id = id.to_sym
|
48
|
+
cell.row_id = self.id
|
49
|
+
cell.is_header = true
|
50
|
+
cell.text = name
|
51
|
+
cell.align = :center
|
52
|
+
cell.bold = true
|
53
|
+
|
54
|
+
@cells[id.to_sym] = cell
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def to_html
|
59
|
+
out = Array.new
|
60
|
+
out << (' ' * @ident) + "<tr #{build_color_scheme}>"
|
61
|
+
@cells.each do |id, cell|
|
62
|
+
out << cell.to_html
|
63
|
+
end
|
64
|
+
out << (' ' * @ident) + "</tr>"
|
65
|
+
out.join("\n")
|
66
|
+
end
|
67
|
+
|
68
|
+
def id=(id)
|
69
|
+
@id = id
|
70
|
+
end
|
71
|
+
|
72
|
+
def id
|
73
|
+
@id
|
74
|
+
end
|
75
|
+
|
76
|
+
def init_row # :nodoc:
|
77
|
+
keys = @table.row_keys
|
78
|
+
keys.each do |id|
|
79
|
+
cell = ::StHtmlTable::Cell.new(@table, self)
|
80
|
+
cell.col_id = id.to_sym
|
81
|
+
cell.row_id = self.id
|
82
|
+
cell.type = @type
|
83
|
+
|
84
|
+
@cells[id.to_sym] = cell
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
|
89
|
+
private
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
def build_color_scheme # :nodoc:
|
94
|
+
if @cells.values.first.is_header
|
95
|
+
return "style=\"color:#ffffff;background:#389bb9;\" valign=\"center\""
|
96
|
+
end
|
97
|
+
|
98
|
+
case @type
|
99
|
+
when :warn
|
100
|
+
return "bgcolor=\"efe685\""
|
101
|
+
when :success
|
102
|
+
return "bgcolor=\"#c4d7be\""
|
103
|
+
when :fail
|
104
|
+
return "bgcolor=\"#efbcbe\""
|
105
|
+
else
|
106
|
+
return "bgcolor=\"#e6e6e6\""
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
def add_cell(col_id, text, align, bold, italic) # :nodoc:
|
111
|
+
cell = get_cell(col_id)
|
112
|
+
raise "Ошибка: не найдена ячейка HTML-таблицы (#{col_id.inspect}, #{self.id.inspect})" if cell.nil?
|
113
|
+
|
114
|
+
cell.text = text
|
115
|
+
cell.align = align
|
116
|
+
cell.bold = bold
|
117
|
+
cell.italic = italic
|
118
|
+
|
119
|
+
cell
|
120
|
+
end
|
121
|
+
|
122
|
+
|
123
|
+
end
|
124
|
+
end
|
@@ -0,0 +1,89 @@
|
|
1
|
+
module StHtmlTable
|
2
|
+
class Table
|
3
|
+
|
4
|
+
def initialize # :nodoc:
|
5
|
+
init_table
|
6
|
+
end
|
7
|
+
|
8
|
+
# Метод создает таблицу с строкой-заголовком. Данный метод должен быть вызван первым, поскольку
|
9
|
+
# именно он определяет число столбцов в будущей таблице
|
10
|
+
#
|
11
|
+
# @param [Hash] header хеш вида column id => title of column
|
12
|
+
# @param [Integer] padding аналог cellpadding тега <table>
|
13
|
+
# @param [Integer] width ширина таблицы в процентах
|
14
|
+
# @return [None] нет
|
15
|
+
def create(header, padding: 5, width: 0)
|
16
|
+
init_table
|
17
|
+
@padding = padding
|
18
|
+
@width = width
|
19
|
+
init_header(header)
|
20
|
+
end
|
21
|
+
|
22
|
+
# Метод возвращает все идентифкаторы столбцов таблицы
|
23
|
+
#
|
24
|
+
# @return [Array] массив идентификаторов столбцов таблицы
|
25
|
+
def row_keys
|
26
|
+
@header.row_keys
|
27
|
+
end
|
28
|
+
|
29
|
+
# Метод возвращает ряд таблицы по идентификатору ряда. Если ряд с таким id отсуствует - он будет создан
|
30
|
+
#
|
31
|
+
# @param [Object] id идентфикатор строки
|
32
|
+
# @return [StHtmlTable::Row] класс со строкой (<tr>) таблицы
|
33
|
+
def get_row(id)
|
34
|
+
init_row(id) if @rows[id].nil?
|
35
|
+
@rows[id]
|
36
|
+
end
|
37
|
+
|
38
|
+
# Метод переводит таблицы в форматированный HTML
|
39
|
+
#
|
40
|
+
# @return [String] таблица в формате HTML
|
41
|
+
def to_html
|
42
|
+
out = Array.new
|
43
|
+
out << build_table_row
|
44
|
+
out << build_header_row
|
45
|
+
@rows.each do |row_id, row|
|
46
|
+
out << row.to_html
|
47
|
+
end
|
48
|
+
out << "</table>"
|
49
|
+
out.join("\n")
|
50
|
+
end
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
private
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
def init_header(header) # :nodoc:
|
59
|
+
@header = ::StHtmlTable::Row.new(self)
|
60
|
+
@header.id = :html_table_header
|
61
|
+
@header.add_header(header)
|
62
|
+
end
|
63
|
+
|
64
|
+
def build_header_row # :nodoc:
|
65
|
+
@header.to_html
|
66
|
+
end
|
67
|
+
|
68
|
+
def build_table_row # :nodoc:
|
69
|
+
out = Array.new
|
70
|
+
out << "table"
|
71
|
+
out << "cellpadding=\"#{@padding}px\""
|
72
|
+
out << "cellspacing=\"0\""
|
73
|
+
out << "style=\"border: 1px solid #eaeaea; border-collapse:collapse;\""
|
74
|
+
out << "width=\"#{@width}%\"" unless @width == 0
|
75
|
+
"<" + out.join(' ') + ">"
|
76
|
+
end
|
77
|
+
|
78
|
+
def init_row(row_id) # :nodoc:
|
79
|
+
@rows[row_id] = ::StHtmlTable::Row.new(self)
|
80
|
+
@rows[row_id].init_row
|
81
|
+
end
|
82
|
+
|
83
|
+
def init_table # :nodoc:
|
84
|
+
@rows = Hash.new
|
85
|
+
@header = Hash.new
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
89
|
+
end
|
@@ -0,0 +1,58 @@
|
|
1
|
+
require 'rspec'
|
2
|
+
require 'st_html_table'
|
3
|
+
|
4
|
+
|
5
|
+
describe 'Проверка методов StHtmlTable::Cell.*' do
|
6
|
+
|
7
|
+
it 'Test 1' do
|
8
|
+
cell = ::StHtmlTable::Cell.new(nil, nil)
|
9
|
+
cell.text = 'Content'
|
10
|
+
expect(cell.to_s).to eq 'Content'
|
11
|
+
expect(cell.to_html).to include 'Content'
|
12
|
+
expect(cell.to_html).to include '<td'
|
13
|
+
expect(cell.to_html).to include '/td>'
|
14
|
+
expect(cell.to_html).to_not include 'cols'
|
15
|
+
puts cell.to_html
|
16
|
+
end
|
17
|
+
|
18
|
+
it 'Test 2' do
|
19
|
+
cell = ::StHtmlTable::Cell.new(nil, nil)
|
20
|
+
cell.text = 'Content'
|
21
|
+
cell.cols = 2
|
22
|
+
expect(cell.to_s).to eq 'Content'
|
23
|
+
expect(cell.to_html).to include 'Content'
|
24
|
+
expect(cell.to_html).to include '<td'
|
25
|
+
expect(cell.to_html).to include 'cols'
|
26
|
+
expect(cell.to_html).to include '/td>'
|
27
|
+
puts cell.to_html
|
28
|
+
end
|
29
|
+
|
30
|
+
it 'Test 3' do
|
31
|
+
cell = ::StHtmlTable::Cell.new(nil, nil)
|
32
|
+
cell.text = 'Content'
|
33
|
+
cell.cols = 2
|
34
|
+
cell.td_style = 'class="cell_class_name"'
|
35
|
+
expect(cell.to_s).to eq 'Content'
|
36
|
+
expect(cell.to_html).to include 'Content'
|
37
|
+
expect(cell.to_html).to include '<td'
|
38
|
+
expect(cell.to_html).to include 'cols'
|
39
|
+
expect(cell.to_html).to include 'class'
|
40
|
+
expect(cell.to_html).to include '/td>'
|
41
|
+
puts cell.to_html
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'Test 4' do
|
45
|
+
cell = ::StHtmlTable::Cell.new(nil, nil)
|
46
|
+
cell.text = 'Content <b>bold</b>'
|
47
|
+
cell.cols = 2
|
48
|
+
cell.td_style = 'class="cell_class_name"'
|
49
|
+
expect(cell.to_s).to eq 'Content bold'
|
50
|
+
expect(cell.to_html).to include 'Content <b>bold</b>'
|
51
|
+
expect(cell.to_html).to include '<td'
|
52
|
+
expect(cell.to_html).to include 'cols'
|
53
|
+
expect(cell.to_html).to include 'class'
|
54
|
+
expect(cell.to_html).to include '/td>'
|
55
|
+
puts cell.to_html
|
56
|
+
end
|
57
|
+
|
58
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'rspec'
|
2
|
+
require 'st_html_table'
|
3
|
+
|
4
|
+
|
5
|
+
describe 'Проверка методов StHtmlTable::Cell.*' do
|
6
|
+
|
7
|
+
it 'Test 1' do
|
8
|
+
table = ::StHtmlTable::Table.new
|
9
|
+
table.create({id: 'id', url: 'URL', views: 'Views' }, padding: 3)
|
10
|
+
|
11
|
+
row = table.get_row(0)
|
12
|
+
row.type = :success
|
13
|
+
row.add(:id, 0, align: :right)
|
14
|
+
row.add(:url, "http://st-html-table.ru", align: :left, italic: true)
|
15
|
+
row.add(:views, 456, align: :center)
|
16
|
+
|
17
|
+
row = table.get_row(100)
|
18
|
+
row.type = :fail
|
19
|
+
row.add(:id, 100, align: :right)
|
20
|
+
row.add(:url, "http://big-url-of-st-html-table.ru", align: :left, italic: true)
|
21
|
+
row.add(:views, 6374637, align: :center)
|
22
|
+
|
23
|
+
row = table.get_row(200)
|
24
|
+
row.type = :neutral
|
25
|
+
row.add(:id, 200, align: :right)
|
26
|
+
row.add(:url, "http://big-st-html-table-200.ru", align: :left, italic: true)
|
27
|
+
row.add(:views, 63645, align: :center)
|
28
|
+
|
29
|
+
row = table.get_row(300)
|
30
|
+
row.type = :warn
|
31
|
+
row.add(:id, 300, align: :right)
|
32
|
+
row.add(:url, "http://big-st-html-table-300.ru", align: :left, italic: true)
|
33
|
+
row.add(:views, 343, align: :center)
|
34
|
+
|
35
|
+
|
36
|
+
puts table.to_html
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
data/test/test.html
ADDED
@@ -0,0 +1,70 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head lang="en">
|
4
|
+
<meta charset="UTF-8">
|
5
|
+
<title></title>
|
6
|
+
</head>
|
7
|
+
<body>
|
8
|
+
|
9
|
+
<table cellpadding="3px" cellspacing="0" style="border: 1px solid #eaeaea; border-collapse:collapse;">
|
10
|
+
<tr style="color:#ffffff;background:#389bb9;" valign="center">
|
11
|
+
<th align="center" style='font-weight:bold;border: 1px solid #eaeaea;'>
|
12
|
+
id
|
13
|
+
</th>
|
14
|
+
<th align="center" style='font-weight:bold;border: 1px solid #eaeaea;'>
|
15
|
+
URL
|
16
|
+
</th>
|
17
|
+
<th align="center" style='font-weight:bold;border: 1px solid #eaeaea;'>
|
18
|
+
Views
|
19
|
+
</th>
|
20
|
+
</tr>
|
21
|
+
<tr bgcolor="#c4d7be">
|
22
|
+
<td align="right" style='border: 1px solid #eaeaea;'>
|
23
|
+
0
|
24
|
+
</td>
|
25
|
+
<td align="left" style='font-style:italic;border: 1px solid #eaeaea;'>
|
26
|
+
http://st-html-table.ru
|
27
|
+
</td>
|
28
|
+
<td align="center" style='border: 1px solid #eaeaea;'>
|
29
|
+
456
|
30
|
+
</td>
|
31
|
+
</tr>
|
32
|
+
<tr bgcolor="#efbcbe">
|
33
|
+
<td align="right" style='border: 1px solid #eaeaea;'>
|
34
|
+
100
|
35
|
+
</td>
|
36
|
+
<td align="left" style='font-style:italic;border: 1px solid #eaeaea;'>
|
37
|
+
http://big-url-of-st-html-table.ru
|
38
|
+
</td>
|
39
|
+
<td align="center" style='border: 1px solid #eaeaea;'>
|
40
|
+
6374637
|
41
|
+
</td>
|
42
|
+
</tr>
|
43
|
+
<tr bgcolor="#e6e6e6">
|
44
|
+
<td align="right" style='border: 1px solid #eaeaea;'>
|
45
|
+
200
|
46
|
+
</td>
|
47
|
+
<td align="left" style='font-style:italic;border: 1px solid #eaeaea;'>
|
48
|
+
http://big-st-html-table-200.ru
|
49
|
+
</td>
|
50
|
+
<td align="center" style='border: 1px solid #eaeaea;'>
|
51
|
+
63645
|
52
|
+
</td>
|
53
|
+
</tr>
|
54
|
+
<tr bgcolor="efe685">
|
55
|
+
<td align="right" style='border: 1px solid #eaeaea;'>
|
56
|
+
300
|
57
|
+
</td>
|
58
|
+
<td align="left" style='font-style:italic;border: 1px solid #eaeaea;'>
|
59
|
+
http://big-st-html-table-300.ru
|
60
|
+
</td>
|
61
|
+
<td align="center" style='border: 1px solid #eaeaea;'>
|
62
|
+
343
|
63
|
+
</td>
|
64
|
+
</tr>
|
65
|
+
</table>
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
</body>
|
70
|
+
</html>
|
metadata
ADDED
@@ -0,0 +1,87 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: st_html_table
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- StanZhuravlev
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-06-11 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.9'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.9'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
description: |-
|
42
|
+
Библиотека позволяет формировать красиво форматированные таблицы в формате HTML, например,
|
43
|
+
для передаче по электроннйо почты. Библиотека предназначена для использования в составе различных CLI-скриптов,
|
44
|
+
в частности, в составе библиотеки cli_application
|
45
|
+
email:
|
46
|
+
- stan@post-api.ru
|
47
|
+
executables: []
|
48
|
+
extensions: []
|
49
|
+
extra_rdoc_files: []
|
50
|
+
files:
|
51
|
+
- LICENSE.txt
|
52
|
+
- README.md
|
53
|
+
- lib/st_html_table.rb
|
54
|
+
- lib/st_html_table/cell.rb
|
55
|
+
- lib/st_html_table/row.rb
|
56
|
+
- lib/st_html_table/table.rb
|
57
|
+
- lib/st_html_table/version.rb
|
58
|
+
- test/cell_lib_spec.rb
|
59
|
+
- test/table_lib_spec.rb
|
60
|
+
- test/test.html
|
61
|
+
homepage: https://github.com/StanZhuravlev/st_html_table
|
62
|
+
licenses:
|
63
|
+
- MIT
|
64
|
+
metadata:
|
65
|
+
allowed_push_host: https://rubygems.org
|
66
|
+
post_install_message:
|
67
|
+
rdoc_options: []
|
68
|
+
require_paths:
|
69
|
+
- lib
|
70
|
+
- lib/st_html_table
|
71
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 2.2.1
|
76
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
81
|
+
requirements: []
|
82
|
+
rubyforge_project:
|
83
|
+
rubygems_version: 2.4.5
|
84
|
+
signing_key:
|
85
|
+
specification_version: 4
|
86
|
+
summary: "Формирование таблиц в формате HTML"
|
87
|
+
test_files: []
|