kwartz 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) hide show
  1. data/COPYING +340 -0
  2. data/ChangeLog +103 -0
  3. data/README.txt +37 -0
  4. data/bin/kwartz +12 -0
  5. data/doc-api/classes/Kwartz.html +218 -0
  6. data/doc-api/classes/Kwartz/Assertion.html +140 -0
  7. data/doc-api/classes/Kwartz/AssertionError.html +148 -0
  8. data/doc-api/classes/Kwartz/AttrInfo.html +320 -0
  9. data/doc-api/classes/Kwartz/BaseError.html +206 -0
  10. data/doc-api/classes/Kwartz/BaseTranslator.html +331 -0
  11. data/doc-api/classes/Kwartz/CharacterType.html +212 -0
  12. data/doc-api/classes/Kwartz/CommandOptionError.html +154 -0
  13. data/doc-api/classes/Kwartz/CommandOptions.html +374 -0
  14. data/doc-api/classes/Kwartz/Config.html +150 -0
  15. data/doc-api/classes/Kwartz/ConvertError.html +191 -0
  16. data/doc-api/classes/Kwartz/Converter.html +252 -0
  17. data/doc-api/classes/Kwartz/CssStyleParser.html +483 -0
  18. data/doc-api/classes/Kwartz/DocumentRuleset.html +369 -0
  19. data/doc-api/classes/Kwartz/ElementExpander.html +325 -0
  20. data/doc-api/classes/Kwartz/ElementInfo.html +312 -0
  21. data/doc-api/classes/Kwartz/ElementRuleset.html +582 -0
  22. data/doc-api/classes/Kwartz/EperlHandler.html +338 -0
  23. data/doc-api/classes/Kwartz/EperlTranslator.html +167 -0
  24. data/doc-api/classes/Kwartz/ErubisHandler.html +113 -0
  25. data/doc-api/classes/Kwartz/ErubisTranslator.html +168 -0
  26. data/doc-api/classes/Kwartz/ErubyHandler.html +337 -0
  27. data/doc-api/classes/Kwartz/ErubyTranslator.html +167 -0
  28. data/doc-api/classes/Kwartz/ExpandStatement.html +227 -0
  29. data/doc-api/classes/Kwartz/Expression.html +119 -0
  30. data/doc-api/classes/Kwartz/Handler.html +558 -0
  31. data/doc-api/classes/Kwartz/JstlHandler.html +657 -0
  32. data/doc-api/classes/Kwartz/JstlTranslator.html +226 -0
  33. data/doc-api/classes/Kwartz/KwartzError.html +146 -0
  34. data/doc-api/classes/Kwartz/Main.html +384 -0
  35. data/doc-api/classes/Kwartz/NativeExpression.html +236 -0
  36. data/doc-api/classes/Kwartz/NativeStatement.html +254 -0
  37. data/doc-api/classes/Kwartz/Node.html +156 -0
  38. data/doc-api/classes/Kwartz/ParseError.html +148 -0
  39. data/doc-api/classes/Kwartz/PhpHandler.html +333 -0
  40. data/doc-api/classes/Kwartz/PhpTranslator.html +194 -0
  41. data/doc-api/classes/Kwartz/PresentationLogicParser.html +830 -0
  42. data/doc-api/classes/Kwartz/PrintStatement.html +221 -0
  43. data/doc-api/classes/Kwartz/RailsHandler.html +587 -0
  44. data/doc-api/classes/Kwartz/RailsTranslator.html +167 -0
  45. data/doc-api/classes/Kwartz/RubyStyleParser.html +558 -0
  46. data/doc-api/classes/Kwartz/Ruleset.html +117 -0
  47. data/doc-api/classes/Kwartz/Statement.html +119 -0
  48. data/doc-api/classes/Kwartz/StrutsTranslator.html +190 -0
  49. data/doc-api/classes/Kwartz/TagInfo.html +314 -0
  50. data/doc-api/classes/Kwartz/TextConverter.html +270 -0
  51. data/doc-api/classes/Kwartz/Translator.html +318 -0
  52. data/doc-api/classes/Test.html +107 -0
  53. data/doc-api/classes/Test/Unit.html +101 -0
  54. data/doc-api/created.rid +1 -0
  55. data/doc-api/files/__/README_txt.html +150 -0
  56. data/doc-api/files/kwartz/assert_rb.html +114 -0
  57. data/doc-api/files/kwartz/binding/eperl_rb.html +116 -0
  58. data/doc-api/files/kwartz/binding/erubis_rb.html +116 -0
  59. data/doc-api/files/kwartz/binding/eruby_rb.html +115 -0
  60. data/doc-api/files/kwartz/binding/jstl_rb.html +116 -0
  61. data/doc-api/files/kwartz/binding/php_rb.html +116 -0
  62. data/doc-api/files/kwartz/binding/rails_rb.html +115 -0
  63. data/doc-api/files/kwartz/binding/struts_rb.html +117 -0
  64. data/doc-api/files/kwartz/config_rb.html +107 -0
  65. data/doc-api/files/kwartz/converter_rb.html +119 -0
  66. data/doc-api/files/kwartz/error_rb.html +107 -0
  67. data/doc-api/files/kwartz/main_rb.html +124 -0
  68. data/doc-api/files/kwartz/node_rb.html +114 -0
  69. data/doc-api/files/kwartz/parser_rb.html +117 -0
  70. data/doc-api/files/kwartz/translator_rb.html +115 -0
  71. data/doc-api/files/kwartz/util/assert-text-equal_rb.html +115 -0
  72. data/doc-api/files/kwartz/util/testcase-helper_rb.html +115 -0
  73. data/doc-api/files/kwartz_rb.html +120 -0
  74. data/doc-api/fr_class_index.html +75 -0
  75. data/doc-api/fr_file_index.html +45 -0
  76. data/doc-api/fr_method_index.html +216 -0
  77. data/doc-api/index.html +24 -0
  78. data/doc-api/rdoc-style.css +208 -0
  79. data/doc/docstyle.css +188 -0
  80. data/doc/p-pattern.html +1207 -0
  81. data/doc/reference.html +3396 -0
  82. data/doc/users-guide.html +1670 -0
  83. data/examples/breadcrumbs1/Makefile +15 -0
  84. data/examples/breadcrumbs1/breadcrumbs.eruby.plogic +27 -0
  85. data/examples/breadcrumbs1/breadcrumbs.html +12 -0
  86. data/examples/breadcrumbs1/breadcrumbs.jstl.plogic +28 -0
  87. data/examples/breadcrumbs1/breadcrumbs.php.plogic +26 -0
  88. data/examples/breadcrumbs1/main.php +12 -0
  89. data/examples/breadcrumbs1/main.rb +12 -0
  90. data/examples/breadcrumbs2/Makefile +15 -0
  91. data/examples/breadcrumbs2/breadcrumbs.eruby.plogic +22 -0
  92. data/examples/breadcrumbs2/breadcrumbs.html +14 -0
  93. data/examples/breadcrumbs2/breadcrumbs.jstl.plogic +24 -0
  94. data/examples/breadcrumbs2/breadcrumbs.php.plogic +23 -0
  95. data/examples/breadcrumbs2/main.php +12 -0
  96. data/examples/breadcrumbs2/main.rb +12 -0
  97. data/examples/pagelayout/Makefile +47 -0
  98. data/examples/pagelayout/content.eruby.plogic +44 -0
  99. data/examples/pagelayout/content.jstl.plogic +36 -0
  100. data/examples/pagelayout/content.php.plogic +37 -0
  101. data/examples/pagelayout/content1.html +36 -0
  102. data/examples/pagelayout/content2.html +29 -0
  103. data/examples/pagelayout/design.css +40 -0
  104. data/examples/pagelayout/layout.html +50 -0
  105. data/examples/pagelayout/main.php +55 -0
  106. data/examples/pagelayout/main.rb +77 -0
  107. data/examples/pagelayout/menu.eruby.plogic +14 -0
  108. data/examples/pagelayout/menu.html +13 -0
  109. data/examples/pagelayout/menu.jstl.plogic +14 -0
  110. data/examples/pagelayout/menu.php.plogic +14 -0
  111. data/examples/rails1/Makefile +36 -0
  112. data/examples/rails1/README +19 -0
  113. data/examples/rails1/application_helper.rb +31 -0
  114. data/examples/rails1/edit.html +28 -0
  115. data/examples/rails1/edit.plogic +10 -0
  116. data/examples/rails1/form.html +52 -0
  117. data/examples/rails1/form.plogic +33 -0
  118. data/examples/rails1/layout.plogic +15 -0
  119. data/examples/rails1/link_to.plogic +19 -0
  120. data/examples/rails1/list.html +48 -0
  121. data/examples/rails1/list.plogic +28 -0
  122. data/examples/rails1/new.html +27 -0
  123. data/examples/rails1/new.plogic +10 -0
  124. data/examples/rails1/reader.plogic +29 -0
  125. data/examples/rails1/show.html +40 -0
  126. data/examples/rails1/show.plogic +4 -0
  127. data/examples/rails1/writer.plogic +8 -0
  128. data/examples/table1/Makefile +15 -0
  129. data/examples/table1/main.php +11 -0
  130. data/examples/table1/main.rb +11 -0
  131. data/examples/table1/table1.eruby.plogic +21 -0
  132. data/examples/table1/table1.html +16 -0
  133. data/examples/table1/table1.jstl.plogic +21 -0
  134. data/examples/table1/table1.php.plogic +22 -0
  135. data/kwartz.gemspec +55 -0
  136. data/lib/kwartz.rb +13 -0
  137. data/lib/kwartz/assert.rb +31 -0
  138. data/lib/kwartz/binding/eperl.rb +166 -0
  139. data/lib/kwartz/binding/erubis.rb +61 -0
  140. data/lib/kwartz/binding/eruby.rb +164 -0
  141. data/lib/kwartz/binding/jstl.rb +334 -0
  142. data/lib/kwartz/binding/php.rb +167 -0
  143. data/lib/kwartz/binding/rails.rb +295 -0
  144. data/lib/kwartz/binding/struts.rb +109 -0
  145. data/lib/kwartz/config.rb +28 -0
  146. data/lib/kwartz/converter.rb +920 -0
  147. data/lib/kwartz/error.rb +41 -0
  148. data/lib/kwartz/main.rb +464 -0
  149. data/lib/kwartz/node.rb +454 -0
  150. data/lib/kwartz/parser.rb +903 -0
  151. data/lib/kwartz/translator.rb +153 -0
  152. data/lib/kwartz/util/assert-text-equal.rb +44 -0
  153. data/lib/kwartz/util/testcase-helper.rb +112 -0
  154. data/setup.rb +1331 -0
  155. data/test/test-compile.rb +36 -0
  156. data/test/test-compile.yaml +178 -0
  157. data/test/test-converter.rb +34 -0
  158. data/test/test-converter.yaml +127 -0
  159. data/test/test-directives.rb +32 -0
  160. data/test/test-directives.yaml +1411 -0
  161. data/test/test-main.rb +464 -0
  162. data/test/test-parser.rb +54 -0
  163. data/test/test-parser.yaml +394 -0
  164. data/test/test-rails.rb +28 -0
  165. data/test/test-rails.yaml +301 -0
  166. data/test/test-ruleset.rb +36 -0
  167. data/test/test-ruleset.yaml +804 -0
  168. data/test/test.rb +44 -0
  169. 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>&nbsp;&nbsp;
