excesselt 1.0.0
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.
- data/.gitignore +5 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +56 -0
- data/History.txt +4 -0
- data/PostInstall.txt +1 -0
- data/README.md +67 -0
- data/Rakefile +54 -0
- data/TODO +3 -0
- data/excesselt.gemspec +102 -0
- data/lib/excesselt/element_wrapper.rb +37 -0
- data/lib/excesselt/rule.rb +45 -0
- data/lib/excesselt/stylesheet.rb +64 -0
- data/lib/excesselt.rb +9 -0
- data/rdoc/classes/Excesselt/ElementWrapper.html +276 -0
- data/rdoc/classes/Excesselt/Rule.html +290 -0
- data/rdoc/classes/Excesselt/Stylesheet.html +242 -0
- data/rdoc/classes/Excesselt.html +138 -0
- data/rdoc/created.rid +1 -0
- data/rdoc/files/README_md.html +199 -0
- data/rdoc/files/lib/excesselt/element_wrapper_rb.html +101 -0
- data/rdoc/files/lib/excesselt/rule_rb.html +101 -0
- data/rdoc/files/lib/excesselt/stylesheet_rb.html +108 -0
- data/rdoc/files/lib/excesselt_rb.html +110 -0
- data/rdoc/fr_class_index.html +30 -0
- data/rdoc/fr_file_index.html +31 -0
- data/rdoc/fr_method_index.html +40 -0
- data/rdoc/index.html +24 -0
- data/rdoc/rdoc-style.css +208 -0
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/spec/excesselt_spec.rb +90 -0
- data/spec/spec_helper.rb +5 -0
- data/spec/support/matchers/dom_matcher.rb +45 -0
- data/tasks/rspec.rake +10 -0
- metadata +227 -0
@@ -0,0 +1,242 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Class: Excesselt::Stylesheet</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Class</strong></td>
|
53
|
+
<td class="class-name-in-header">Excesselt::Stylesheet</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/lib/excesselt/stylesheet_rb.html">
|
59
|
+
lib/excesselt/stylesheet.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
<tr class="top-aligned-row">
|
66
|
+
<td><strong>Parent:</strong></td>
|
67
|
+
<td>
|
68
|
+
Object
|
69
|
+
</td>
|
70
|
+
</tr>
|
71
|
+
</table>
|
72
|
+
</div>
|
73
|
+
<!-- banner header -->
|
74
|
+
|
75
|
+
<div id="bodyContent">
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<div id="contextContent">
|
80
|
+
|
81
|
+
|
82
|
+
|
83
|
+
</div>
|
84
|
+
|
85
|
+
<div id="method-list">
|
86
|
+
<h3 class="section-bar">Methods</h3>
|
87
|
+
|
88
|
+
<div class="name-list">
|
89
|
+
<a href="#M000014">generate_element</a>
|
90
|
+
<a href="#M000012">new</a>
|
91
|
+
<a href="#M000013">transform</a>
|
92
|
+
<a href="#M000011">transform</a>
|
93
|
+
</div>
|
94
|
+
</div>
|
95
|
+
|
96
|
+
</div>
|
97
|
+
|
98
|
+
|
99
|
+
<!-- if includes -->
|
100
|
+
|
101
|
+
<div id="section">
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
<div id="attribute-list">
|
108
|
+
<h3 class="section-bar">Attributes</h3>
|
109
|
+
|
110
|
+
<div class="name-list">
|
111
|
+
<table>
|
112
|
+
<tr class="top-aligned-row context-row">
|
113
|
+
<td class="context-item-name">builder</td>
|
114
|
+
<td class="context-item-value"> [R] </td>
|
115
|
+
<td class="context-item-desc"></td>
|
116
|
+
</tr>
|
117
|
+
<tr class="top-aligned-row context-row">
|
118
|
+
<td class="context-item-name">errors</td>
|
119
|
+
<td class="context-item-value"> [R] </td>
|
120
|
+
<td class="context-item-desc"></td>
|
121
|
+
</tr>
|
122
|
+
</table>
|
123
|
+
</div>
|
124
|
+
</div>
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
<!-- if method_list -->
|
129
|
+
<div id="methods">
|
130
|
+
<h3 class="section-bar">Public Class methods</h3>
|
131
|
+
|
132
|
+
<div id="method-M000012" class="method-detail">
|
133
|
+
<a name="M000012"></a>
|
134
|
+
|
135
|
+
<div class="method-heading">
|
136
|
+
<a href="#M000012" class="method-signature">
|
137
|
+
<span class="method-name">new</span><span class="method-args">()</span>
|
138
|
+
</a>
|
139
|
+
</div>
|
140
|
+
|
141
|
+
<div class="method-description">
|
142
|
+
<p><a class="source-toggle" href="#"
|
143
|
+
onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
|
144
|
+
<div class="method-source-code" id="M000012-source">
|
145
|
+
<pre>
|
146
|
+
<span class="ruby-comment cmt"># File lib/excesselt/stylesheet.rb, line 11</span>
|
147
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
148
|
+
<span class="ruby-ivar">@builder</span> = <span class="ruby-constant">Builder</span><span class="ruby-operator">::</span><span class="ruby-constant">XmlMarkup</span>.<span class="ruby-identifier">new</span>
|
149
|
+
<span class="ruby-ivar">@helper_modules</span> = []
|
150
|
+
<span class="ruby-ivar">@errors</span> = []
|
151
|
+
<span class="ruby-keyword kw">end</span>
|
152
|
+
</pre>
|
153
|
+
</div>
|
154
|
+
</div>
|
155
|
+
</div>
|
156
|
+
|
157
|
+
<div id="method-M000011" class="method-detail">
|
158
|
+
<a name="M000011"></a>
|
159
|
+
|
160
|
+
<div class="method-heading">
|
161
|
+
<a href="#M000011" class="method-signature">
|
162
|
+
<span class="method-name">transform</span><span class="method-args">(xml)</span>
|
163
|
+
</a>
|
164
|
+
</div>
|
165
|
+
|
166
|
+
<div class="method-description">
|
167
|
+
<p><a class="source-toggle" href="#"
|
168
|
+
onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
|
169
|
+
<div class="method-source-code" id="M000011-source">
|
170
|
+
<pre>
|
171
|
+
<span class="ruby-comment cmt"># File lib/excesselt/stylesheet.rb, line 7</span>
|
172
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">transform</span>(<span class="ruby-identifier">xml</span>)
|
173
|
+
<span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">new</span>.<span class="ruby-identifier">transform</span>(<span class="ruby-identifier">xml</span>)
|
174
|
+
<span class="ruby-keyword kw">end</span>
|
175
|
+
</pre>
|
176
|
+
</div>
|
177
|
+
</div>
|
178
|
+
</div>
|
179
|
+
|
180
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
181
|
+
|
182
|
+
<div id="method-M000014" class="method-detail">
|
183
|
+
<a name="M000014"></a>
|
184
|
+
|
185
|
+
<div class="method-heading">
|
186
|
+
<a href="#M000014" class="method-signature">
|
187
|
+
<span class="method-name">generate_element</span><span class="method-args">(element)</span>
|
188
|
+
</a>
|
189
|
+
</div>
|
190
|
+
|
191
|
+
<div class="method-description">
|
192
|
+
<p><a class="source-toggle" href="#"
|
193
|
+
onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
|
194
|
+
<div class="method-source-code" id="M000014-source">
|
195
|
+
<pre>
|
196
|
+
<span class="ruby-comment cmt"># File lib/excesselt/stylesheet.rb, line 21</span>
|
197
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">generate_element</span>(<span class="ruby-identifier">element</span>)
|
198
|
+
<span class="ruby-identifier">rule</span> = <span class="ruby-identifier">rule_for</span>(<span class="ruby-identifier">element</span>)
|
199
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-node">"Attempted to generate #{self.name} with parents #{self.parents.inspect} but no rule was found."</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">rule</span>
|
200
|
+
<span class="ruby-identifier">rule</span>.<span class="ruby-identifier">generate</span>(<span class="ruby-identifier">builder</span>)
|
201
|
+
<span class="ruby-keyword kw">end</span>
|
202
|
+
</pre>
|
203
|
+
</div>
|
204
|
+
</div>
|
205
|
+
</div>
|
206
|
+
|
207
|
+
<div id="method-M000013" class="method-detail">
|
208
|
+
<a name="M000013"></a>
|
209
|
+
|
210
|
+
<div class="method-heading">
|
211
|
+
<a href="#M000013" class="method-signature">
|
212
|
+
<span class="method-name">transform</span><span class="method-args">(xml)</span>
|
213
|
+
</a>
|
214
|
+
</div>
|
215
|
+
|
216
|
+
<div class="method-description">
|
217
|
+
<p><a class="source-toggle" href="#"
|
218
|
+
onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
|
219
|
+
<div class="method-source-code" id="M000013-source">
|
220
|
+
<pre>
|
221
|
+
<span class="ruby-comment cmt"># File lib/excesselt/stylesheet.rb, line 17</span>
|
222
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">transform</span>(<span class="ruby-identifier">xml</span>)
|
223
|
+
<span class="ruby-identifier">generate_element</span>(<span class="ruby-constant">Nokogiri</span><span class="ruby-operator">::</span><span class="ruby-constant">XML</span>(<span class="ruby-identifier">xml</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-keyword kw">nil</span>, <span class="ruby-constant">Nokogiri</span><span class="ruby-operator">::</span><span class="ruby-constant">XML</span><span class="ruby-operator">::</span><span class="ruby-constant">ParseOptions</span>.<span class="ruby-identifier">new</span>).<span class="ruby-identifier">root</span>)
|
224
|
+
<span class="ruby-keyword kw">end</span>
|
225
|
+
</pre>
|
226
|
+
</div>
|
227
|
+
</div>
|
228
|
+
</div>
|
229
|
+
|
230
|
+
|
231
|
+
</div>
|
232
|
+
|
233
|
+
|
234
|
+
</div>
|
235
|
+
|
236
|
+
|
237
|
+
<div id="validator-badges">
|
238
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
239
|
+
</div>
|
240
|
+
|
241
|
+
</body>
|
242
|
+
</html>
|
@@ -0,0 +1,138 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Module: Excesselt</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">Excesselt</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/lib/excesselt/element_wrapper_rb.html">
|
59
|
+
lib/excesselt/element_wrapper.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
<a href="../files/lib/excesselt/rule_rb.html">
|
63
|
+
lib/excesselt/rule.rb
|
64
|
+
</a>
|
65
|
+
<br />
|
66
|
+
<a href="../files/lib/excesselt/stylesheet_rb.html">
|
67
|
+
lib/excesselt/stylesheet.rb
|
68
|
+
</a>
|
69
|
+
<br />
|
70
|
+
<a href="../files/lib/excesselt_rb.html">
|
71
|
+
lib/excesselt.rb
|
72
|
+
</a>
|
73
|
+
<br />
|
74
|
+
</td>
|
75
|
+
</tr>
|
76
|
+
|
77
|
+
</table>
|
78
|
+
</div>
|
79
|
+
<!-- banner header -->
|
80
|
+
|
81
|
+
<div id="bodyContent">
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
<div id="contextContent">
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
|
92
|
+
</div>
|
93
|
+
|
94
|
+
|
95
|
+
<!-- if includes -->
|
96
|
+
|
97
|
+
<div id="section">
|
98
|
+
|
99
|
+
<div id="class-list">
|
100
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
101
|
+
|
102
|
+
Class <a href="Excesselt/ElementWrapper.html" class="link">Excesselt::ElementWrapper</a><br />
|
103
|
+
Class <a href="Excesselt/Rule.html" class="link">Excesselt::Rule</a><br />
|
104
|
+
Class <a href="Excesselt/Stylesheet.html" class="link">Excesselt::Stylesheet</a><br />
|
105
|
+
|
106
|
+
</div>
|
107
|
+
|
108
|
+
<div id="constants-list">
|
109
|
+
<h3 class="section-bar">Constants</h3>
|
110
|
+
|
111
|
+
<div class="name-list">
|
112
|
+
<table summary="Constants">
|
113
|
+
<tr class="top-aligned-row context-row">
|
114
|
+
<td class="context-item-name">VERSION</td>
|
115
|
+
<td>=</td>
|
116
|
+
<td class="context-item-value">'1.0.0'</td>
|
117
|
+
</tr>
|
118
|
+
</table>
|
119
|
+
</div>
|
120
|
+
</div>
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
|
126
|
+
|
127
|
+
<!-- if method_list -->
|
128
|
+
|
129
|
+
|
130
|
+
</div>
|
131
|
+
|
132
|
+
|
133
|
+
<div id="validator-badges">
|
134
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
135
|
+
</div>
|
136
|
+
|
137
|
+
</body>
|
138
|
+
</html>
|
data/rdoc/created.rid
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Mon, 08 Nov 2010 17:25:04 +1100
|
@@ -0,0 +1,199 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>File: README.md</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="fileHeader">
|
50
|
+
<h1>README.md</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>README.md
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Mon Nov 08 16:52:13 +1100 2010</td>
|
60
|
+
</tr>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
<div id="description">
|
72
|
+
<p>
|
73
|
+
# <a href="../classes/Excesselt.html">Excesselt</a>
|
74
|
+
</p>
|
75
|
+
<p>
|
76
|
+
<a
|
77
|
+
href="http://github.com/DanielHeath/excesselt">github.com/DanielHeath/excesselt</a>
|
78
|
+
</p>
|
79
|
+
<p>
|
80
|
+
## DESCRIPTION:
|
81
|
+
</p>
|
82
|
+
<p>
|
83
|
+
<a href="../classes/Excesselt.html">Excesselt</a> is a ruby library that I
|
84
|
+
built because I hate XSLT.
|
85
|
+
</p>
|
86
|
+
<p>
|
87
|
+
I‘ve extracted it from an app I built for my work at Lonely Planet.
|
88
|
+
</p>
|
89
|
+
<p>
|
90
|
+
<a href="../classes/Excesselt.html">Excesselt</a> solves the same problem
|
91
|
+
as XSLT does (that is, how can I transform this xml document into some
|
92
|
+
other format).
|
93
|
+
</p>
|
94
|
+
<p>
|
95
|
+
## FEATURES/PROBLEMS:
|
96
|
+
</p>
|
97
|
+
<p>
|
98
|
+
Nice syntax. Testable, reusable xml transformation Tested on REE 1.8.7 -
|
99
|
+
TODO test on more platforms and update this section
|
100
|
+
</p>
|
101
|
+
<p>
|
102
|
+
## SYNOPSIS:
|
103
|
+
</p>
|
104
|
+
<pre>
|
105
|
+
class MyStylesheet < Excesselt::Stylesheet
|
106
|
+
def rules
|
107
|
+
render('parent > child') { builder.p(:style => "child_content" ) { child_content } }
|
108
|
+
render('parent') { builder.p(:style => "parent_content") { child_content } }
|
109
|
+
render('text()') { add element.to_xml.upcase }
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
MyStylesheet.transform <<-XML
|
114
|
+
<parent>
|
115
|
+
<child>Use Excesselt</child>
|
116
|
+
</parent>
|
117
|
+
XML
|
118
|
+
-> <p style="parent_content"><p style="child_content">USE EXCESSELT</p></p>
|
119
|
+
</pre>
|
120
|
+
<p>
|
121
|
+
## REQUIREMENTS:
|
122
|
+
</p>
|
123
|
+
<ul>
|
124
|
+
<li>Nokogiri, Builder
|
125
|
+
|
126
|
+
</li>
|
127
|
+
</ul>
|
128
|
+
<p>
|
129
|
+
## INSTALL:
|
130
|
+
</p>
|
131
|
+
<ul>
|
132
|
+
<li>gem install excesselt
|
133
|
+
|
134
|
+
</li>
|
135
|
+
</ul>
|
136
|
+
<p>
|
137
|
+
## LICENSE:
|
138
|
+
</p>
|
139
|
+
<p>
|
140
|
+
(The MIT License)
|
141
|
+
</p>
|
142
|
+
<p>
|
143
|
+
Copyright (c) 2010 Daniel Heath
|
144
|
+
</p>
|
145
|
+
<p>
|
146
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
147
|
+
copy of this software and associated documentation files (the
|
148
|
+
‘Software’), to deal in the Software without restriction,
|
149
|
+
including without limitation the rights to use, copy, modify, merge,
|
150
|
+
publish, distribute, sublicense, and/or sell copies of the Software, and to
|
151
|
+
permit persons to whom the Software is furnished to do so, subject to the
|
152
|
+
following conditions:
|
153
|
+
</p>
|
154
|
+
<p>
|
155
|
+
The above copyright notice and this permission notice shall be included in
|
156
|
+
all copies or substantial portions of the Software.
|
157
|
+
</p>
|
158
|
+
<p>
|
159
|
+
THE SOFTWARE IS PROVIDED ‘AS IS’, WITHOUT WARRANTY OF ANY KIND,
|
160
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
161
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
162
|
+
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
163
|
+
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
164
|
+
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
165
|
+
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
166
|
+
</p>
|
167
|
+
|
168
|
+
</div>
|
169
|
+
|
170
|
+
|
171
|
+
</div>
|
172
|
+
|
173
|
+
|
174
|
+
</div>
|
175
|
+
|
176
|
+
|
177
|
+
<!-- if includes -->
|
178
|
+
|
179
|
+
<div id="section">
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
<!-- if method_list -->
|
189
|
+
|
190
|
+
|
191
|
+
</div>
|
192
|
+
|
193
|
+
|
194
|
+
<div id="validator-badges">
|
195
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
196
|
+
</div>
|
197
|
+
|
198
|
+
</body>
|
199
|
+
</html>
|
@@ -0,0 +1,101 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>File: element_wrapper.rb</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="fileHeader">
|
50
|
+
<h1>element_wrapper.rb</h1>
|
51
|
+
<table class="header-table">
|
52
|
+
<tr class="top-aligned-row">
|
53
|
+
<td><strong>Path:</strong></td>
|
54
|
+
<td>lib/excesselt/element_wrapper.rb
|
55
|
+
</td>
|
56
|
+
</tr>
|
57
|
+
<tr class="top-aligned-row">
|
58
|
+
<td><strong>Last Update:</strong></td>
|
59
|
+
<td>Mon Nov 08 16:35:09 +1100 2010</td>
|
60
|
+
</tr>
|
61
|
+
</table>
|
62
|
+
</div>
|
63
|
+
<!-- banner header -->
|
64
|
+
|
65
|
+
<div id="bodyContent">
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
<div id="contextContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
</div>
|
74
|
+
|
75
|
+
|
76
|
+
</div>
|
77
|
+
|
78
|
+
|
79
|
+
<!-- if includes -->
|
80
|
+
|
81
|
+
<div id="section">
|
82
|
+
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
<!-- if method_list -->
|
91
|
+
|
92
|
+
|
93
|
+
</div>
|
94
|
+
|
95
|
+
|
96
|
+
<div id="validator-badges">
|
97
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
98
|
+
</div>
|
99
|
+
|
100
|
+
</body>
|
101
|
+
</html>
|