kwartz 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +340 -0
- data/ChangeLog +103 -0
- data/README.txt +37 -0
- data/bin/kwartz +12 -0
- data/doc-api/classes/Kwartz.html +218 -0
- data/doc-api/classes/Kwartz/Assertion.html +140 -0
- data/doc-api/classes/Kwartz/AssertionError.html +148 -0
- data/doc-api/classes/Kwartz/AttrInfo.html +320 -0
- data/doc-api/classes/Kwartz/BaseError.html +206 -0
- data/doc-api/classes/Kwartz/BaseTranslator.html +331 -0
- data/doc-api/classes/Kwartz/CharacterType.html +212 -0
- data/doc-api/classes/Kwartz/CommandOptionError.html +154 -0
- data/doc-api/classes/Kwartz/CommandOptions.html +374 -0
- data/doc-api/classes/Kwartz/Config.html +150 -0
- data/doc-api/classes/Kwartz/ConvertError.html +191 -0
- data/doc-api/classes/Kwartz/Converter.html +252 -0
- data/doc-api/classes/Kwartz/CssStyleParser.html +483 -0
- data/doc-api/classes/Kwartz/DocumentRuleset.html +369 -0
- data/doc-api/classes/Kwartz/ElementExpander.html +325 -0
- data/doc-api/classes/Kwartz/ElementInfo.html +312 -0
- data/doc-api/classes/Kwartz/ElementRuleset.html +582 -0
- data/doc-api/classes/Kwartz/EperlHandler.html +338 -0
- data/doc-api/classes/Kwartz/EperlTranslator.html +167 -0
- data/doc-api/classes/Kwartz/ErubisHandler.html +113 -0
- data/doc-api/classes/Kwartz/ErubisTranslator.html +168 -0
- data/doc-api/classes/Kwartz/ErubyHandler.html +337 -0
- data/doc-api/classes/Kwartz/ErubyTranslator.html +167 -0
- data/doc-api/classes/Kwartz/ExpandStatement.html +227 -0
- data/doc-api/classes/Kwartz/Expression.html +119 -0
- data/doc-api/classes/Kwartz/Handler.html +558 -0
- data/doc-api/classes/Kwartz/JstlHandler.html +657 -0
- data/doc-api/classes/Kwartz/JstlTranslator.html +226 -0
- data/doc-api/classes/Kwartz/KwartzError.html +146 -0
- data/doc-api/classes/Kwartz/Main.html +384 -0
- data/doc-api/classes/Kwartz/NativeExpression.html +236 -0
- data/doc-api/classes/Kwartz/NativeStatement.html +254 -0
- data/doc-api/classes/Kwartz/Node.html +156 -0
- data/doc-api/classes/Kwartz/ParseError.html +148 -0
- data/doc-api/classes/Kwartz/PhpHandler.html +333 -0
- data/doc-api/classes/Kwartz/PhpTranslator.html +194 -0
- data/doc-api/classes/Kwartz/PresentationLogicParser.html +830 -0
- data/doc-api/classes/Kwartz/PrintStatement.html +221 -0
- data/doc-api/classes/Kwartz/RailsHandler.html +587 -0
- data/doc-api/classes/Kwartz/RailsTranslator.html +167 -0
- data/doc-api/classes/Kwartz/RubyStyleParser.html +558 -0
- data/doc-api/classes/Kwartz/Ruleset.html +117 -0
- data/doc-api/classes/Kwartz/Statement.html +119 -0
- data/doc-api/classes/Kwartz/StrutsTranslator.html +190 -0
- data/doc-api/classes/Kwartz/TagInfo.html +314 -0
- data/doc-api/classes/Kwartz/TextConverter.html +270 -0
- data/doc-api/classes/Kwartz/Translator.html +318 -0
- data/doc-api/classes/Test.html +107 -0
- data/doc-api/classes/Test/Unit.html +101 -0
- data/doc-api/created.rid +1 -0
- data/doc-api/files/__/README_txt.html +150 -0
- data/doc-api/files/kwartz/assert_rb.html +114 -0
- data/doc-api/files/kwartz/binding/eperl_rb.html +116 -0
- data/doc-api/files/kwartz/binding/erubis_rb.html +116 -0
- data/doc-api/files/kwartz/binding/eruby_rb.html +115 -0
- data/doc-api/files/kwartz/binding/jstl_rb.html +116 -0
- data/doc-api/files/kwartz/binding/php_rb.html +116 -0
- data/doc-api/files/kwartz/binding/rails_rb.html +115 -0
- data/doc-api/files/kwartz/binding/struts_rb.html +117 -0
- data/doc-api/files/kwartz/config_rb.html +107 -0
- data/doc-api/files/kwartz/converter_rb.html +119 -0
- data/doc-api/files/kwartz/error_rb.html +107 -0
- data/doc-api/files/kwartz/main_rb.html +124 -0
- data/doc-api/files/kwartz/node_rb.html +114 -0
- data/doc-api/files/kwartz/parser_rb.html +117 -0
- data/doc-api/files/kwartz/translator_rb.html +115 -0
- data/doc-api/files/kwartz/util/assert-text-equal_rb.html +115 -0
- data/doc-api/files/kwartz/util/testcase-helper_rb.html +115 -0
- data/doc-api/files/kwartz_rb.html +120 -0
- data/doc-api/fr_class_index.html +75 -0
- data/doc-api/fr_file_index.html +45 -0
- data/doc-api/fr_method_index.html +216 -0
- data/doc-api/index.html +24 -0
- data/doc-api/rdoc-style.css +208 -0
- data/doc/docstyle.css +188 -0
- data/doc/p-pattern.html +1207 -0
- data/doc/reference.html +3396 -0
- data/doc/users-guide.html +1670 -0
- data/examples/breadcrumbs1/Makefile +15 -0
- data/examples/breadcrumbs1/breadcrumbs.eruby.plogic +27 -0
- data/examples/breadcrumbs1/breadcrumbs.html +12 -0
- data/examples/breadcrumbs1/breadcrumbs.jstl.plogic +28 -0
- data/examples/breadcrumbs1/breadcrumbs.php.plogic +26 -0
- data/examples/breadcrumbs1/main.php +12 -0
- data/examples/breadcrumbs1/main.rb +12 -0
- data/examples/breadcrumbs2/Makefile +15 -0
- data/examples/breadcrumbs2/breadcrumbs.eruby.plogic +22 -0
- data/examples/breadcrumbs2/breadcrumbs.html +14 -0
- data/examples/breadcrumbs2/breadcrumbs.jstl.plogic +24 -0
- data/examples/breadcrumbs2/breadcrumbs.php.plogic +23 -0
- data/examples/breadcrumbs2/main.php +12 -0
- data/examples/breadcrumbs2/main.rb +12 -0
- data/examples/pagelayout/Makefile +47 -0
- data/examples/pagelayout/content.eruby.plogic +44 -0
- data/examples/pagelayout/content.jstl.plogic +36 -0
- data/examples/pagelayout/content.php.plogic +37 -0
- data/examples/pagelayout/content1.html +36 -0
- data/examples/pagelayout/content2.html +29 -0
- data/examples/pagelayout/design.css +40 -0
- data/examples/pagelayout/layout.html +50 -0
- data/examples/pagelayout/main.php +55 -0
- data/examples/pagelayout/main.rb +77 -0
- data/examples/pagelayout/menu.eruby.plogic +14 -0
- data/examples/pagelayout/menu.html +13 -0
- data/examples/pagelayout/menu.jstl.plogic +14 -0
- data/examples/pagelayout/menu.php.plogic +14 -0
- data/examples/rails1/Makefile +36 -0
- data/examples/rails1/README +19 -0
- data/examples/rails1/application_helper.rb +31 -0
- data/examples/rails1/edit.html +28 -0
- data/examples/rails1/edit.plogic +10 -0
- data/examples/rails1/form.html +52 -0
- data/examples/rails1/form.plogic +33 -0
- data/examples/rails1/layout.plogic +15 -0
- data/examples/rails1/link_to.plogic +19 -0
- data/examples/rails1/list.html +48 -0
- data/examples/rails1/list.plogic +28 -0
- data/examples/rails1/new.html +27 -0
- data/examples/rails1/new.plogic +10 -0
- data/examples/rails1/reader.plogic +29 -0
- data/examples/rails1/show.html +40 -0
- data/examples/rails1/show.plogic +4 -0
- data/examples/rails1/writer.plogic +8 -0
- data/examples/table1/Makefile +15 -0
- data/examples/table1/main.php +11 -0
- data/examples/table1/main.rb +11 -0
- data/examples/table1/table1.eruby.plogic +21 -0
- data/examples/table1/table1.html +16 -0
- data/examples/table1/table1.jstl.plogic +21 -0
- data/examples/table1/table1.php.plogic +22 -0
- data/kwartz.gemspec +55 -0
- data/lib/kwartz.rb +13 -0
- data/lib/kwartz/assert.rb +31 -0
- data/lib/kwartz/binding/eperl.rb +166 -0
- data/lib/kwartz/binding/erubis.rb +61 -0
- data/lib/kwartz/binding/eruby.rb +164 -0
- data/lib/kwartz/binding/jstl.rb +334 -0
- data/lib/kwartz/binding/php.rb +167 -0
- data/lib/kwartz/binding/rails.rb +295 -0
- data/lib/kwartz/binding/struts.rb +109 -0
- data/lib/kwartz/config.rb +28 -0
- data/lib/kwartz/converter.rb +920 -0
- data/lib/kwartz/error.rb +41 -0
- data/lib/kwartz/main.rb +464 -0
- data/lib/kwartz/node.rb +454 -0
- data/lib/kwartz/parser.rb +903 -0
- data/lib/kwartz/translator.rb +153 -0
- data/lib/kwartz/util/assert-text-equal.rb +44 -0
- data/lib/kwartz/util/testcase-helper.rb +112 -0
- data/setup.rb +1331 -0
- data/test/test-compile.rb +36 -0
- data/test/test-compile.yaml +178 -0
- data/test/test-converter.rb +34 -0
- data/test/test-converter.yaml +127 -0
- data/test/test-directives.rb +32 -0
- data/test/test-directives.yaml +1411 -0
- data/test/test-main.rb +464 -0
- data/test/test-parser.rb +54 -0
- data/test/test-parser.yaml +394 -0
- data/test/test-rails.rb +28 -0
- data/test/test-rails.yaml +301 -0
- data/test/test-ruleset.rb +36 -0
- data/test/test-ruleset.yaml +804 -0
- data/test/test.rb +44 -0
- metadata +236 -0
@@ -0,0 +1,221 @@
|
|
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: Kwartz::PrintStatement</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">Kwartz::PrintStatement</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/kwartz/node_rb.html">
|
59
|
+
kwartz/node.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
|
+
<a href="Statement.html">
|
69
|
+
Statement
|
70
|
+
</a>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
</table>
|
74
|
+
</div>
|
75
|
+
<!-- banner header -->
|
76
|
+
|
77
|
+
<div id="bodyContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<div id="contextContent">
|
82
|
+
|
83
|
+
<div id="description">
|
84
|
+
<p>
|
85
|
+
represents print statement for String and <a
|
86
|
+
href="NativeExpression.html">NativeExpression</a>
|
87
|
+
</p>
|
88
|
+
|
89
|
+
</div>
|
90
|
+
|
91
|
+
|
92
|
+
</div>
|
93
|
+
|
94
|
+
<div id="method-list">
|
95
|
+
<h3 class="section-bar">Methods</h3>
|
96
|
+
|
97
|
+
<div class="name-list">
|
98
|
+
<a href="#M000046">_inspect</a>
|
99
|
+
<a href="#M000047">accept</a>
|
100
|
+
<a href="#M000045">new</a>
|
101
|
+
</div>
|
102
|
+
</div>
|
103
|
+
|
104
|
+
</div>
|
105
|
+
|
106
|
+
|
107
|
+
<!-- if includes -->
|
108
|
+
|
109
|
+
<div id="section">
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
<div id="attribute-list">
|
116
|
+
<h3 class="section-bar">Attributes</h3>
|
117
|
+
|
118
|
+
<div class="name-list">
|
119
|
+
<table>
|
120
|
+
<tr class="top-aligned-row context-row">
|
121
|
+
<td class="context-item-name">args</td>
|
122
|
+
<td class="context-item-value"> [R] </td>
|
123
|
+
<td class="context-item-desc"></td>
|
124
|
+
</tr>
|
125
|
+
</table>
|
126
|
+
</div>
|
127
|
+
</div>
|
128
|
+
|
129
|
+
|
130
|
+
|
131
|
+
<!-- if method_list -->
|
132
|
+
<div id="methods">
|
133
|
+
<h3 class="section-bar">Public Class methods</h3>
|
134
|
+
|
135
|
+
<div id="method-M000045" class="method-detail">
|
136
|
+
<a name="M000045"></a>
|
137
|
+
|
138
|
+
<div class="method-heading">
|
139
|
+
<a href="#M000045" class="method-signature">
|
140
|
+
<span class="method-name">new</span><span class="method-args">(args)</span>
|
141
|
+
</a>
|
142
|
+
</div>
|
143
|
+
|
144
|
+
<div class="method-description">
|
145
|
+
<p><a class="source-toggle" href="#"
|
146
|
+
onclick="toggleCode('M000045-source');return false;">[Source]</a></p>
|
147
|
+
<div class="method-source-code" id="M000045-source">
|
148
|
+
<pre>
|
149
|
+
<span class="ruby-comment cmt"># File kwartz/node.rb, line 179</span>
|
150
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">args</span>)
|
151
|
+
<span class="ruby-ivar">@args</span> = <span class="ruby-identifier">args</span> <span class="ruby-comment cmt"># array</span>
|
152
|
+
<span class="ruby-keyword kw">end</span>
|
153
|
+
</pre>
|
154
|
+
</div>
|
155
|
+
</div>
|
156
|
+
</div>
|
157
|
+
|
158
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
159
|
+
|
160
|
+
<div id="method-M000046" class="method-detail">
|
161
|
+
<a name="M000046"></a>
|
162
|
+
|
163
|
+
<div class="method-heading">
|
164
|
+
<a href="#M000046" class="method-signature">
|
165
|
+
<span class="method-name">_inspect</span><span class="method-args">(indent=0)</span>
|
166
|
+
</a>
|
167
|
+
</div>
|
168
|
+
|
169
|
+
<div class="method-description">
|
170
|
+
<p><a class="source-toggle" href="#"
|
171
|
+
onclick="toggleCode('M000046-source');return false;">[Source]</a></p>
|
172
|
+
<div class="method-source-code" id="M000046-source">
|
173
|
+
<pre>
|
174
|
+
<span class="ruby-comment cmt"># File kwartz/node.rb, line 185</span>
|
175
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">_inspect</span>(<span class="ruby-identifier">indent</span>=<span class="ruby-value">0</span>)
|
176
|
+
<span class="ruby-identifier">list</span> = <span class="ruby-ivar">@args</span>.<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
|
177
|
+
<span class="ruby-identifier">arg</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">NativeExpression</span>) <span class="ruby-operator">?</span> <span class="ruby-node">"<%=#{arg.code}%>"</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">inspect</span>
|
178
|
+
}
|
179
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-value str">"[ "</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">list</span>.<span class="ruby-identifier">join</span>(<span class="ruby-value str">', '</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">"]"</span>
|
180
|
+
<span class="ruby-keyword kw">end</span>
|
181
|
+
</pre>
|
182
|
+
</div>
|
183
|
+
</div>
|
184
|
+
</div>
|
185
|
+
|
186
|
+
<div id="method-M000047" class="method-detail">
|
187
|
+
<a name="M000047"></a>
|
188
|
+
|
189
|
+
<div class="method-heading">
|
190
|
+
<a href="#M000047" class="method-signature">
|
191
|
+
<span class="method-name">accept</span><span class="method-args">(translator)</span>
|
192
|
+
</a>
|
193
|
+
</div>
|
194
|
+
|
195
|
+
<div class="method-description">
|
196
|
+
<p><a class="source-toggle" href="#"
|
197
|
+
onclick="toggleCode('M000047-source');return false;">[Source]</a></p>
|
198
|
+
<div class="method-source-code" id="M000047-source">
|
199
|
+
<pre>
|
200
|
+
<span class="ruby-comment cmt"># File kwartz/node.rb, line 193</span>
|
201
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">accept</span>(<span class="ruby-identifier">translator</span>)
|
202
|
+
<span class="ruby-identifier">translator</span>.<span class="ruby-identifier">translate_print_stmt</span>(<span class="ruby-keyword kw">self</span>)
|
203
|
+
<span class="ruby-keyword kw">end</span>
|
204
|
+
</pre>
|
205
|
+
</div>
|
206
|
+
</div>
|
207
|
+
</div>
|
208
|
+
|
209
|
+
|
210
|
+
</div>
|
211
|
+
|
212
|
+
|
213
|
+
</div>
|
214
|
+
|
215
|
+
|
216
|
+
<div id="validator-badges">
|
217
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
218
|
+
</div>
|
219
|
+
|
220
|
+
</body>
|
221
|
+
</html>
|
@@ -0,0 +1,587 @@
|
|
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: Kwartz::RailsHandler</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">Kwartz::RailsHandler</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../files/kwartz/binding/rails_rb.html">
|
59
|
+
kwartz/binding/rails.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
|
+
<a href="ErubyHandler.html">
|
69
|
+
ErubyHandler
|
70
|
+
</a>
|
71
|
+
</td>
|
72
|
+
</tr>
|
73
|
+
</table>
|
74
|
+
</div>
|
75
|
+
<!-- banner header -->
|
76
|
+
|
77
|
+
<div id="bodyContent">
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
<div id="contextContent">
|
82
|
+
|
83
|
+
<div id="description">
|
84
|
+
<p>
|
85
|
+
directive handler for Rails
|
86
|
+
</p>
|
87
|
+
<p>
|
88
|
+
ex.
|
89
|
+
</p>
|
90
|
+
<pre>
|
91
|
+
converter = Converter.new(pdata, decls, :handler=>RailsDirectiveHandler.new)
|
92
|
+
</pre>
|
93
|
+
<p>
|
94
|
+
directive examples.
|
95
|
+
</p>
|
96
|
+
<pre>
|
97
|
+
## text_field, password_field
|
98
|
+
<input type="text" size="10" maxsize="20" title="text_field 'user', 'name'">
|
99
|
+
=> <%= text_field 'user', 'name', :size=>10, :maxsize=>20 %>
|
100
|
+
<input type="text" name="user[name]" title="text_field :size=>10">
|
101
|
+
=> <%= text_field "user", "name", :size=>10 %>
|
102
|
+
<input type="text" id="user_name" size="10" title="text_field">
|
103
|
+
=> <%= text_field "user", "name", :size=>10 %>
|
104
|
+
|
105
|
+
## link_to, link_to_remote
|
106
|
+
<a href="#" title="link_to :action=>'list'">Show list</a>
|
107
|
+
=> <%= link_to 'Show list', :action=>'list' %>
|
108
|
+
|
109
|
+
## start_link_to, start_link_to_remote
|
110
|
+
<a href="#" title="start_link_to :action=>'list'">Show list</a>
|
111
|
+
=> <%= start_link_to 'action'=>'list' %>Show list</a>
|
112
|
+
|
113
|
+
## mail_to
|
114
|
+
<a href="mail:www@example.com" title="mail_to">admin</a>
|
115
|
+
=> <%= mail_to "www@example.com", "admin" %>
|
116
|
+
|
117
|
+
## form_tag
|
118
|
+
<form action="show" title="form_tag :id=>2"> ... </form>
|
119
|
+
=> <%= form_tag :action=>"show", :id=>2 %> ... </form>
|
120
|
+
|
121
|
+
## submit_tag
|
122
|
+
<input type="submit" value="OK" title="submit_tag">
|
123
|
+
=> <%= submit_tag "OK" %>
|
124
|
+
|
125
|
+
## text_area
|
126
|
+
<textarea cols="30" rows="3" id="user_desc" title="text_area"></textarea>
|
127
|
+
=> <%= text_area "user", "desc", :cols=>30, :rows=>3 %>
|
128
|
+
<textarea cols="30" rows="3" name="user[desc]" title="text_area"></textarea>
|
129
|
+
=> <%= text_area "user", "desc", :cols=>30, :rows=>3 %>
|
130
|
+
|
131
|
+
## hidden_field
|
132
|
+
<input type="hidden" id="user_id" title="hidden_field">
|
133
|
+
=> <%= hidden_field "user", "id" %>
|
134
|
+
<input type="hidden" name="user[id]" title="hidden_field">
|
135
|
+
=> <%= hidden_field "user", "id" %>
|
136
|
+
|
137
|
+
## check_box
|
138
|
+
<input type="checkbox" id="user_chk1" title="check_box">
|
139
|
+
=> <%= check_box "user", "chk1" %>
|
140
|
+
<input type="checkbox" name="user[chk2]" title="check_box">
|
141
|
+
=> <%= check_box "user", "chk2" %>
|
142
|
+
|
143
|
+
## radio_button
|
144
|
+
<input type="radio" id="user_radio" value="val1" title="radio_button">
|
145
|
+
=> <%= radio_button "user", "radio", "val1" %>
|
146
|
+
<input type="radio" name="user[radio]" value="val2" title="radio_button">
|
147
|
+
=> <%= radio_button "user", "radio", "val2" %>
|
148
|
+
|
149
|
+
## select, collection_select, country_select, time_zone_select, date_select, datetime_select
|
150
|
+
<select name="user[birth]" title="date_select :start_year=>1970">
|
151
|
+
<option value="2000">2000</option>
|
152
|
+
</select>
|
153
|
+
=> <% date_select "user", "birth", :start_year=>1970 %>
|
154
|
+
|
155
|
+
## image_tag, link_image_to, link_to_image
|
156
|
+
<img src="foo.gif" alt="text" width="20" heigth="10" title="image_tag :size=>'30x40'">
|
157
|
+
=> <%= image_tag "foo.gif", :alt=>"text", :size=>'30x40' %>
|
158
|
+
</pre>
|
159
|
+
|
160
|
+
</div>
|
161
|
+
|
162
|
+
|
163
|
+
</div>
|
164
|
+
|
165
|
+
<div id="method-list">
|
166
|
+
<h3 class="section-bar">Methods</h3>
|
167
|
+
|
168
|
+
<div class="name-list">
|
169
|
+
<a href="#M000165">add_directive_attr_as_arg</a>
|
170
|
+
<a href="#M000166">add_directive_attr_as_option</a>
|
171
|
+
<a href="#M000167">add_directive_content_as_arg</a>
|
172
|
+
<a href="#M000169">add_directive_expr_option</a>
|
173
|
+
<a href="#M000168">add_directive_integer_option</a>
|
174
|
+
<a href="#M000163">add_directive_object_and_method</a>
|
175
|
+
<a href="#M000164">add_directive_object_and_method_and_value</a>
|
176
|
+
<a href="#M000170">add_directive_str_option</a>
|
177
|
+
<a href="#M000161">handle</a>
|
178
|
+
<a href="#M000171">print_directive</a>
|
179
|
+
<a href="#M000162">quote</a>
|
180
|
+
</div>
|
181
|
+
</div>
|
182
|
+
|
183
|
+
</div>
|
184
|
+
|
185
|
+
|
186
|
+
<!-- if includes -->
|
187
|
+
|
188
|
+
<div id="section">
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
<!-- if method_list -->
|
198
|
+
<div id="methods">
|
199
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
200
|
+
|
201
|
+
<div id="method-M000161" class="method-detail">
|
202
|
+
<a name="M000161"></a>
|
203
|
+
|
204
|
+
<div class="method-heading">
|
205
|
+
<a href="#M000161" class="method-signature">
|
206
|
+
<span class="method-name">handle</span><span class="method-args">(directive_name, directive_arg, directive_str, stag_info, etag_info, cont_stmts, attr_info, append_exprs, stmt_list)</span>
|
207
|
+
</a>
|
208
|
+
</div>
|
209
|
+
|
210
|
+
<div class="method-description">
|
211
|
+
<p>
|
212
|
+
handle directives for rails.
|
213
|
+
</p>
|
214
|
+
<p>
|
215
|
+
everytime return true whenever directive name is unknown.
|
216
|
+
</p>
|
217
|
+
<p><a class="source-toggle" href="#"
|
218
|
+
onclick="toggleCode('M000161-source');return false;">[Source]</a></p>
|
219
|
+
<div class="method-source-code" id="M000161-source">
|
220
|
+
<pre>
|
221
|
+
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line 96</span>
|
222
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle</span>(<span class="ruby-identifier">directive_name</span>, <span class="ruby-identifier">directive_arg</span>, <span class="ruby-identifier">directive_str</span>, <span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">etag_info</span>, <span class="ruby-identifier">cont_stmts</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-identifier">append_exprs</span>, <span class="ruby-identifier">stmt_list</span>)
|
223
|
+
<span class="ruby-identifier">ret</span> = <span class="ruby-keyword kw">super</span>
|
224
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">ret</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ret</span>
|
225
|
+
|
226
|
+
<span class="ruby-identifier">d_name</span> = <span class="ruby-identifier">directive_name</span>
|
227
|
+
<span class="ruby-identifier">d_arg</span> = <span class="ruby-identifier">directive_arg</span>
|
228
|
+
<span class="ruby-identifier">d_str</span> = <span class="ruby-identifier">directive_str</span>
|
229
|
+
|
230
|
+
<span class="ruby-comment cmt">## parse 'name="user[name]"' or 'id="user_name"'</span>
|
231
|
+
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">directive_name</span>.<span class="ruby-identifier">to_s</span>
|
232
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/(_|\A)radio_button\z/</span>
|
233
|
+
<span class="ruby-identifier">add_directive_object_and_method_and_value</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">attr_info</span>)
|
234
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/_field\z/</span>, <span class="ruby-regexp re">/_area\z/</span>, <span class="ruby-regexp re">/_box\z/</span>, <span class="ruby-regexp re">/(_|\A)select\z/</span>, <span class="ruby-value str">'input'</span>
|
235
|
+
<span class="ruby-identifier">add_directive_object_and_method</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">attr_info</span>)
|
236
|
+
<span class="ruby-keyword kw">end</span>
|
237
|
+
|
238
|
+
<span class="ruby-comment cmt">## replace whole element, or only start tag</span>
|
239
|
+
<span class="ruby-identifier">replace_elem</span> = <span class="ruby-identifier">directive_name</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">!~</span> <span class="ruby-regexp re">/\Astart_/</span>
|
240
|
+
|
241
|
+
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">directive_name</span>
|
242
|
+
|
243
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:text_field</span>, <span class="ruby-identifier">:password_field</span>, <span class="ruby-identifier">:hidden_field</span>
|
244
|
+
<span class="ruby-comment cmt">#add_directive_object_and_method(d_arg, attr_info)</span>
|
245
|
+
<span class="ruby-identifier">add_directive_integer_option</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-value str">'size'</span>, <span class="ruby-identifier">attr_info</span>[<span class="ruby-value str">'size'</span>])
|
246
|
+
<span class="ruby-identifier">add_directive_integer_option</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-value str">'maxsize'</span>, <span class="ruby-identifier">attr_info</span>[<span class="ruby-value str">'maxsize'</span>])
|
247
|
+
|
248
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:file_field</span>
|
249
|
+
<span class="ruby-comment cmt">#add_directive_object_and_method(d_arg, attr_info)</span>
|
250
|
+
<span class="ruby-identifier">add_directive_integer_option</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-value str">'size'</span>, <span class="ruby-identifier">attr_info</span>[<span class="ruby-value str">'size'</span>])
|
251
|
+
|
252
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:link_to</span>, <span class="ruby-identifier">:link_to_remote</span>, <span class="ruby-identifier">:link_to_unless_current</span>
|
253
|
+
<span class="ruby-identifier">add_directive_content_as_arg</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">cont_stmts</span>)
|
254
|
+
|
255
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:anchor</span>, <span class="ruby-identifier">:anchor_remote</span>
|
256
|
+
<span class="ruby-identifier">replace_elem</span> = <span class="ruby-keyword kw">false</span>
|
257
|
+
|
258
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:mail_to</span>
|
259
|
+
<span class="ruby-identifier">add_directive_content_as_arg</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">cont_stmts</span>)
|
260
|
+
<span class="ruby-identifier">add_directive_attr_as_arg</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-value str">'href'</span>)
|
261
|
+
<span class="ruby-identifier">d_arg</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-regexp re">/\A\'mailto:/</span>, <span class="ruby-value str">"'"</span>)
|
262
|
+
|
263
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:form_tag</span>, <span class="ruby-identifier">:start_form_tag</span>
|
264
|
+
<span class="ruby-identifier">add_directive_attr_as_option</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-value str">'action'</span>)
|
265
|
+
<span class="ruby-identifier">replace_elem</span> = <span class="ruby-keyword kw">false</span>
|
266
|
+
|
267
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:text_area</span>
|
268
|
+
<span class="ruby-comment cmt">#add_directive_object_and_method(d_arg, attr_info)</span>
|
269
|
+
<span class="ruby-identifier">add_directive_integer_option</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-value str">'cols'</span>, <span class="ruby-identifier">attr_info</span>[<span class="ruby-value str">'cols'</span>])
|
270
|
+
<span class="ruby-identifier">add_directive_integer_option</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-value str">'rows'</span>, <span class="ruby-identifier">attr_info</span>[<span class="ruby-value str">'rows'</span>])
|
271
|
+
|
272
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:submit_tag</span>
|
273
|
+
<span class="ruby-identifier">add_directive_attr_as_arg</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-value str">'value'</span>)
|
274
|
+
|
275
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:submit_to_remote</span>
|
276
|
+
<span class="ruby-identifier">add_directive_attr_as_arg</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-value str">'value'</span>)
|
277
|
+
<span class="ruby-identifier">add_directive_attr_as_arg</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-value str">'name'</span>)
|
278
|
+
|
279
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:radio_button</span>
|
280
|
+
<span class="ruby-comment cmt">#add_directive_object_and_method_and_value(d_arg, attr_info)</span>
|
281
|
+
|
282
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:check_box</span>
|
283
|
+
<span class="ruby-comment cmt">#add_directive_object_and_method(d_arg, attr_info)</span>
|
284
|
+
|
285
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:select</span>, <span class="ruby-identifier">:collection_select</span>, <span class="ruby-identifier">:country_select</span>, <span class="ruby-identifier">:time_zone_select</span>, <span class="ruby-identifier">:date_select</span>, <span class="ruby-identifier">:datetime_select</span>
|
286
|
+
<span class="ruby-comment cmt">#add_directive_object_and_method(d_arg, attr_info)</span>
|
287
|
+
|
288
|
+
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:image_tag</span>, <span class="ruby-identifier">:link_image_to</span>, <span class="ruby-identifier">:link_to_image</span>
|
289
|
+
<span class="ruby-identifier">add_directive_attr_as_arg</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-value str">'src'</span>)
|
290
|
+
<span class="ruby-identifier">add_directive_str_option</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-value str">'alt'</span>, <span class="ruby-identifier">attr_info</span>[<span class="ruby-value str">'alt'</span>])
|
291
|
+
|
292
|
+
<span class="ruby-keyword kw">else</span>
|
293
|
+
|
294
|
+
<span class="ruby-keyword kw">end</span> <span class="ruby-comment cmt">#case</span>
|
295
|
+
|
296
|
+
<span class="ruby-comment cmt">##</span>
|
297
|
+
<span class="ruby-identifier">print_directive</span>(<span class="ruby-identifier">d_name</span>, <span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">etag_info</span>, <span class="ruby-identifier">cont_stmts</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">replace_elem</span>)
|
298
|
+
|
299
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-comment cmt"># everytime return true</span>
|
300
|
+
|
301
|
+
<span class="ruby-keyword kw">end</span>
|
302
|
+
</pre>
|
303
|
+
</div>
|
304
|
+
</div>
|
305
|
+
</div>
|
306
|
+
|
307
|
+
<h3 class="section-bar">Protected Instance methods</h3>
|
308
|
+
|
309
|
+
<div id="method-M000165" class="method-detail">
|
310
|
+
<a name="M000165"></a>
|
311
|
+
|
312
|
+
<div class="method-heading">
|
313
|
+
<a href="#M000165" class="method-signature">
|
314
|
+
<span class="method-name">add_directive_attr_as_arg</span><span class="method-args">(d_arg, attr_info, attr_name)</span>
|
315
|
+
</a>
|
316
|
+
</div>
|
317
|
+
|
318
|
+
<div class="method-description">
|
319
|
+
<p><a class="source-toggle" href="#"
|
320
|
+
onclick="toggleCode('M000165-source');return false;">[Source]</a></p>
|
321
|
+
<div class="method-source-code" id="M000165-source">
|
322
|
+
<pre>
|
323
|
+
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line 204</span>
|
324
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_directive_attr_as_arg</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-identifier">attr_name</span>)
|
325
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">v</span> = <span class="ruby-identifier">attr_info</span>[<span class="ruby-identifier">attr_name</span>]) <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">v</span>.<span class="ruby-identifier">empty?</span>
|
326
|
+
<span class="ruby-identifier">d_arg</span>[<span class="ruby-value">0</span>,<span class="ruby-value">0</span>] = <span class="ruby-node">"#{quote(v)}#{d_arg.empty? ? '' : ', '}"</span>
|
327
|
+
<span class="ruby-keyword kw">end</span>
|
328
|
+
<span class="ruby-keyword kw">end</span>
|
329
|
+
</pre>
|
330
|
+
</div>
|
331
|
+
</div>
|
332
|
+
</div>
|
333
|
+
|
334
|
+
<div id="method-M000166" class="method-detail">
|
335
|
+
<a name="M000166"></a>
|
336
|
+
|
337
|
+
<div class="method-heading">
|
338
|
+
<a href="#M000166" class="method-signature">
|
339
|
+
<span class="method-name">add_directive_attr_as_option</span><span class="method-args">(d_arg, attr_info, attr_name)</span>
|
340
|
+
</a>
|
341
|
+
</div>
|
342
|
+
|
343
|
+
<div class="method-description">
|
344
|
+
<p><a class="source-toggle" href="#"
|
345
|
+
onclick="toggleCode('M000166-source');return false;">[Source]</a></p>
|
346
|
+
<div class="method-source-code" id="M000166-source">
|
347
|
+
<pre>
|
348
|
+
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line 211</span>
|
349
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_directive_attr_as_option</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-identifier">attr_name</span>)
|
350
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-identifier">s</span> = <span class="ruby-identifier">attr_info</span>[<span class="ruby-identifier">attr_name</span>]) <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">d_arg</span>.<span class="ruby-identifier">index</span>(<span class="ruby-identifier">attr_name</span>)
|
351
|
+
<span class="ruby-identifier">d_arg</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">", "</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">d_arg</span>.<span class="ruby-identifier">empty?</span>
|
352
|
+
<span class="ruby-identifier">d_arg</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"'#{attr_name}'=>#{quote(s)}"</span>
|
353
|
+
<span class="ruby-keyword kw">end</span>
|
354
|
+
<span class="ruby-keyword kw">end</span>
|
355
|
+
</pre>
|
356
|
+
</div>
|
357
|
+
</div>
|
358
|
+
</div>
|
359
|
+
|
360
|
+
<div id="method-M000167" class="method-detail">
|
361
|
+
<a name="M000167"></a>
|
362
|
+
|
363
|
+
<div class="method-heading">
|
364
|
+
<a href="#M000167" class="method-signature">
|
365
|
+
<span class="method-name">add_directive_content_as_arg</span><span class="method-args">(d_arg, cont_stmts)</span>
|
366
|
+
</a>
|
367
|
+
</div>
|
368
|
+
|
369
|
+
<div class="method-description">
|
370
|
+
<p><a class="source-toggle" href="#"
|
371
|
+
onclick="toggleCode('M000167-source');return false;">[Source]</a></p>
|
372
|
+
<div class="method-source-code" id="M000167-source">
|
373
|
+
<pre>
|
374
|
+
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line 219</span>
|
375
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_directive_content_as_arg</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">cont_stmts</span>)
|
376
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">d_arg</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">d_arg</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?:</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">d_arg</span>[<span class="ruby-value">0</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?{</span>
|
377
|
+
<span class="ruby-identifier">print_stmt</span> = <span class="ruby-identifier">cont_stmts</span>[<span class="ruby-value">0</span>]
|
378
|
+
<span class="ruby-identifier">label</span> = <span class="ruby-identifier">print_stmt</span>.<span class="ruby-identifier">args</span>[<span class="ruby-value">0</span>]
|
379
|
+
<span class="ruby-identifier">d_arg</span>[<span class="ruby-value">0</span>,<span class="ruby-value">0</span>] = <span class="ruby-node">"#{quote(label)}#{d_arg.empty? ? '' : ', '}"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">label</span>
|
380
|
+
<span class="ruby-keyword kw">end</span>
|
381
|
+
<span class="ruby-keyword kw">end</span>
|
382
|
+
</pre>
|
383
|
+
</div>
|
384
|
+
</div>
|
385
|
+
</div>
|
386
|
+
|
387
|
+
<div id="method-M000169" class="method-detail">
|
388
|
+
<a name="M000169"></a>
|
389
|
+
|
390
|
+
<div class="method-heading">
|
391
|
+
<a href="#M000169" class="method-signature">
|
392
|
+
<span class="method-name">add_directive_expr_option</span><span class="method-args">(directive_arg, attr_name, attr_value)</span>
|
393
|
+
</a>
|
394
|
+
</div>
|
395
|
+
|
396
|
+
<div class="method-description">
|
397
|
+
<p><a class="source-toggle" href="#"
|
398
|
+
onclick="toggleCode('M000169-source');return false;">[Source]</a></p>
|
399
|
+
<div class="method-source-code" id="M000169-source">
|
400
|
+
<pre>
|
401
|
+
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line 236</span>
|
402
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_directive_expr_option</span>(<span class="ruby-identifier">directive_arg</span>, <span class="ruby-identifier">attr_name</span>, <span class="ruby-identifier">attr_value</span>)
|
403
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">attr_value</span>
|
404
|
+
<span class="ruby-identifier">directive_arg</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">', '</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">directive_arg</span>.<span class="ruby-identifier">empty?</span>
|
405
|
+
<span class="ruby-identifier">directive_arg</span> <span class="ruby-operator"><<</span> <span class="ruby-node">":#{attr_name}=>#{attr_value}"</span>
|
406
|
+
<span class="ruby-keyword kw">end</span>
|
407
|
+
<span class="ruby-keyword kw">end</span>
|
408
|
+
</pre>
|
409
|
+
</div>
|
410
|
+
</div>
|
411
|
+
</div>
|
412
|
+
|
413
|
+
<div id="method-M000168" class="method-detail">
|
414
|
+
<a name="M000168"></a>
|
415
|
+
|
416
|
+
<div class="method-heading">
|
417
|
+
<a href="#M000168" class="method-signature">
|
418
|
+
<span class="method-name">add_directive_integer_option</span><span class="method-args">(directive_arg, attr_name, attr_value)</span>
|
419
|
+
</a>
|
420
|
+
</div>
|
421
|
+
|
422
|
+
<div class="method-description">
|
423
|
+
<p><a class="source-toggle" href="#"
|
424
|
+
onclick="toggleCode('M000168-source');return false;">[Source]</a></p>
|
425
|
+
<div class="method-source-code" id="M000168-source">
|
426
|
+
<pre>
|
427
|
+
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line 228</span>
|
428
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_directive_integer_option</span>(<span class="ruby-identifier">directive_arg</span>, <span class="ruby-identifier">attr_name</span>, <span class="ruby-identifier">attr_value</span>)
|
429
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">attr_value</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">attr_value</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A\d+\z/</span>
|
430
|
+
<span class="ruby-identifier">directive_arg</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">', '</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">directive_arg</span>.<span class="ruby-identifier">empty?</span>
|
431
|
+
<span class="ruby-identifier">directive_arg</span> <span class="ruby-operator"><<</span> <span class="ruby-node">":#{attr_name}=>#{attr_value.to_i}"</span>
|
432
|
+
<span class="ruby-keyword kw">end</span>
|
433
|
+
<span class="ruby-keyword kw">end</span>
|
434
|
+
</pre>
|
435
|
+
</div>
|
436
|
+
</div>
|
437
|
+
</div>
|
438
|
+
|
439
|
+
<div id="method-M000163" class="method-detail">
|
440
|
+
<a name="M000163"></a>
|
441
|
+
|
442
|
+
<div class="method-heading">
|
443
|
+
<a href="#M000163" class="method-signature">
|
444
|
+
<span class="method-name">add_directive_object_and_method</span><span class="method-args">(d_arg, attr_info)</span>
|
445
|
+
</a>
|
446
|
+
</div>
|
447
|
+
|
448
|
+
<div class="method-description">
|
449
|
+
<p><a class="source-toggle" href="#"
|
450
|
+
onclick="toggleCode('M000163-source');return false;">[Source]</a></p>
|
451
|
+
<div class="method-source-code" id="M000163-source">
|
452
|
+
<pre>
|
453
|
+
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line 186</span>
|
454
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_directive_object_and_method</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">attr_info</span>)
|
455
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-regexp re">/\A(\w+)\[(\w+)\]\z/</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">attr_info</span>[<span class="ruby-value str">'name'</span>]) <span class="ruby-operator">||</span> (<span class="ruby-regexp re">/\A([a-zA-A0-9]+)_(\w+)\z/</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">attr_info</span>[<span class="ruby-value str">'id'</span>])
|
456
|
+
<span class="ruby-identifier">object</span> = <span class="ruby-identifier">$1</span> ; <span class="ruby-identifier">method</span> = <span class="ruby-identifier">$2</span>
|
457
|
+
<span class="ruby-identifier">d_arg</span>[<span class="ruby-value">0</span>,<span class="ruby-value">0</span>] = <span class="ruby-node">"#{quote(object)}, #{quote(method)}#{d_arg.empty? ? '' : ', '}"</span>
|
458
|
+
<span class="ruby-keyword kw">end</span>
|
459
|
+
<span class="ruby-keyword kw">end</span>
|
460
|
+
</pre>
|
461
|
+
</div>
|
462
|
+
</div>
|
463
|
+
</div>
|
464
|
+
|
465
|
+
<div id="method-M000164" class="method-detail">
|
466
|
+
<a name="M000164"></a>
|
467
|
+
|
468
|
+
<div class="method-heading">
|
469
|
+
<a href="#M000164" class="method-signature">
|
470
|
+
<span class="method-name">add_directive_object_and_method_and_value</span><span class="method-args">(d_arg, attr_info)</span>
|
471
|
+
</a>
|
472
|
+
</div>
|
473
|
+
|
474
|
+
<div class="method-description">
|
475
|
+
<p><a class="source-toggle" href="#"
|
476
|
+
onclick="toggleCode('M000164-source');return false;">[Source]</a></p>
|
477
|
+
<div class="method-source-code" id="M000164-source">
|
478
|
+
<pre>
|
479
|
+
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line 194</span>
|
480
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_directive_object_and_method_and_value</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">attr_info</span>)
|
481
|
+
<span class="ruby-identifier">object</span> = <span class="ruby-identifier">method</span> = <span class="ruby-value str">''</span>
|
482
|
+
<span class="ruby-keyword kw">if</span> (<span class="ruby-regexp re">/\A(\w+)\[(\w+)\]\z/</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">attr_info</span>[<span class="ruby-value str">'name'</span>]) <span class="ruby-operator">||</span> (<span class="ruby-regexp re">/\A([a-zA-z0-9]+)_(\w+?)_[a-zA-z0-9]+\z/</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">attr_info</span>[<span class="ruby-value str">'id'</span>])
|
483
|
+
<span class="ruby-identifier">object</span> = <span class="ruby-identifier">$1</span> ; <span class="ruby-identifier">method</span> = <span class="ruby-identifier">$2</span>
|
484
|
+
<span class="ruby-keyword kw">end</span>
|
485
|
+
<span class="ruby-identifier">value</span> = <span class="ruby-identifier">attr_info</span>[<span class="ruby-value str">'value'</span>]
|
486
|
+
<span class="ruby-identifier">d_arg</span>[<span class="ruby-value">0</span>,<span class="ruby-value">0</span>] = <span class="ruby-node">"#{quote(object)}, #{quote(method)}, #{quote(value)}#{d_arg.empty? ? '' : ', '}"</span>
|
487
|
+
<span class="ruby-keyword kw">end</span>
|
488
|
+
</pre>
|
489
|
+
</div>
|
490
|
+
</div>
|
491
|
+
</div>
|
492
|
+
|
493
|
+
<div id="method-M000170" class="method-detail">
|
494
|
+
<a name="M000170"></a>
|
495
|
+
|
496
|
+
<div class="method-heading">
|
497
|
+
<a href="#M000170" class="method-signature">
|
498
|
+
<span class="method-name">add_directive_str_option</span><span class="method-args">(directive_arg, attr_name, attr_value)</span>
|
499
|
+
</a>
|
500
|
+
</div>
|
501
|
+
|
502
|
+
<div class="method-description">
|
503
|
+
<p><a class="source-toggle" href="#"
|
504
|
+
onclick="toggleCode('M000170-source');return false;">[Source]</a></p>
|
505
|
+
<div class="method-source-code" id="M000170-source">
|
506
|
+
<pre>
|
507
|
+
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line 244</span>
|
508
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_directive_str_option</span>(<span class="ruby-identifier">directive_arg</span>, <span class="ruby-identifier">attr_name</span>, <span class="ruby-identifier">attr_value</span>)
|
509
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">attr_value</span>
|
510
|
+
<span class="ruby-identifier">directive_arg</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">', '</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">directive_arg</span>.<span class="ruby-identifier">empty?</span>
|
511
|
+
<span class="ruby-identifier">directive_arg</span> <span class="ruby-operator"><<</span> <span class="ruby-node">":#{attr_name}=>#{quote(attr_value.to_s)}"</span>
|
512
|
+
<span class="ruby-keyword kw">end</span>
|
513
|
+
<span class="ruby-keyword kw">end</span>
|
514
|
+
</pre>
|
515
|
+
</div>
|
516
|
+
</div>
|
517
|
+
</div>
|
518
|
+
|
519
|
+
<div id="method-M000171" class="method-detail">
|
520
|
+
<a name="M000171"></a>
|
521
|
+
|
522
|
+
<div class="method-heading">
|
523
|
+
<a href="#M000171" class="method-signature">
|
524
|
+
<span class="method-name">print_directive</span><span class="method-args">(d_name, d_arg, stag_info, etag_info, cont_stmts, attr_info, stmt_list, replace_elem=true)</span>
|
525
|
+
</a>
|
526
|
+
</div>
|
527
|
+
|
528
|
+
<div class="method-description">
|
529
|
+
<p><a class="source-toggle" href="#"
|
530
|
+
onclick="toggleCode('M000171-source');return false;">[Source]</a></p>
|
531
|
+
<div class="method-source-code" id="M000171-source">
|
532
|
+
<pre>
|
533
|
+
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line 252</span>
|
534
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">print_directive</span>(<span class="ruby-identifier">d_name</span>, <span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">stag_info</span>, <span class="ruby-identifier">etag_info</span>, <span class="ruby-identifier">cont_stmts</span>, <span class="ruby-identifier">attr_info</span>, <span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">replace_elem</span>=<span class="ruby-keyword kw">true</span>)
|
535
|
+
<span class="ruby-identifier">head_space</span> = <span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">head_space</span>
|
536
|
+
<span class="ruby-identifier">tail_space</span> = (<span class="ruby-identifier">etag_info</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">stag_info</span>).<span class="ruby-identifier">tail_space</span>
|
537
|
+
<span class="ruby-identifier">args</span> = []
|
538
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">head_space</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">head_space</span>
|
539
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">NativeExpression</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">"#{d_name} #{d_arg}"</span>)
|
540
|
+
<span class="ruby-identifier">args</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">tail_space</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">tail_space</span>
|
541
|
+
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">PrintStatement</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">args</span>)
|
542
|
+
<span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">replace_elem</span>
|
543
|
+
<span class="ruby-identifier">stmt_list</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">cont_stmts</span>)
|
544
|
+
<span class="ruby-identifier">stmt_list</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">PrintStatement</span>.<span class="ruby-identifier">new</span>([<span class="ruby-identifier">etag_info</span>.<span class="ruby-identifier">tag_text</span>])
|
545
|
+
<span class="ruby-keyword kw">end</span>
|
546
|
+
<span class="ruby-keyword kw">end</span>
|
547
|
+
</pre>
|
548
|
+
</div>
|
549
|
+
</div>
|
550
|
+
</div>
|
551
|
+
|
552
|
+
<div id="method-M000162" class="method-detail">
|
553
|
+
<a name="M000162"></a>
|
554
|
+
|
555
|
+
<div class="method-heading">
|
556
|
+
<a href="#M000162" class="method-signature">
|
557
|
+
<span class="method-name">quote</span><span class="method-args">(str)</span>
|
558
|
+
</a>
|
559
|
+
</div>
|
560
|
+
|
561
|
+
<div class="method-description">
|
562
|
+
<p><a class="source-toggle" href="#"
|
563
|
+
onclick="toggleCode('M000162-source');return false;">[Source]</a></p>
|
564
|
+
<div class="method-source-code" id="M000162-source">
|
565
|
+
<pre>
|
566
|
+
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line 181</span>
|
567
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">quote</span>(<span class="ruby-identifier">str</span>)
|
568
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-node">"'#{str.gsub(/['\\]/, '\\\\\&')}'"</span>
|
569
|
+
<span class="ruby-keyword kw">end</span>
|
570
|
+
</pre>
|
571
|
+
</div>
|
572
|
+
</div>
|
573
|
+
</div>
|
574
|
+
|
575
|
+
|
576
|
+
</div>
|
577
|
+
|
578
|
+
|
579
|
+
</div>
|
580
|
+
|
581
|
+
|
582
|
+
<div id="validator-badges">
|
583
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
584
|
+
</div>
|
585
|
+
|
586
|
+
</body>
|
587
|
+
</html>
|