99
+ <a href="#M000047">accept</a>&nbsp;&nbsp;
100
+ <a href="#M000045">new</a>&nbsp;&nbsp;
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">&nbsp;[R]&nbsp;</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">&quot;&lt;%=#{arg.code}%&gt;&quot;</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">&quot;[ &quot;</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">&quot;]&quot;</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=&gt;RailsDirectiveHandler.new)
92
+ </pre>
93
+ <p>
94
+ directive examples.
95
+ </p>
96
+ <pre>
97
+ ## text_field, password_field
98
+ &lt;input type=&quot;text&quot; size=&quot;10&quot; maxsize=&quot;20&quot; title=&quot;text_field 'user', 'name'&quot;&gt;
99
+ =&gt; &lt;%= text_field 'user', 'name', :size=&gt;10, :maxsize=&gt;20 %&gt;
100
+ &lt;input type=&quot;text&quot; name=&quot;user[name]&quot; title=&quot;text_field :size=&gt;10&quot;&gt;
101
+ =&gt; &lt;%= text_field &quot;user&quot;, &quot;name&quot;, :size=&gt;10 %&gt;
102
+ &lt;input type=&quot;text&quot; id=&quot;user_name&quot; size=&quot;10&quot; title=&quot;text_field&quot;&gt;
103
+ =&gt; &lt;%= text_field &quot;user&quot;, &quot;name&quot;, :size=&gt;10 %&gt;
104
+
105
+ ## link_to, link_to_remote
106
+ &lt;a href=&quot;#&quot; title=&quot;link_to :action=&gt;'list'&quot;&gt;Show list&lt;/a&gt;
107
+ =&gt; &lt;%= link_to 'Show list', :action=&gt;'list' %&gt;
108
+
109
+ ## start_link_to, start_link_to_remote
110
+ &lt;a href=&quot;#&quot; title=&quot;start_link_to :action=&gt;'list'&quot;&gt;Show list&lt;/a&gt;
111
+ =&gt; &lt;%= start_link_to 'action'=&gt;'list' %&gt;Show list&lt;/a&gt;
112
+
113
+ ## mail_to
114
+ &lt;a href=&quot;mail:www@example.com&quot; title=&quot;mail_to&quot;&gt;admin&lt;/a&gt;
115
+ =&gt; &lt;%= mail_to &quot;www@example.com&quot;, &quot;admin&quot; %&gt;
116
+
117
+ ## form_tag
118
+ &lt;form action=&quot;show&quot; title=&quot;form_tag :id=&gt;2&quot;&gt; ... &lt;/form&gt;
119
+ =&gt; &lt;%= form_tag :action=&gt;&quot;show&quot;, :id=&gt;2 %&gt; ... &lt;/form&gt;
120
+
121
+ ## submit_tag
122
+ &lt;input type=&quot;submit&quot; value=&quot;OK&quot; title=&quot;submit_tag&quot;&gt;
123
+ =&gt; &lt;%= submit_tag &quot;OK&quot; %&gt;
124
+
125
+ ## text_area
126
+ &lt;textarea cols=&quot;30&quot; rows=&quot;3&quot; id=&quot;user_desc&quot; title=&quot;text_area&quot;&gt;&lt;/textarea&gt;
127
+ =&gt; &lt;%= text_area &quot;user&quot;, &quot;desc&quot;, :cols=&gt;30, :rows=&gt;3 %&gt;
128
+ &lt;textarea cols=&quot;30&quot; rows=&quot;3&quot; name=&quot;user[desc]&quot; title=&quot;text_area&quot;&gt;&lt;/textarea&gt;
129
+ =&gt; &lt;%= text_area &quot;user&quot;, &quot;desc&quot;, :cols=&gt;30, :rows=&gt;3 %&gt;
130
+
131
+ ## hidden_field
132
+ &lt;input type=&quot;hidden&quot; id=&quot;user_id&quot; title=&quot;hidden_field&quot;&gt;
133
+ =&gt; &lt;%= hidden_field &quot;user&quot;, &quot;id&quot; %&gt;
134
+ &lt;input type=&quot;hidden&quot; name=&quot;user[id]&quot; title=&quot;hidden_field&quot;&gt;
135
+ =&gt; &lt;%= hidden_field &quot;user&quot;, &quot;id&quot; %&gt;
136
+
137
+ ## check_box
138
+ &lt;input type=&quot;checkbox&quot; id=&quot;user_chk1&quot; title=&quot;check_box&quot;&gt;
139
+ =&gt; &lt;%= check_box &quot;user&quot;, &quot;chk1&quot; %&gt;
140
+ &lt;input type=&quot;checkbox&quot; name=&quot;user[chk2]&quot; title=&quot;check_box&quot;&gt;
141
+ =&gt; &lt;%= check_box &quot;user&quot;, &quot;chk2&quot; %&gt;
142
+
143
+ ## radio_button
144
+ &lt;input type=&quot;radio&quot; id=&quot;user_radio&quot; value=&quot;val1&quot; title=&quot;radio_button&quot;&gt;
145
+ =&gt; &lt;%= radio_button &quot;user&quot;, &quot;radio&quot;, &quot;val1&quot; %&gt;
146
+ &lt;input type=&quot;radio&quot; name=&quot;user[radio]&quot; value=&quot;val2&quot; title=&quot;radio_button&quot;&gt;
147
+ =&gt; &lt;%= radio_button &quot;user&quot;, &quot;radio&quot;, &quot;val2&quot; %&gt;
148
+
149
+ ## select, collection_select, country_select, time_zone_select, date_select, datetime_select
150
+ &lt;select name=&quot;user[birth]&quot; title=&quot;date_select :start_year=&gt;1970&quot;&gt;
151
+ &lt;option value=&quot;2000&quot;&gt;2000&lt;/option&gt;
152
+ &lt;/select&gt;
153
+ =&gt; &lt;% date_select &quot;user&quot;, &quot;birth&quot;, :start_year=&gt;1970 %&gt;
154
+
155
+ ## image_tag, link_image_to, link_to_image
156
+ &lt;img src=&quot;foo.gif&quot; alt=&quot;text&quot; width=&quot;20&quot; heigth=&quot;10&quot; title=&quot;image_tag :size=&gt;'30x40'&quot;&gt;
157
+ =&gt; &lt;%= image_tag &quot;foo.gif&quot;, :alt=&gt;&quot;text&quot;, :size=&gt;'30x40' %&gt;
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>&nbsp;&nbsp;
170
+ <a href="#M000166">add_directive_attr_as_option</a>&nbsp;&nbsp;
171
+ <a href="#M000167">add_directive_content_as_arg</a>&nbsp;&nbsp;
172
+ <a href="#M000169">add_directive_expr_option</a>&nbsp;&nbsp;
173
+ <a href="#M000168">add_directive_integer_option</a>&nbsp;&nbsp;
174
+ <a href="#M000163">add_directive_object_and_method</a>&nbsp;&nbsp;
175
+ <a href="#M000164">add_directive_object_and_method_and_value</a>&nbsp;&nbsp;
176
+ <a href="#M000170">add_directive_str_option</a>&nbsp;&nbsp;
177
+ <a href="#M000161">handle</a>&nbsp;&nbsp;
178
+ <a href="#M000171">print_directive</a>&nbsp;&nbsp;
179
+ <a href="#M000162">quote</a>&nbsp;&nbsp;
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=&quot;user[name]&quot;' or 'id=&quot;user_name&quot;'</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">&quot;'&quot;</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">&amp;&amp;</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">&quot;#{quote(v)}#{d_arg.empty? ? '' : ', '}&quot;</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">&amp;&amp;</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">&lt;&lt;</span> <span class="ruby-value str">&quot;, &quot;</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">&lt;&lt;</span> <span class="ruby-node">&quot;'#{attr_name}'=&gt;#{quote(s)}&quot;</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">&quot;#{quote(label)}#{d_arg.empty? ? '' : ', '}&quot;</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">&lt;&lt;</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">&lt;&lt;</span> <span class="ruby-node">&quot;:#{attr_name}=&gt;#{attr_value}&quot;</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">&amp;&amp;</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">&lt;&lt;</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">&lt;&lt;</span> <span class="ruby-node">&quot;:#{attr_name}=&gt;#{attr_value.to_i}&quot;</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">&quot;#{quote(object)}, #{quote(method)}#{d_arg.empty? ? '' : ', '}&quot;</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">&quot;#{quote(object)}, #{quote(method)}, #{quote(value)}#{d_arg.empty? ? '' : ', '}&quot;</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">&lt;&lt;</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">&lt;&lt;</span> <span class="ruby-node">&quot;:#{attr_name}=&gt;#{quote(attr_value.to_s)}&quot;</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">&lt;&lt;</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">&lt;&lt;</span> <span class="ruby-constant">NativeExpression</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">&quot;#{d_name} #{d_arg}&quot;</span>)
540
+ <span class="ruby-identifier">args</span> <span class="ruby-operator">&lt;&lt;</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">&lt;&lt;</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">&lt;&lt;</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">&quot;'#{str.gsub(/['\\]/, '\\\\\&amp;')}'&quot;</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>