Spreadsheet-HTML 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changes +5 -0
- data/README +22 -8
- data/Spreadsheet-HTML.gemspec +1 -1
- data/lib/Spreadsheet/HTML/version.rb +1 -1
- data/t/14-colgroup.rb +3 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8ceaee77f05b755a6f0fdc84a5931750d0665a4
|
4
|
+
data.tar.gz: eb787f07df9f1449972e1bf6d9625e7612865608
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79f2c114c130dc28f64c4edeb92a9ba74a0e3333c8f440a3b8942d860fbec3274e4acb5ca55860082345a35b3d409467201a0dbb28e8dfeefbeab1ea5c256261
|
7
|
+
data.tar.gz: 3d162b8db693617c738b05c304da25c45bf45fe9a14b2ca8da105e4de57d6415b89b27f6d12025045f0ddfe74481180e194f7e6e6cec302b4af8988557035bef
|
data/Changes
CHANGED
data/README
CHANGED
@@ -140,14 +140,6 @@ fill
|
|
140
140
|
|
141
141
|
'fill' => '8x12' # 8 rows, 12 columns
|
142
142
|
|
143
|
-
caption
|
144
|
-
Caption is special in that you can either pass a string to be used as CDATA or a hash whose only
|
145
|
-
key is the string to be used as CDATA.
|
146
|
-
|
147
|
-
'caption' => 'Just Another Title'
|
148
|
-
|
149
|
-
'caption' => { 'A Title With Attributes' => { 'align' => 'bottom' } }
|
150
|
-
|
151
143
|
== Dynamic Parameters
|
152
144
|
Dynamic parameters provide a means to control the micro elements of the table,
|
153
145
|
such as modifying headings by their name and rows and columns by their indices.
|
@@ -226,6 +218,28 @@ td
|
|
226
218
|
'td' => lambda { |c| c.upcase }
|
227
219
|
'td' => [ { 'style' => { 'color' => %w{ red green blue } }, lambda { |c| c.upcase } ]
|
228
220
|
|
221
|
+
caption
|
222
|
+
Caption is special in that you can either pass a string to be used as CDATA or a hash whose only
|
223
|
+
key is the string to be used as CDATA.
|
224
|
+
|
225
|
+
'caption' => 'Just Another Title'
|
226
|
+
|
227
|
+
'caption' => { 'A Title With Attributes' => { 'align' => 'bottom' } }
|
228
|
+
|
229
|
+
colgroup
|
230
|
+
Add colgroup tag(s) to the table. Use an AoH for multiple.
|
231
|
+
|
232
|
+
colgroup => { 'span => '2', 'style' => { 'background-color' => 'orange' } }
|
233
|
+
|
234
|
+
colgroup => Array[ { 'span => '20' }, { 'span' => '1', 'class' => 'end' } ]
|
235
|
+
|
236
|
+
col
|
237
|
+
Add col tag(s) to the table. Use an AoH for multiple. Wraps tags within a colgroup tag. Same usage as colgroup.
|
238
|
+
|
239
|
+
col => { 'span' => '2', 'style' => { 'background-color' => 'orange' } }
|
240
|
+
|
241
|
+
col => Array[ { 'span' => 20 }, { 'span' => '1', 'class' => 'end' } ]
|
242
|
+
|
229
243
|
thead.tr
|
230
244
|
When tgroups is 1 or 2, this tag parameter is available to control the attributes of
|
231
245
|
the <tr> tag within the <thead> group.
|
data/Spreadsheet-HTML.gemspec
CHANGED
data/t/14-colgroup.rb
CHANGED
@@ -11,7 +11,7 @@ class Test_Colgroup < Test::Unit::TestCase
|
|
11
11
|
%w( 4 5 6 ),
|
12
12
|
]
|
13
13
|
|
14
|
-
gen = Spreadsheet::HTML.new( 'data' => data, 'colgroup' => { 'span' =>
|
14
|
+
gen = Spreadsheet::HTML.new( 'data' => data, 'colgroup' => { 'span' => 3, 'width' => 100 }, 'attr_sort' => 1 );
|
15
15
|
|
16
16
|
assert_equal(
|
17
17
|
'<table><colgroup span="3" width="100" /><tr><th>a</th><th>b</th><th>c</th></tr><tr><td>1</td><td>2</td><td>3</td></tr><tr><td>4</td><td>5</td><td>6</td></tr></table>',
|
@@ -39,7 +39,7 @@ class Test_Colgroup < Test::Unit::TestCase
|
|
39
39
|
|
40
40
|
assert_equal(
|
41
41
|
'<table><colgroup color="red" span="1" /><colgroup color="blue" span="2" /><tr><th>a</th><th>b</th><th>c</th></tr><tr><td>1</td><td>2</td><td>3</td></tr><tr><td>4</td><td>5</td><td>6</td></tr></table>',
|
42
|
-
gen.generate( 'colgroup' => [ { 'span' =>
|
42
|
+
gen.generate( 'colgroup' => [ { 'span' => 1, 'color' => 'red' }, { 'span' => 2, 'color' => 'blue' } ] ),
|
43
43
|
"can specify multiple colgroups"
|
44
44
|
)
|
45
45
|
|
@@ -53,7 +53,7 @@ class Test_Colgroup < Test::Unit::TestCase
|
|
53
53
|
%w( 4 5 6 ),
|
54
54
|
]
|
55
55
|
|
56
|
-
gen = Spreadsheet::HTML.new( 'data' => data, 'colgroup' => { 'span' =>
|
56
|
+
gen = Spreadsheet::HTML.new( 'data' => data, 'colgroup' => { 'span' => 3, 'width' => 100 }, 'attr_sort' => 1 );
|
57
57
|
|
58
58
|
assert_equal(
|
59
59
|
'<table><colgroup span="3" width="100"><col /></colgroup><tr><th>a</th><th>b</th><th>c</th></tr><tr><td>1</td><td>2</td><td>3</td></tr><tr><td>4</td><td>5</td><td>6</td></tr></table>',
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: Spreadsheet-HTML
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jeffa
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.0.
|
47
|
+
version: 1.0.7
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.0.
|
54
|
+
version: 1.0.7
|
55
55
|
description: Just another HTML table generator
|
56
56
|
email:
|
57
57
|
- jeffa@cpan.org
|