html-table 1.6.3 → 1.7.1
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.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/{CHANGES.rdoc → CHANGES.md} +76 -68
- data/Gemfile +2 -0
- data/MANIFEST.md +57 -0
- data/{README.rdoc → README.md} +80 -71
- data/Rakefile +122 -146
- data/doc/attributes.md +160 -0
- data/doc/table.md +173 -0
- data/doc/table_body.md +9 -0
- data/doc/table_caption.md +10 -0
- data/doc/table_colgroup.md +8 -0
- data/doc/table_colgroup_col.md +7 -0
- data/doc/table_content.md +17 -0
- data/doc/table_foot.md +8 -0
- data/doc/table_head.md +10 -0
- data/doc/table_row.md +114 -0
- data/doc/table_row_data.md +100 -0
- data/doc/table_row_header.md +6 -0
- data/examples/simple1.rb +7 -5
- data/html-table.gemspec +16 -11
- data/lib/html/body.rb +9 -7
- data/lib/html/caption.rb +4 -2
- data/lib/html/col.rb +37 -34
- data/lib/html/colgroup.rb +90 -97
- data/lib/html/content.rb +3 -6
- data/lib/html/data.rb +3 -1
- data/lib/html/foot.rb +53 -45
- data/lib/html/head.rb +54 -47
- data/lib/html/header.rb +5 -3
- data/lib/html/mixin/attribute_handler.rb +59 -55
- data/lib/html/mixin/html_handler.rb +33 -35
- data/lib/html/mixin/strongtyping.rb +6 -6
- data/lib/html/mixin/tag_handler.rb +6 -2
- data/lib/html/row.rb +156 -183
- data/lib/html/table.rb +45 -45
- data/lib/html/tablesection.rb +51 -46
- data/spec/attribute_handler_spec.rb +374 -0
- data/spec/body_spec.rb +98 -0
- data/spec/caption_spec.rb +83 -0
- data/spec/colgroup_col_spec.rb +34 -0
- data/spec/colgroup_spec.rb +97 -0
- data/spec/data_spec.rb +88 -0
- data/spec/foot_spec.rb +116 -0
- data/spec/head_spec.rb +116 -0
- data/spec/header_spec.rb +85 -0
- data/spec/html_handler_spec.rb +35 -0
- data/spec/row_spec.rb +163 -0
- data/spec/table_spec.rb +186 -0
- data/spec/tablesection_spec.rb +36 -0
- data/spec/tag_handler_spec.rb +85 -0
- data.tar.gz.sig +0 -0
- metadata +118 -92
- metadata.gz.sig +0 -0
- data/MANIFEST.rdoc +0 -56
- data/doc/attributes.rdoc +0 -143
- data/doc/table.rdoc +0 -156
- data/doc/table_body.rdoc +0 -9
- data/doc/table_caption.rdoc +0 -9
- data/doc/table_colgroup.rdoc +0 -8
- data/doc/table_colgroup_col.rdoc +0 -9
- data/doc/table_content.rdoc +0 -15
- data/doc/table_foot.rdoc +0 -8
- data/doc/table_head.rdoc +0 -11
- data/doc/table_row.rdoc +0 -105
- data/doc/table_row_data.rdoc +0 -92
- data/doc/table_row_header.rdoc +0 -7
- data/test/test_attribute_handler.rb +0 -361
- data/test/test_body.rb +0 -87
- data/test/test_caption.rb +0 -80
- data/test/test_col.rb +0 -40
- data/test/test_colgroup.rb +0 -89
- data/test/test_data.rb +0 -77
- data/test/test_foot.rb +0 -111
- data/test/test_head.rb +0 -104
- data/test/test_header.rb +0 -77
- data/test/test_html_handler.rb +0 -37
- data/test/test_row.rb +0 -141
- data/test/test_table.rb +0 -159
- data/test/test_tablesection.rb +0 -42
- data/test/test_tag_handler.rb +0 -90
data/lib/html/data.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# The HTML module serves as a namespace only.
|
1
2
|
module HTML
|
2
3
|
|
3
4
|
# This class represents HTML table data, <td>. Despite the name
|
@@ -6,6 +7,7 @@ module HTML
|
|
6
7
|
class Table::Row::Data
|
7
8
|
include HTML::Mixin::AttributeHandler
|
8
9
|
include HTML::Mixin::HtmlHandler
|
10
|
+
extend HTML::Mixin::StrongTyping
|
9
11
|
|
10
12
|
undef_method :configure
|
11
13
|
|
@@ -42,7 +44,7 @@ module HTML
|
|
42
44
|
#
|
43
45
|
def self.indent_level=(num)
|
44
46
|
expect(num, Integer)
|
45
|
-
raise ArgumentError,
|
47
|
+
raise ArgumentError, 'indent_level must be >= 0' if num < 0
|
46
48
|
@indent_level = num
|
47
49
|
end
|
48
50
|
|
data/lib/html/foot.rb
CHANGED
@@ -1,49 +1,57 @@
|
|
1
|
+
require 'singleton'
|
2
|
+
|
3
|
+
# The HTML module serves as a namespace only.
|
1
4
|
module HTML
|
2
5
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
6
|
+
# This class represents an HTML table foot (<tfoot>). It is a
|
7
|
+
# subclass of Table::TableSection. It is a singleton class.
|
8
|
+
#
|
9
|
+
class Table::Foot < Table::TableSection
|
10
|
+
include Singleton
|
11
|
+
extend HTML::Mixin::StrongTyping
|
12
|
+
|
13
|
+
@indent_level = 3
|
14
|
+
@end_tags = true
|
15
|
+
|
16
|
+
# This is our constructor for Foot objects because it is a singleton
|
17
|
+
# class. Optionally, a block may be provided. If an argument is
|
18
|
+
# provided it is treated as content.
|
19
|
+
#
|
20
|
+
def self.create(arg = nil, &block)
|
21
|
+
instance(arg, &block)
|
22
|
+
end
|
23
|
+
|
24
|
+
# Part of the singleton interface.
|
25
|
+
#
|
26
|
+
def self.instance(arg = nil, &block)
|
27
|
+
@instance ||= new(arg, &block)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Called by create() instead of new(). This initializes the Foot class.
|
31
|
+
#
|
32
|
+
def initialize(arg, &block)
|
33
|
+
@html_begin = '<tfoot'
|
34
|
+
@html_end = '</tfoot>'
|
35
|
+
super(&block)
|
36
|
+
self.content = arg if arg
|
37
|
+
end
|
38
|
+
|
39
|
+
# Returns a boolean indicating whether or not end tags, </tfoot>, are
|
40
|
+
# included for each Foot object in the final HTML output. The
|
41
|
+
# default is true.
|
42
|
+
#
|
43
|
+
def self.end_tags?
|
44
|
+
@end_tags
|
45
|
+
end
|
46
|
+
|
47
|
+
# Sets whether or not end tags are included for each Foot object in
|
48
|
+
# the final HTML output. The default is true. Only true or false are
|
49
|
+
# valid arguments.
|
50
|
+
#
|
51
|
+
def self.end_tags=(bool)
|
52
|
+
expect(bool, [TrueClass, FalseClass])
|
53
|
+
@end_tags = bool
|
54
|
+
end
|
55
|
+
end
|
48
56
|
|
49
57
|
end
|
data/lib/html/head.rb
CHANGED
@@ -1,49 +1,56 @@
|
|
1
|
+
require 'singleton'
|
2
|
+
|
3
|
+
# The HTML module serves only as a namespace.
|
1
4
|
module HTML
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
5
|
+
|
6
|
+
# This class represents an HTML table head (<thead>). It is a
|
7
|
+
# subclass of Table::TableSection. It is a singleton class.
|
8
|
+
#
|
9
|
+
class Table::Head < Table::TableSection
|
10
|
+
include Singleton
|
11
|
+
extend HTML::Mixin::StrongTyping
|
12
|
+
|
13
|
+
@indent_level = 3
|
14
|
+
@end_tags = true
|
15
|
+
|
16
|
+
# This is our constructor for Head objects because it is a singleton
|
17
|
+
# class. Optionally, a block may be provided. If an argument is
|
18
|
+
# provided it is treated as content.
|
19
|
+
#
|
20
|
+
def self.create(arg = nil, &block)
|
21
|
+
instance(arg, &block)
|
22
|
+
end
|
23
|
+
|
24
|
+
# Part of the singleton interface.
|
25
|
+
#
|
26
|
+
def self.instance(arg = nil, &block)
|
27
|
+
@instance ||= new(arg, &block)
|
28
|
+
end
|
29
|
+
|
30
|
+
# Called by create() instead of new(). This initializes the Head class.
|
31
|
+
#
|
32
|
+
def initialize(arg, &block)
|
33
|
+
@html_begin = '<thead'
|
34
|
+
@html_end = '</thead>'
|
35
|
+
super(&block)
|
36
|
+
self.content = arg if arg
|
37
|
+
end
|
38
|
+
|
39
|
+
# Returns a boolean indicating whether or not end tags, </thead>, are
|
40
|
+
# included for each Head object in the final HTML output. The
|
41
|
+
# default is true.
|
42
|
+
#
|
43
|
+
def self.end_tags?
|
44
|
+
@end_tags
|
45
|
+
end
|
46
|
+
|
47
|
+
# Sets whether or not end tags are included for each Head object in
|
48
|
+
# the final HTML output. The default is true. Only true or false are
|
49
|
+
# valid arguments.
|
50
|
+
#
|
51
|
+
def self.end_tags=(bool)
|
52
|
+
expect(bool, [TrueClass, FalseClass])
|
53
|
+
@end_tags = bool
|
54
|
+
end
|
55
|
+
end
|
49
56
|
end
|
data/lib/html/header.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# The HTML module serves as a namespace only.
|
1
2
|
module HTML
|
2
3
|
|
3
4
|
# This class represents an HTML table header (<th>). Despite the name
|
@@ -6,6 +7,7 @@ module HTML
|
|
6
7
|
class Table::Row::Header
|
7
8
|
include HTML::Mixin::AttributeHandler
|
8
9
|
include HTML::Mixin::HtmlHandler
|
10
|
+
extend HTML::Mixin::StrongTyping
|
9
11
|
|
10
12
|
undef_method :configure
|
11
13
|
|
@@ -41,8 +43,8 @@ module HTML
|
|
41
43
|
# is 6.
|
42
44
|
#
|
43
45
|
def self.indent_level=(num)
|
44
|
-
expect(num,Integer)
|
45
|
-
raise ArgumentError,
|
46
|
+
expect(num, Integer)
|
47
|
+
raise ArgumentError, 'indent_level must be >= 0' if num < 0
|
46
48
|
@indent_level = num
|
47
49
|
end
|
48
50
|
|
@@ -58,7 +60,7 @@ module HTML
|
|
58
60
|
# valid arguments.
|
59
61
|
#
|
60
62
|
def self.end_tags=(bool)
|
61
|
-
expect(bool,[TrueClass,FalseClass])
|
63
|
+
expect(bool, [TrueClass, FalseClass])
|
62
64
|
@end_tags = bool
|
63
65
|
end
|
64
66
|
end
|
@@ -1,11 +1,14 @@
|
|
1
|
-
|
2
|
-
# with HTML tables. In some cases validation is done on the setters.
|
3
|
-
#--
|
1
|
+
##########################################################################
|
4
2
|
# The seemingly redundant writer methods were left here for backwards
|
5
|
-
# compatibility and for those who may not prefer the
|
6
|
-
|
3
|
+
# compatibility and for those who may not prefer the DSL.
|
4
|
+
##########################################################################
|
5
|
+
|
6
|
+
# The HTML module serves as a namespace only.
|
7
7
|
module HTML
|
8
|
+
# The Mixin module serves as a namespace to prevent collisions.
|
8
9
|
module Mixin
|
10
|
+
# The AttributeHandler module creates methods for each of the various attributes
|
11
|
+
# associated with HTML tables. In some cases validation is done on the setters.
|
9
12
|
module AttributeHandler
|
10
13
|
def abbr(string = nil)
|
11
14
|
@abbr ||= nil
|
@@ -15,7 +18,7 @@ module HTML
|
|
15
18
|
|
16
19
|
def abbr=(string)
|
17
20
|
@abbr = string
|
18
|
-
modify_html(
|
21
|
+
modify_html('abbr', string)
|
19
22
|
end
|
20
23
|
|
21
24
|
def align(position = nil)
|
@@ -25,10 +28,10 @@ module HTML
|
|
25
28
|
end
|
26
29
|
|
27
30
|
def align=(position)
|
28
|
-
valid = %w
|
31
|
+
valid = %w[top bottom left center right]
|
29
32
|
raise ArgumentError unless valid.include?(position.downcase)
|
30
33
|
@align = position
|
31
|
-
modify_html(
|
34
|
+
modify_html('align', position)
|
32
35
|
end
|
33
36
|
|
34
37
|
def axis(string = nil)
|
@@ -39,7 +42,7 @@ module HTML
|
|
39
42
|
|
40
43
|
def axis=(string)
|
41
44
|
@axis = string
|
42
|
-
modify_html(
|
45
|
+
modify_html('axis', string)
|
43
46
|
end
|
44
47
|
|
45
48
|
def background(url = nil)
|
@@ -49,11 +52,11 @@ module HTML
|
|
49
52
|
end
|
50
53
|
|
51
54
|
def background=(url)
|
52
|
-
raise TypeError unless url.
|
53
|
-
msg =
|
55
|
+
raise TypeError unless url.is_a?(String)
|
56
|
+
msg = "'background' is a non-standard extension"
|
54
57
|
warn NonStandardExtensionWarning, msg
|
55
58
|
@background = url
|
56
|
-
modify_html(
|
59
|
+
modify_html('background', url)
|
57
60
|
end
|
58
61
|
|
59
62
|
def bgcolor(color = nil)
|
@@ -64,7 +67,7 @@ module HTML
|
|
64
67
|
|
65
68
|
def bgcolor=(color)
|
66
69
|
@bgcolor = color
|
67
|
-
modify_html(
|
70
|
+
modify_html('bgcolor', color)
|
68
71
|
end
|
69
72
|
|
70
73
|
def border(num = nil)
|
@@ -75,13 +78,14 @@ module HTML
|
|
75
78
|
|
76
79
|
# Allow either true/false or an integer
|
77
80
|
def border=(num)
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
81
|
+
case num
|
82
|
+
when TrueClass
|
83
|
+
modify_html('border', true)
|
84
|
+
when FalseClass
|
85
|
+
# Do nothing
|
86
|
+
else
|
87
|
+
@border = num.to_i
|
88
|
+
modify_html('border', num.to_i)
|
85
89
|
end
|
86
90
|
end
|
87
91
|
|
@@ -93,9 +97,9 @@ module HTML
|
|
93
97
|
|
94
98
|
def bordercolor=(color)
|
95
99
|
@bordercolor = color
|
96
|
-
msg =
|
100
|
+
msg = "'bordercolor' is a non-standard extension"
|
97
101
|
warn NonStandardExtensionWarning, msg
|
98
|
-
modify_html(
|
102
|
+
modify_html('bordercolor', color)
|
99
103
|
end
|
100
104
|
|
101
105
|
def bordercolordark(color = nil)
|
@@ -108,7 +112,7 @@ module HTML
|
|
108
112
|
@bordercolordark = color
|
109
113
|
msg = "'bordercolordark' is a non-standard extension"
|
110
114
|
warn NonStandardExtensionWarning, msg
|
111
|
-
modify_html(
|
115
|
+
modify_html('bordercolordark', color)
|
112
116
|
end
|
113
117
|
|
114
118
|
def bordercolorlight(color = nil)
|
@@ -121,7 +125,7 @@ module HTML
|
|
121
125
|
@bordercolorlight = color
|
122
126
|
msg = "'bordercolorlight' is a non-standard extension"
|
123
127
|
warn NonStandardExtensionWarning, msg
|
124
|
-
modify_html(
|
128
|
+
modify_html('bordercolorlight', @bordercolorlight)
|
125
129
|
end
|
126
130
|
|
127
131
|
def cellpadding(num = nil)
|
@@ -133,7 +137,7 @@ module HTML
|
|
133
137
|
def cellpadding=(num)
|
134
138
|
raise ArgumentError if num.to_i < 0
|
135
139
|
@cellpadding = num.to_i
|
136
|
-
modify_html(
|
140
|
+
modify_html('cellpadding', @cellpadding)
|
137
141
|
end
|
138
142
|
|
139
143
|
def cellspacing(num = nil)
|
@@ -145,7 +149,7 @@ module HTML
|
|
145
149
|
def cellspacing=(num)
|
146
150
|
raise ArgumentError if num.to_i < 0
|
147
151
|
@cellspacing = num.to_i
|
148
|
-
modify_html(
|
152
|
+
modify_html('cellspacing', @cellspacing)
|
149
153
|
end
|
150
154
|
|
151
155
|
def char(character = nil)
|
@@ -157,7 +161,7 @@ module HTML
|
|
157
161
|
def char=(character)
|
158
162
|
raise ArgumentError if character.to_s.length > 1
|
159
163
|
@char = character.to_s
|
160
|
-
modify_html(
|
164
|
+
modify_html('char', character.to_s)
|
161
165
|
end
|
162
166
|
|
163
167
|
def charoff(offset = nil)
|
@@ -169,7 +173,7 @@ module HTML
|
|
169
173
|
def charoff=(offset)
|
170
174
|
raise ArgumentError if offset.to_i < 0
|
171
175
|
@charoff = offset
|
172
|
-
modify_html(
|
176
|
+
modify_html('charoff', offset)
|
173
177
|
end
|
174
178
|
|
175
179
|
# Returns the CSS class. The trailing underscore is necessary in order
|
@@ -198,7 +202,7 @@ module HTML
|
|
198
202
|
def col=(num)
|
199
203
|
raise ArgumentError if num.to_i < 0
|
200
204
|
@col = num.to_i
|
201
|
-
modify_html(
|
205
|
+
modify_html('col', @col)
|
202
206
|
end
|
203
207
|
|
204
208
|
def colspan(span = nil)
|
@@ -210,17 +214,17 @@ module HTML
|
|
210
214
|
def colspan=(span)
|
211
215
|
raise ArgumentError if span.to_i < 0
|
212
216
|
@colspan = span.to_i
|
213
|
-
modify_html(
|
217
|
+
modify_html('colspan', @colspan)
|
214
218
|
end
|
215
219
|
|
216
220
|
# Allows you to configure various attributes by row or row + column.
|
217
221
|
#
|
218
|
-
def configure(row, col=nil
|
222
|
+
def configure(row, col = nil)
|
219
223
|
if col
|
220
224
|
begin
|
221
225
|
yield self[row][col]
|
222
226
|
rescue NameError
|
223
|
-
msg = "No column to configure in a
|
227
|
+
msg = "No column to configure in a #{self.class} class"
|
224
228
|
raise ArgumentError, msg
|
225
229
|
end
|
226
230
|
else
|
@@ -235,15 +239,15 @@ module HTML
|
|
235
239
|
when String
|
236
240
|
self.content = Table::Content.new(arg, &block)
|
237
241
|
when Array
|
238
|
-
arg.each
|
239
|
-
if e.
|
242
|
+
arg.each do |e|
|
243
|
+
if e.is_a?(Array)
|
240
244
|
row = Table::Row.new
|
241
|
-
e.each{ |element| row.push(Table::Content.new(element, &block)) }
|
242
|
-
|
245
|
+
e.each { |element| row.push(Table::Content.new(element, &block)) }
|
246
|
+
push(row)
|
243
247
|
else
|
244
248
|
self.content = Table::Content.new(e, &block)
|
245
249
|
end
|
246
|
-
|
250
|
+
end
|
247
251
|
else
|
248
252
|
self.content = arg if arg
|
249
253
|
end
|
@@ -259,10 +263,10 @@ module HTML
|
|
259
263
|
end
|
260
264
|
|
261
265
|
def frame=(type)
|
262
|
-
valid = %w
|
266
|
+
valid = %w[border void above below hsides lhs rhs vsides box]
|
263
267
|
raise ArgumentError unless valid.include?(type.downcase)
|
264
268
|
@frame = type
|
265
|
-
modify_html(
|
269
|
+
modify_html('frame', @frame)
|
266
270
|
end
|
267
271
|
|
268
272
|
def height(num = nil)
|
@@ -274,7 +278,7 @@ module HTML
|
|
274
278
|
def height=(num)
|
275
279
|
raise ArgumentError if num.to_i < 0
|
276
280
|
@height = num.to_i
|
277
|
-
modify_html(
|
281
|
+
modify_html('height', @height)
|
278
282
|
end
|
279
283
|
|
280
284
|
def hspace(num = nil)
|
@@ -286,7 +290,7 @@ module HTML
|
|
286
290
|
def hspace=(num)
|
287
291
|
raise ArgumentError if num.to_i < 0
|
288
292
|
@hspace = num.to_i
|
289
|
-
modify_html(
|
293
|
+
modify_html('hspace', @hspace)
|
290
294
|
end
|
291
295
|
|
292
296
|
def nowrap(bool = nil)
|
@@ -296,11 +300,11 @@ module HTML
|
|
296
300
|
end
|
297
301
|
|
298
302
|
def nowrap=(bool)
|
299
|
-
unless bool.
|
300
|
-
|
303
|
+
unless bool.is_a?(TrueClass) || bool.is_a?(FalseClass)
|
304
|
+
raise TypeError
|
301
305
|
end
|
302
306
|
@nowrap = bool
|
303
|
-
modify_html(
|
307
|
+
modify_html('nowrap', @nowrap)
|
304
308
|
end
|
305
309
|
|
306
310
|
def rowspan(num = nil)
|
@@ -312,7 +316,7 @@ module HTML
|
|
312
316
|
def rowspan=(num)
|
313
317
|
raise ArgumentError if num.to_i < 0
|
314
318
|
@rowspan = num.to_i
|
315
|
-
modify_html(
|
319
|
+
modify_html('rowspan', @rowspan)
|
316
320
|
end
|
317
321
|
|
318
322
|
def rules(edges = nil)
|
@@ -322,10 +326,10 @@ module HTML
|
|
322
326
|
end
|
323
327
|
|
324
328
|
def rules=(edges)
|
325
|
-
valid = %w
|
329
|
+
valid = %w[all groups rows cols none]
|
326
330
|
raise ArgumentError unless valid.include?(edges.to_s.downcase)
|
327
331
|
@rules = edges
|
328
|
-
modify_html(
|
332
|
+
modify_html('rules', @rules)
|
329
333
|
end
|
330
334
|
|
331
335
|
def span(num = nil)
|
@@ -337,7 +341,7 @@ module HTML
|
|
337
341
|
def span=(num)
|
338
342
|
raise ArgumentError if num.to_i < 0
|
339
343
|
@span = num.to_i
|
340
|
-
modify_html(
|
344
|
+
modify_html('span', @span)
|
341
345
|
end
|
342
346
|
|
343
347
|
def style(string = nil)
|
@@ -348,7 +352,7 @@ module HTML
|
|
348
352
|
|
349
353
|
def style=(string)
|
350
354
|
@style = string.to_s
|
351
|
-
modify_html(
|
355
|
+
modify_html('style', @style)
|
352
356
|
end
|
353
357
|
|
354
358
|
def summary(string = nil)
|
@@ -359,7 +363,7 @@ module HTML
|
|
359
363
|
|
360
364
|
def summary=(string)
|
361
365
|
@summary = string.to_s
|
362
|
-
modify_html(
|
366
|
+
modify_html('summary', @summary)
|
363
367
|
end
|
364
368
|
|
365
369
|
def valign(position = nil)
|
@@ -369,10 +373,10 @@ module HTML
|
|
369
373
|
end
|
370
374
|
|
371
375
|
def valign=(position)
|
372
|
-
valid = %w
|
376
|
+
valid = %w[top center bottom baseline]
|
373
377
|
raise ArgumentError unless valid.include?(position.to_s.downcase)
|
374
378
|
@valign = position
|
375
|
-
modify_html(
|
379
|
+
modify_html('valign', @valign)
|
376
380
|
end
|
377
381
|
|
378
382
|
def vspace(num = nil)
|
@@ -384,7 +388,7 @@ module HTML
|
|
384
388
|
def vspace=(num)
|
385
389
|
raise ArgumentError if num.to_i < 0
|
386
390
|
@vspace = num.to_i
|
387
|
-
modify_html(
|
391
|
+
modify_html('vspace', @vspace)
|
388
392
|
end
|
389
393
|
|
390
394
|
def width(num = nil)
|
@@ -394,13 +398,13 @@ module HTML
|
|
394
398
|
end
|
395
399
|
|
396
400
|
def width=(num)
|
397
|
-
if num =~ /%/
|
401
|
+
if num.to_s =~ /%/
|
398
402
|
@width = num
|
399
403
|
else
|
400
404
|
raise ArgumentError if num.to_i < 0
|
401
405
|
@width = num.to_i
|
402
406
|
end
|
403
|
-
modify_html(
|
407
|
+
modify_html('width', @width)
|
404
408
|
end
|
405
409
|
end
|
406
410
|
end
|