kwartz 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +36 -1
- data/LGPL +504 -0
- data/README.txt +16 -2
- data/bin/kwartz +1 -1
- data/doc-api/classes/Kwartz.html +47 -1
- data/doc-api/classes/Kwartz/Assertion.html +6 -6
- data/doc-api/classes/Kwartz/AssertionError.html +6 -6
- data/doc-api/classes/Kwartz/AttrInfo.html +42 -42
- data/doc-api/classes/Kwartz/BaseError.html +12 -12
- data/doc-api/classes/Kwartz/BaseTranslator.html +210 -43
- data/doc-api/classes/Kwartz/CharacterType.html +24 -24
- data/doc-api/classes/Kwartz/CommandOptionError.html +7 -7
- data/doc-api/classes/Kwartz/CommandOptions.html +49 -49
- data/doc-api/classes/Kwartz/Config.html +6 -1
- data/doc-api/classes/Kwartz/ConvertError.html +14 -14
- data/doc-api/classes/Kwartz/Converter.html +31 -30
- data/doc-api/classes/Kwartz/CssStyleParser.html +79 -57
- data/doc-api/classes/Kwartz/Defun.html +313 -0
- data/doc-api/classes/Kwartz/DocumentRuleset.html +58 -58
- data/doc-api/classes/Kwartz/ElementExpander.html +32 -32
- data/doc-api/classes/Kwartz/ElementInfo.html +29 -29
- data/doc-api/classes/Kwartz/ElementRuleset.html +126 -96
- data/doc-api/classes/Kwartz/EperlHandler.html +108 -84
- data/doc-api/classes/Kwartz/EperlTranslator.html +7 -7
- data/doc-api/classes/Kwartz/ErubisHandler.html +2 -2
- data/doc-api/classes/Kwartz/ErubisTranslator.html +8 -8
- data/doc-api/classes/Kwartz/ErubyHandler.html +2 -220
- data/doc-api/classes/Kwartz/ErubyTranslator.html +7 -7
- data/doc-api/classes/Kwartz/ExpandStatement.html +20 -20
- data/doc-api/classes/Kwartz/Handler.html +122 -117
- data/doc-api/classes/Kwartz/HandlerArgument.html +215 -0
- data/doc-api/classes/Kwartz/Helper.html +112 -0
- data/doc-api/classes/Kwartz/Helper/ActionViewHelper.html +221 -0
- data/doc-api/classes/Kwartz/Helper/RailsTemplate.html +630 -0
- data/doc-api/classes/Kwartz/JstlHandler.html +208 -193
- data/doc-api/classes/Kwartz/JstlTranslator.html +15 -15
- data/doc-api/classes/Kwartz/KwartzError.html +6 -6
- data/doc-api/classes/Kwartz/Main.html +39 -23
- data/doc-api/classes/Kwartz/NativeExpression.html +18 -18
- data/doc-api/classes/Kwartz/NativeStatement.html +25 -25
- data/doc-api/classes/Kwartz/Node.html +6 -6
- data/doc-api/classes/Kwartz/PIErubisHandler.html +113 -0
- data/doc-api/classes/Kwartz/PIErubisTranslator.html +200 -0
- data/doc-api/classes/Kwartz/ParseError.html +6 -6
- data/doc-api/classes/Kwartz/PhpHandler.html +102 -83
- data/doc-api/classes/Kwartz/PhpTranslator.html +14 -14
- data/doc-api/classes/Kwartz/PresentationLogicParser.html +136 -128
- data/doc-api/classes/Kwartz/PrintStatement.html +19 -19
- data/doc-api/classes/Kwartz/RailsHandler.html +121 -118
- data/doc-api/classes/Kwartz/RailsTranslator.html +7 -7
- data/doc-api/classes/Kwartz/RubyHandler.html +349 -0
- data/doc-api/classes/Kwartz/RubyStyleParser.html +85 -85
- data/doc-api/classes/Kwartz/RubyTranslator.html +218 -0
- data/doc-api/classes/Kwartz/StatementHelper.html +479 -0
- data/doc-api/classes/Kwartz/StrutsTranslator.html +12 -12
- data/doc-api/classes/Kwartz/TagInfo.html +28 -28
- data/doc-api/classes/Kwartz/TextConverter.html +28 -28
- data/doc-api/classes/Kwartz/Translator.html +42 -42
- data/doc-api/classes/Kwartz/Util.html +284 -0
- data/doc-api/created.rid +1 -1
- data/doc-api/files/__/README_txt.html +30 -3
- data/doc-api/files/kwartz/assert_rb.html +1 -1
- data/doc-api/files/kwartz/binding/eperl_rb.html +2 -2
- data/doc-api/files/kwartz/binding/erubis_rb.html +3 -3
- data/doc-api/files/kwartz/binding/eruby_rb.html +3 -2
- data/doc-api/files/kwartz/binding/jstl_rb.html +2 -2
- data/doc-api/files/kwartz/binding/php_rb.html +2 -2
- data/doc-api/files/kwartz/binding/pierubis_rb.html +116 -0
- data/doc-api/files/kwartz/binding/rails_rb.html +2 -2
- data/doc-api/files/kwartz/binding/ruby_rb.html +115 -0
- data/doc-api/files/kwartz/binding/struts_rb.html +1 -1
- data/doc-api/files/kwartz/config_rb.html +2 -2
- data/doc-api/files/kwartz/converter_rb.html +3 -2
- data/doc-api/files/kwartz/defun_rb.html +116 -0
- data/doc-api/files/kwartz/error_rb.html +1 -1
- data/doc-api/files/kwartz/helper/rails_rb.html +123 -0
- data/doc-api/files/kwartz/main_rb.html +5 -2
- data/doc-api/files/kwartz/node_rb.html +2 -2
- data/doc-api/files/kwartz/parser_rb.html +2 -2
- data/doc-api/files/kwartz/translator_rb.html +2 -2
- data/doc-api/files/kwartz/util/assert-text-equal_rb.html +1 -1
- data/doc-api/files/kwartz/util/testcase-helper_rb.html +2 -2
- data/doc-api/files/kwartz/util_rb.html +107 -0
- data/doc-api/files/kwartz_rb.html +3 -2
- data/doc-api/fr_class_index.html +11 -0
- data/doc-api/fr_file_index.html +5 -0
- data/doc-api/fr_method_index.html +242 -190
- data/doc/p-pattern.html +94 -94
- data/doc/reference.html +847 -612
- data/doc/users-guide.html +744 -241
- data/examples/rails1/README +2 -2
- data/examples/rails1/application_helper.rb +2 -27
- data/examples/rails1/link_to.plogic +5 -5
- data/examples/rails1/list.plogic +2 -2
- data/examples/rails2/app/controllers/application.rb +14 -0
- data/examples/rails2/app/controllers/groups_controller.rb +47 -0
- data/examples/rails2/app/controllers/members_controller.rb +56 -0
- data/examples/rails2/app/helpers/application_helper.rb +6 -0
- data/examples/rails2/app/helpers/groups_helper.rb +2 -0
- data/examples/rails2/app/helpers/members_helper.rb +2 -0
- data/examples/rails2/app/models/group.rb +2 -0
- data/examples/rails2/app/models/member.rb +3 -0
- data/examples/rails2/app/views/groups/_form.html +30 -0
- data/examples/rails2/app/views/groups/_form.plogic +11 -0
- data/examples/rails2/app/views/groups/_link.plogic +19 -0
- data/examples/rails2/app/views/groups/_read.plogic +7 -0
- data/examples/rails2/app/views/groups/edit.cfg.yaml +2 -0
- data/examples/rails2/app/views/groups/edit.html +26 -0
- data/examples/rails2/app/views/groups/edit.plogic +9 -0
- data/examples/rails2/app/views/groups/list.html +48 -0
- data/examples/rails2/app/views/groups/list.plogic +32 -0
- data/examples/rails2/app/views/groups/new.cfg.yaml +2 -0
- data/examples/rails2/app/views/groups/new.html +27 -0
- data/examples/rails2/app/views/groups/new.plogic +9 -0
- data/examples/rails2/app/views/groups/show.html +27 -0
- data/examples/rails2/app/views/groups/show.plogic +2 -0
- data/examples/rails2/app/views/layouts/groups.html +23 -0
- data/examples/rails2/app/views/layouts/groups.plogic +11 -0
- data/examples/rails2/app/views/layouts/members.html +23 -0
- data/examples/rails2/app/views/layouts/members.plogic +11 -0
- data/examples/rails2/app/views/layouts/members2.html +24 -0
- data/examples/rails2/app/views/layouts/members2.plogic +11 -0
- data/examples/rails2/app/views/members/_form.plogic +27 -0
- data/examples/rails2/app/views/members/_link.plogic +19 -0
- data/examples/rails2/app/views/members/_read.plogic +29 -0
- data/examples/rails2/app/views/members/edit.cfg.yaml +6 -0
- data/examples/rails2/app/views/members/edit.html +27 -0
- data/examples/rails2/app/views/members/edit.plogic +10 -0
- data/examples/rails2/app/views/members/list.html +53 -0
- data/examples/rails2/app/views/members/list.plogic +32 -0
- data/examples/rails2/app/views/members/new.html +61 -0
- data/examples/rails2/app/views/members/new.plogic +17 -0
- data/examples/rails2/app/views/members/show.html +41 -0
- data/examples/rails2/app/views/members/show.plogic +3 -0
- data/examples/rails2/db/create-tables.mysql.sql +27 -0
- data/examples/rails2/db/create-tables.pgsql.sql +27 -0
- data/examples/rails2/db/insert-data.sql +21 -0
- data/examples/rails2/db/tabledef.yaml +51 -0
- data/kwartz.gemspec +4 -4
- data/lib/kwartz.rb +10 -2
- data/lib/kwartz/assert.rb +1 -1
- data/lib/kwartz/binding/eperl.rb +85 -61
- data/lib/kwartz/binding/erubis.rb +6 -8
- data/lib/kwartz/binding/eruby.rb +5 -120
- data/lib/kwartz/binding/jstl.rb +116 -101
- data/lib/kwartz/binding/php.rb +79 -60
- data/lib/kwartz/binding/pierubis.rb +58 -0
- data/lib/kwartz/binding/rails.rb +45 -42
- data/lib/kwartz/binding/ruby.rb +193 -0
- data/lib/kwartz/binding/struts.rb +1 -1
- data/lib/kwartz/config.rb +4 -3
- data/lib/kwartz/converter.rb +231 -68
- data/lib/kwartz/defun.rb +126 -0
- data/lib/kwartz/error.rb +1 -1
- data/lib/kwartz/helper/rails.rb +437 -0
- data/lib/kwartz/main.rb +30 -38
- data/lib/kwartz/node.rb +46 -31
- data/lib/kwartz/parser.rb +43 -15
- data/lib/kwartz/translator.rb +104 -6
- data/lib/kwartz/util.rb +113 -0
- data/lib/kwartz/util/assert-text-equal.rb +1 -1
- data/lib/kwartz/util/testcase-helper.rb +26 -8
- data/test/test-compile.rb +3 -3
- data/test/test-compile.yaml +135 -5
- data/test/test-converter.rb +16 -8
- data/test/test-converter.yaml +307 -76
- data/test/test-directives.rb +1 -1
- data/test/test-directives.yaml +964 -979
- data/test/test-main.rb +61 -146
- data/test/test-main.yaml +235 -0
- data/test/test-parser.rb +10 -12
- data/test/test-parser.yaml +484 -326
- data/test/test-rails.rb +1 -1
- data/test/test-rails.yaml +37 -37
- data/test/test-ruleset.rb +1 -1
- data/test/test-ruleset.yaml +34 -40
- data/test/test.rb +1 -1
- metadata +82 -3
- data/COPYING +0 -340
@@ -95,9 +95,9 @@ href="NativeExpression.html">NativeExpression</a>
|
|
95
95
|
<h3 class="section-bar">Methods</h3>
|
96
96
|
|
97
97
|
<div class="name-list">
|
98
|
-
<a href="#
|
99
|
-
<a href="#
|
100
|
-
<a href="#
|
98
|
+
<a href="#M000082">_inspect</a>
|
99
|
+
<a href="#M000083">accept</a>
|
100
|
+
<a href="#M000081">new</a>
|
101
101
|
</div>
|
102
102
|
</div>
|
103
103
|
|
@@ -132,19 +132,19 @@ href="NativeExpression.html">NativeExpression</a>
|
|
132
132
|
<div id="methods">
|
133
133
|
<h3 class="section-bar">Public Class methods</h3>
|
134
134
|
|
135
|
-
<div id="method-
|
136
|
-
<a name="
|
135
|
+
<div id="method-M000081" class="method-detail">
|
136
|
+
<a name="M000081"></a>
|
137
137
|
|
138
138
|
<div class="method-heading">
|
139
|
-
<a href="#
|
139
|
+
<a href="#M000081" class="method-signature">
|
140
140
|
<span class="method-name">new</span><span class="method-args">(args)</span>
|
141
141
|
</a>
|
142
142
|
</div>
|
143
143
|
|
144
144
|
<div class="method-description">
|
145
145
|
<p><a class="source-toggle" href="#"
|
146
|
-
onclick="toggleCode('
|
147
|
-
<div class="method-source-code" id="
|
146
|
+
onclick="toggleCode('M000081-source');return false;">[Source]</a></p>
|
147
|
+
<div class="method-source-code" id="M000081-source">
|
148
148
|
<pre>
|
149
149
|
<span class="ruby-comment cmt"># File kwartz/node.rb, line 179</span>
|
150
150
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">args</span>)
|
@@ -157,45 +157,45 @@ href="NativeExpression.html">NativeExpression</a>
|
|
157
157
|
|
158
158
|
<h3 class="section-bar">Public Instance methods</h3>
|
159
159
|
|
160
|
-
<div id="method-
|
161
|
-
<a name="
|
160
|
+
<div id="method-M000082" class="method-detail">
|
161
|
+
<a name="M000082"></a>
|
162
162
|
|
163
163
|
<div class="method-heading">
|
164
|
-
<a href="#
|
164
|
+
<a href="#M000082" class="method-signature">
|
165
165
|
<span class="method-name">_inspect</span><span class="method-args">(indent=0)</span>
|
166
166
|
</a>
|
167
167
|
</div>
|
168
168
|
|
169
169
|
<div class="method-description">
|
170
170
|
<p><a class="source-toggle" href="#"
|
171
|
-
onclick="toggleCode('
|
172
|
-
<div class="method-source-code" id="
|
171
|
+
onclick="toggleCode('M000082-source');return false;">[Source]</a></p>
|
172
|
+
<div class="method-source-code" id="M000082-source">
|
173
173
|
<pre>
|
174
174
|
<span class="ruby-comment cmt"># File kwartz/node.rb, line 185</span>
|
175
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
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
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
178
|
}
|
179
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-value str">"
|
179
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-value str">"print("</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">")\n"</span>
|
180
180
|
<span class="ruby-keyword kw">end</span>
|
181
181
|
</pre>
|
182
182
|
</div>
|
183
183
|
</div>
|
184
184
|
</div>
|
185
185
|
|
186
|
-
<div id="method-
|
187
|
-
<a name="
|
186
|
+
<div id="method-M000083" class="method-detail">
|
187
|
+
<a name="M000083"></a>
|
188
188
|
|
189
189
|
<div class="method-heading">
|
190
|
-
<a href="#
|
190
|
+
<a href="#M000083" class="method-signature">
|
191
191
|
<span class="method-name">accept</span><span class="method-args">(translator)</span>
|
192
192
|
</a>
|
193
193
|
</div>
|
194
194
|
|
195
195
|
<div class="method-description">
|
196
196
|
<p><a class="source-toggle" href="#"
|
197
|
-
onclick="toggleCode('
|
198
|
-
<div class="method-source-code" id="
|
197
|
+
onclick="toggleCode('M000083-source');return false;">[Source]</a></p>
|
198
|
+
<div class="method-source-code" id="M000083-source">
|
199
199
|
<pre>
|
200
200
|
<span class="ruby-comment cmt"># File kwartz/node.rb, line 193</span>
|
201
201
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">accept</span>(<span class="ruby-identifier">translator</span>)
|
@@ -95,65 +95,65 @@ directive examples.
|
|
95
95
|
</p>
|
96
96
|
<pre>
|
97
97
|
## text_field, password_field
|
98
|
-
<input type="text" size="10" maxsize="20"
|
98
|
+
<input type="text" size="10" maxsize="20" kw:d="text_field 'user', 'name'">
|
99
99
|
=> <%= text_field 'user', 'name', :size=>10, :maxsize=>20 %>
|
100
|
-
<input type="text" name="user[name]"
|
100
|
+
<input type="text" name="user[name]" kw:d="text_field :size=>10">
|
101
101
|
=> <%= text_field "user", "name", :size=>10 %>
|
102
|
-
<input type="text" id="user_name" size="10"
|
102
|
+
<input type="text" id="user_name" size="10" kw:d="text_field">
|
103
103
|
=> <%= text_field "user", "name", :size=>10 %>
|
104
104
|
|
105
105
|
## link_to, link_to_remote
|
106
|
-
<a href="#"
|
106
|
+
<a href="#" kw:d="link_to :action=>'list'">Show list</a>
|
107
107
|
=> <%= link_to 'Show list', :action=>'list' %>
|
108
108
|
|
109
|
-
##
|
110
|
-
<a href="#"
|
111
|
-
=> <%=
|
109
|
+
## start_link_tag, start_remote_link_tag
|
110
|
+
<a href="#" kw:d="start_link_tag :action=>'list'">Show list</a>
|
111
|
+
=> <%= start_link_tag 'action'=>'list' %>Show list</a>
|
112
112
|
|
113
113
|
## mail_to
|
114
|
-
<a href="mail:www@example.com"
|
114
|
+
<a href="mail:www@example.com" kw:d="mail_to">admin</a>
|
115
115
|
=> <%= mail_to "www@example.com", "admin" %>
|
116
116
|
|
117
117
|
## form_tag
|
118
|
-
<form action="show"
|
118
|
+
<form action="show" kw:d="form_tag :id=>2"> ... </form>
|
119
119
|
=> <%= form_tag :action=>"show", :id=>2 %> ... </form>
|
120
120
|
|
121
121
|
## submit_tag
|
122
|
-
<input type="submit" value="OK"
|
122
|
+
<input type="submit" value="OK" kw:d="submit_tag">
|
123
123
|
=> <%= submit_tag "OK" %>
|
124
124
|
|
125
125
|
## text_area
|
126
|
-
<textarea cols="30" rows="3" id="user_desc"
|
126
|
+
<textarea cols="30" rows="3" id="user_desc" kw:d="text_area"></textarea>
|
127
127
|
=> <%= text_area "user", "desc", :cols=>30, :rows=>3 %>
|
128
|
-
<textarea cols="30" rows="3" name="user[desc]"
|
128
|
+
<textarea cols="30" rows="3" name="user[desc]" kw:d="text_area"></textarea>
|
129
129
|
=> <%= text_area "user", "desc", :cols=>30, :rows=>3 %>
|
130
130
|
|
131
131
|
## hidden_field
|
132
|
-
<input type="hidden" id="user_id"
|
132
|
+
<input type="hidden" id="user_id" kw:d="hidden_field">
|
133
133
|
=> <%= hidden_field "user", "id" %>
|
134
|
-
<input type="hidden" name="user[id]"
|
134
|
+
<input type="hidden" name="user[id]" kw:d="hidden_field">
|
135
135
|
=> <%= hidden_field "user", "id" %>
|
136
136
|
|
137
137
|
## check_box
|
138
|
-
<input type="checkbox" id="user_chk1"
|
138
|
+
<input type="checkbox" id="user_chk1" kw:d="check_box">
|
139
139
|
=> <%= check_box "user", "chk1" %>
|
140
|
-
<input type="checkbox" name="user[chk2]"
|
140
|
+
<input type="checkbox" name="user[chk2]" kw:d="check_box">
|
141
141
|
=> <%= check_box "user", "chk2" %>
|
142
142
|
|
143
143
|
## radio_button
|
144
|
-
<input type="radio" id="user_radio" value="val1"
|
144
|
+
<input type="radio" id="user_radio" value="val1" kw:d="radio_button">
|
145
145
|
=> <%= radio_button "user", "radio", "val1" %>
|
146
|
-
<input type="radio" name="user[radio]" value="val2"
|
146
|
+
<input type="radio" name="user[radio]" value="val2" kw:d="radio_button">
|
147
147
|
=> <%= radio_button "user", "radio", "val2" %>
|
148
148
|
|
149
149
|
## select, collection_select, country_select, time_zone_select, date_select, datetime_select
|
150
|
-
<select name="user[birth]"
|
150
|
+
<select name="user[birth]" kw:d="date_select :start_year=>1970">
|
151
151
|
<option value="2000">2000</option>
|
152
152
|
</select>
|
153
153
|
=> <% date_select "user", "birth", :start_year=>1970 %>
|
154
154
|
|
155
155
|
## image_tag, link_image_to, link_to_image
|
156
|
-
<img src="foo.gif" alt="text" width="20" heigth="10"
|
156
|
+
<img src="foo.gif" alt="text" width="20" heigth="10" kw:d="image_tag :size=>'30x40'">
|
157
157
|
=> <%= image_tag "foo.gif", :alt=>"text", :size=>'30x40' %>
|
158
158
|
</pre>
|
159
159
|
|
@@ -166,17 +166,17 @@ directive examples.
|
|
166
166
|
<h3 class="section-bar">Methods</h3>
|
167
167
|
|
168
168
|
<div class="name-list">
|
169
|
-
<a href="#
|
170
|
-
<a href="#
|
171
|
-
<a href="#
|
172
|
-
<a href="#
|
173
|
-
<a href="#
|
174
|
-
<a href="#
|
175
|
-
<a href="#
|
176
|
-
<a href="#
|
177
|
-
<a href="#
|
178
|
-
<a href="#
|
179
|
-
<a href="#
|
169
|
+
<a href="#M000217">add_directive_attr_as_arg</a>
|
170
|
+
<a href="#M000218">add_directive_attr_as_option</a>
|
171
|
+
<a href="#M000219">add_directive_content_as_arg</a>
|
172
|
+
<a href="#M000221">add_directive_expr_option</a>
|
173
|
+
<a href="#M000220">add_directive_integer_option</a>
|
174
|
+
<a href="#M000215">add_directive_object_and_method</a>
|
175
|
+
<a href="#M000216">add_directive_object_and_method_and_value</a>
|
176
|
+
<a href="#M000222">add_directive_str_option</a>
|
177
|
+
<a href="#M000213">handle</a>
|
178
|
+
<a href="#M000223">print_directive</a>
|
179
|
+
<a href="#M000214">quote</a>
|
180
180
|
</div>
|
181
181
|
</div>
|
182
182
|
|
@@ -198,12 +198,12 @@ directive examples.
|
|
198
198
|
<div id="methods">
|
199
199
|
<h3 class="section-bar">Public Instance methods</h3>
|
200
200
|
|
201
|
-
<div id="method-
|
202
|
-
<a name="
|
201
|
+
<div id="method-M000213" class="method-detail">
|
202
|
+
<a name="M000213"></a>
|
203
203
|
|
204
204
|
<div class="method-heading">
|
205
|
-
<a href="#
|
206
|
-
<span class="method-name">handle</span><span class="method-args">(
|
205
|
+
<a href="#M000213" class="method-signature">
|
206
|
+
<span class="method-name">handle</span><span class="method-args">(stmt_list, handler_arg)</span>
|
207
207
|
</a>
|
208
208
|
</div>
|
209
209
|
|
@@ -215,20 +215,22 @@ handle directives for rails.
|
|
215
215
|
everytime return true whenever directive name is unknown.
|
216
216
|
</p>
|
217
217
|
<p><a class="source-toggle" href="#"
|
218
|
-
onclick="toggleCode('
|
219
|
-
<div class="method-source-code" id="
|
218
|
+
onclick="toggleCode('M000213-source');return false;">[Source]</a></p>
|
219
|
+
<div class="method-source-code" id="M000213-source">
|
220
220
|
<pre>
|
221
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">
|
222
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">handle</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">handler_arg</span>)
|
223
223
|
<span class="ruby-identifier">ret</span> = <span class="ruby-keyword kw">super</span>
|
224
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
225
|
|
226
|
-
<span class="ruby-identifier">
|
227
|
-
<span class="ruby-identifier">
|
228
|
-
<span class="ruby-identifier">
|
226
|
+
<span class="ruby-identifier">arg</span> = <span class="ruby-identifier">handler_arg</span>
|
227
|
+
<span class="ruby-identifier">d_name</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">directive_name</span>
|
228
|
+
<span class="ruby-identifier">d_arg</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">directive_arg</span>
|
229
|
+
<span class="ruby-identifier">d_str</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">directive_str</span>
|
230
|
+
<span class="ruby-identifier">attr_info</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">attr_info</span>
|
229
231
|
|
230
232
|
<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">
|
233
|
+
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">d_name</span>.<span class="ruby-identifier">to_s</span>
|
232
234
|
<span class="ruby-keyword kw">when</span> <span class="ruby-regexp re">/(_|\A)radio_button\z/</span>
|
233
235
|
<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
236
|
<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>
|
@@ -236,9 +238,9 @@ everytime return true whenever directive name is unknown.
|
|
236
238
|
<span class="ruby-keyword kw">end</span>
|
237
239
|
|
238
240
|
<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">
|
241
|
+
<span class="ruby-identifier">replace_elem</span> = <span class="ruby-identifier">d_name</span>.<span class="ruby-identifier">to_s</span> <span class="ruby-operator">!~</span> <span class="ruby-regexp re">/\Astart_/</span>
|
240
242
|
|
241
|
-
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">
|
243
|
+
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">d_name</span>
|
242
244
|
|
243
245
|
<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
246
|
<span class="ruby-comment cmt">#add_directive_object_and_method(d_arg, attr_info)</span>
|
@@ -250,13 +252,13 @@ everytime return true whenever directive name is unknown.
|
|
250
252
|
<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
253
|
|
252
254
|
<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>)
|
255
|
+
<span class="ruby-identifier">add_directive_content_as_arg</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">cont_stmts</span>)
|
254
256
|
|
255
257
|
<span class="ruby-keyword kw">when</span> <span class="ruby-identifier">:anchor</span>, <span class="ruby-identifier">:anchor_remote</span>
|
256
258
|
<span class="ruby-identifier">replace_elem</span> = <span class="ruby-keyword kw">false</span>
|
257
259
|
|
258
260
|
<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>)
|
261
|
+
<span class="ruby-identifier">add_directive_content_as_arg</span>(<span class="ruby-identifier">d_arg</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">cont_stmts</span>)
|
260
262
|
<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
263
|
<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
264
|
|
@@ -294,7 +296,7 @@ everytime return true whenever directive name is unknown.
|
|
294
296
|
<span class="ruby-keyword kw">end</span> <span class="ruby-comment cmt">#case</span>
|
295
297
|
|
296
298
|
<span class="ruby-comment cmt">##</span>
|
297
|
-
<span class="ruby-identifier">print_directive</span>(<span class="ruby-identifier">
|
299
|
+
<span class="ruby-identifier">print_directive</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">arg</span>, <span class="ruby-identifier">replace_elem</span>)
|
298
300
|
|
299
301
|
<span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">true</span> <span class="ruby-comment cmt"># everytime return true</span>
|
300
302
|
|
@@ -306,21 +308,21 @@ everytime return true whenever directive name is unknown.
|
|
306
308
|
|
307
309
|
<h3 class="section-bar">Protected Instance methods</h3>
|
308
310
|
|
309
|
-
<div id="method-
|
310
|
-
<a name="
|
311
|
+
<div id="method-M000217" class="method-detail">
|
312
|
+
<a name="M000217"></a>
|
311
313
|
|
312
314
|
<div class="method-heading">
|
313
|
-
<a href="#
|
315
|
+
<a href="#M000217" class="method-signature">
|
314
316
|
<span class="method-name">add_directive_attr_as_arg</span><span class="method-args">(d_arg, attr_info, attr_name)</span>
|
315
317
|
</a>
|
316
318
|
</div>
|
317
319
|
|
318
320
|
<div class="method-description">
|
319
321
|
<p><a class="source-toggle" href="#"
|
320
|
-
onclick="toggleCode('
|
321
|
-
<div class="method-source-code" id="
|
322
|
+
onclick="toggleCode('M000217-source');return false;">[Source]</a></p>
|
323
|
+
<div class="method-source-code" id="M000217-source">
|
322
324
|
<pre>
|
323
|
-
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line
|
325
|
+
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line 206</span>
|
324
326
|
<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
327
|
<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
328
|
<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>
|
@@ -331,21 +333,21 @@ everytime return true whenever directive name is unknown.
|
|
331
333
|
</div>
|
332
334
|
</div>
|
333
335
|
|
334
|
-
<div id="method-
|
335
|
-
<a name="
|
336
|
+
<div id="method-M000218" class="method-detail">
|
337
|
+
<a name="M000218"></a>
|
336
338
|
|
337
339
|
<div class="method-heading">
|
338
|
-
<a href="#
|
340
|
+
<a href="#M000218" class="method-signature">
|
339
341
|
<span class="method-name">add_directive_attr_as_option</span><span class="method-args">(d_arg, attr_info, attr_name)</span>
|
340
342
|
</a>
|
341
343
|
</div>
|
342
344
|
|
343
345
|
<div class="method-description">
|
344
346
|
<p><a class="source-toggle" href="#"
|
345
|
-
onclick="toggleCode('
|
346
|
-
<div class="method-source-code" id="
|
347
|
+
onclick="toggleCode('M000218-source');return false;">[Source]</a></p>
|
348
|
+
<div class="method-source-code" id="M000218-source">
|
347
349
|
<pre>
|
348
|
-
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line
|
350
|
+
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line 213</span>
|
349
351
|
<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
352
|
<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
353
|
<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>
|
@@ -357,21 +359,21 @@ everytime return true whenever directive name is unknown.
|
|
357
359
|
</div>
|
358
360
|
</div>
|
359
361
|
|
360
|
-
<div id="method-
|
361
|
-
<a name="
|
362
|
+
<div id="method-M000219" class="method-detail">
|
363
|
+
<a name="M000219"></a>
|
362
364
|
|
363
365
|
<div class="method-heading">
|
364
|
-
<a href="#
|
366
|
+
<a href="#M000219" class="method-signature">
|
365
367
|
<span class="method-name">add_directive_content_as_arg</span><span class="method-args">(d_arg, cont_stmts)</span>
|
366
368
|
</a>
|
367
369
|
</div>
|
368
370
|
|
369
371
|
<div class="method-description">
|
370
372
|
<p><a class="source-toggle" href="#"
|
371
|
-
onclick="toggleCode('
|
372
|
-
<div class="method-source-code" id="
|
373
|
+
onclick="toggleCode('M000219-source');return false;">[Source]</a></p>
|
374
|
+
<div class="method-source-code" id="M000219-source">
|
373
375
|
<pre>
|
374
|
-
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line
|
376
|
+
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line 221</span>
|
375
377
|
<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
378
|
<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
379
|
<span class="ruby-identifier">print_stmt</span> = <span class="ruby-identifier">cont_stmts</span>[<span class="ruby-value">0</span>]
|
@@ -384,21 +386,21 @@ everytime return true whenever directive name is unknown.
|
|
384
386
|
</div>
|
385
387
|
</div>
|
386
388
|
|
387
|
-
<div id="method-
|
388
|
-
<a name="
|
389
|
+
<div id="method-M000221" class="method-detail">
|
390
|
+
<a name="M000221"></a>
|
389
391
|
|
390
392
|
<div class="method-heading">
|
391
|
-
<a href="#
|
393
|
+
<a href="#M000221" class="method-signature">
|
392
394
|
<span class="method-name">add_directive_expr_option</span><span class="method-args">(directive_arg, attr_name, attr_value)</span>
|
393
395
|
</a>
|
394
396
|
</div>
|
395
397
|
|
396
398
|
<div class="method-description">
|
397
399
|
<p><a class="source-toggle" href="#"
|
398
|
-
onclick="toggleCode('
|
399
|
-
<div class="method-source-code" id="
|
400
|
+
onclick="toggleCode('M000221-source');return false;">[Source]</a></p>
|
401
|
+
<div class="method-source-code" id="M000221-source">
|
400
402
|
<pre>
|
401
|
-
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line
|
403
|
+
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line 238</span>
|
402
404
|
<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
405
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">attr_value</span>
|
404
406
|
<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>
|
@@ -410,21 +412,21 @@ everytime return true whenever directive name is unknown.
|
|
410
412
|
</div>
|
411
413
|
</div>
|
412
414
|
|
413
|
-
<div id="method-
|
414
|
-
<a name="
|
415
|
+
<div id="method-M000220" class="method-detail">
|
416
|
+
<a name="M000220"></a>
|
415
417
|
|
416
418
|
<div class="method-heading">
|
417
|
-
<a href="#
|
419
|
+
<a href="#M000220" class="method-signature">
|
418
420
|
<span class="method-name">add_directive_integer_option</span><span class="method-args">(directive_arg, attr_name, attr_value)</span>
|
419
421
|
</a>
|
420
422
|
</div>
|
421
423
|
|
422
424
|
<div class="method-description">
|
423
425
|
<p><a class="source-toggle" href="#"
|
424
|
-
onclick="toggleCode('
|
425
|
-
<div class="method-source-code" id="
|
426
|
+
onclick="toggleCode('M000220-source');return false;">[Source]</a></p>
|
427
|
+
<div class="method-source-code" id="M000220-source">
|
426
428
|
<pre>
|
427
|
-
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line
|
429
|
+
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line 230</span>
|
428
430
|
<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
431
|
<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
432
|
<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>
|
@@ -436,21 +438,21 @@ everytime return true whenever directive name is unknown.
|
|
436
438
|
</div>
|
437
439
|
</div>
|
438
440
|
|
439
|
-
<div id="method-
|
440
|
-
<a name="
|
441
|
+
<div id="method-M000215" class="method-detail">
|
442
|
+
<a name="M000215"></a>
|
441
443
|
|
442
444
|
<div class="method-heading">
|
443
|
-
<a href="#
|
445
|
+
<a href="#M000215" class="method-signature">
|
444
446
|
<span class="method-name">add_directive_object_and_method</span><span class="method-args">(d_arg, attr_info)</span>
|
445
447
|
</a>
|
446
448
|
</div>
|
447
449
|
|
448
450
|
<div class="method-description">
|
449
451
|
<p><a class="source-toggle" href="#"
|
450
|
-
onclick="toggleCode('
|
451
|
-
<div class="method-source-code" id="
|
452
|
+
onclick="toggleCode('M000215-source');return false;">[Source]</a></p>
|
453
|
+
<div class="method-source-code" id="M000215-source">
|
452
454
|
<pre>
|
453
|
-
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line
|
455
|
+
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line 188</span>
|
454
456
|
<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
457
|
<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
458
|
<span class="ruby-identifier">object</span> = <span class="ruby-identifier">$1</span> ; <span class="ruby-identifier">method</span> = <span class="ruby-identifier">$2</span>
|
@@ -462,21 +464,21 @@ everytime return true whenever directive name is unknown.
|
|
462
464
|
</div>
|
463
465
|
</div>
|
464
466
|
|
465
|
-
<div id="method-
|
466
|
-
<a name="
|
467
|
+
<div id="method-M000216" class="method-detail">
|
468
|
+
<a name="M000216"></a>
|
467
469
|
|
468
470
|
<div class="method-heading">
|
469
|
-
<a href="#
|
471
|
+
<a href="#M000216" class="method-signature">
|
470
472
|
<span class="method-name">add_directive_object_and_method_and_value</span><span class="method-args">(d_arg, attr_info)</span>
|
471
473
|
</a>
|
472
474
|
</div>
|
473
475
|
|
474
476
|
<div class="method-description">
|
475
477
|
<p><a class="source-toggle" href="#"
|
476
|
-
onclick="toggleCode('
|
477
|
-
<div class="method-source-code" id="
|
478
|
+
onclick="toggleCode('M000216-source');return false;">[Source]</a></p>
|
479
|
+
<div class="method-source-code" id="M000216-source">
|
478
480
|
<pre>
|
479
|
-
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line
|
481
|
+
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line 196</span>
|
480
482
|
<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
483
|
<span class="ruby-identifier">object</span> = <span class="ruby-identifier">method</span> = <span class="ruby-value str">''</span>
|
482
484
|
<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>])
|
@@ -490,21 +492,21 @@ everytime return true whenever directive name is unknown.
|
|
490
492
|
</div>
|
491
493
|
</div>
|
492
494
|
|
493
|
-
<div id="method-
|
494
|
-
<a name="
|
495
|
+
<div id="method-M000222" class="method-detail">
|
496
|
+
<a name="M000222"></a>
|
495
497
|
|
496
498
|
<div class="method-heading">
|
497
|
-
<a href="#
|
499
|
+
<a href="#M000222" class="method-signature">
|
498
500
|
<span class="method-name">add_directive_str_option</span><span class="method-args">(directive_arg, attr_name, attr_value)</span>
|
499
501
|
</a>
|
500
502
|
</div>
|
501
503
|
|
502
504
|
<div class="method-description">
|
503
505
|
<p><a class="source-toggle" href="#"
|
504
|
-
onclick="toggleCode('
|
505
|
-
<div class="method-source-code" id="
|
506
|
+
onclick="toggleCode('M000222-source');return false;">[Source]</a></p>
|
507
|
+
<div class="method-source-code" id="M000222-source">
|
506
508
|
<pre>
|
507
|
-
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line
|
509
|
+
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line 246</span>
|
508
510
|
<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
511
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">attr_value</span>
|
510
512
|
<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>
|
@@ -516,32 +518,33 @@ everytime return true whenever directive name is unknown.
|
|
516
518
|
</div>
|
517
519
|
</div>
|
518
520
|
|
519
|
-
<div id="method-
|
520
|
-
<a name="
|
521
|
+
<div id="method-M000223" class="method-detail">
|
522
|
+
<a name="M000223"></a>
|
521
523
|
|
522
524
|
<div class="method-heading">
|
523
|
-
<a href="#
|
524
|
-
<span class="method-name">print_directive</span><span class="method-args">(
|
525
|
+
<a href="#M000223" class="method-signature">
|
526
|
+
<span class="method-name">print_directive</span><span class="method-args">(stmt_list, handler_arg, replace_elem=true)</span>
|
525
527
|
</a>
|
526
528
|
</div>
|
527
529
|
|
528
530
|
<div class="method-description">
|
529
531
|
<p><a class="source-toggle" href="#"
|
530
|
-
onclick="toggleCode('
|
531
|
-
<div class="method-source-code" id="
|
532
|
+
onclick="toggleCode('M000223-source');return false;">[Source]</a></p>
|
533
|
+
<div class="method-source-code" id="M000223-source">
|
532
534
|
<pre>
|
533
|
-
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line
|
534
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">print_directive</span>(<span class="ruby-identifier">
|
535
|
-
<span class="ruby-identifier">
|
536
|
-
<span class="ruby-identifier">
|
537
|
-
<span class="ruby-identifier">
|
538
|
-
<span class="ruby-identifier">
|
539
|
-
<span class="ruby-identifier">
|
540
|
-
<span class="ruby-identifier">
|
541
|
-
<span class="ruby-identifier">
|
535
|
+
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line 254</span>
|
536
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">print_directive</span>(<span class="ruby-identifier">stmt_list</span>, <span class="ruby-identifier">handler_arg</span>, <span class="ruby-identifier">replace_elem</span>=<span class="ruby-keyword kw">true</span>)
|
537
|
+
<span class="ruby-identifier">arg</span> = <span class="ruby-identifier">handler_arg</span>
|
538
|
+
<span class="ruby-identifier">head_space</span> = <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">stag_info</span>.<span class="ruby-identifier">head_space</span>
|
539
|
+
<span class="ruby-identifier">tail_space</span> = (<span class="ruby-identifier">arg</span>.<span class="ruby-identifier">etag_info</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">stag_info</span>).<span class="ruby-identifier">tail_space</span>
|
540
|
+
<span class="ruby-identifier">pargs</span> = []
|
541
|
+
<span class="ruby-identifier">pargs</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>
|
542
|
+
<span class="ruby-identifier">pargs</span> <span class="ruby-operator"><<</span> <span class="ruby-constant">NativeExpression</span>.<span class="ruby-identifier">new</span>(<span class="ruby-node">"#{arg.directive_name} #{arg.directive_arg}"</span>)
|
543
|
+
<span class="ruby-identifier">pargs</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>
|
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">pargs</span>)
|
542
545
|
<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>])
|
546
|
+
<span class="ruby-identifier">stmt_list</span>.<span class="ruby-identifier">concat</span>(<span class="ruby-identifier">arg</span>.<span class="ruby-identifier">cont_stmts</span>)
|
547
|
+
<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">arg</span>.<span class="ruby-identifier">etag_info</span>.<span class="ruby-identifier">tag_text</span>])
|
545
548
|
<span class="ruby-keyword kw">end</span>
|
546
549
|
<span class="ruby-keyword kw">end</span>
|
547
550
|
</pre>
|
@@ -549,21 +552,21 @@ everytime return true whenever directive name is unknown.
|
|
549
552
|
</div>
|
550
553
|
</div>
|
551
554
|
|
552
|
-
<div id="method-
|
553
|
-
<a name="
|
555
|
+
<div id="method-M000214" class="method-detail">
|
556
|
+
<a name="M000214"></a>
|
554
557
|
|
555
558
|
<div class="method-heading">
|
556
|
-
<a href="#
|
559
|
+
<a href="#M000214" class="method-signature">
|
557
560
|
<span class="method-name">quote</span><span class="method-args">(str)</span>
|
558
561
|
</a>
|
559
562
|
</div>
|
560
563
|
|
561
564
|
<div class="method-description">
|
562
565
|
<p><a class="source-toggle" href="#"
|
563
|
-
onclick="toggleCode('
|
564
|
-
<div class="method-source-code" id="
|
566
|
+
onclick="toggleCode('M000214-source');return false;">[Source]</a></p>
|
567
|
+
<div class="method-source-code" id="M000214-source">
|
565
568
|
<pre>
|
566
|
-
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line
|
569
|
+
<span class="ruby-comment cmt"># File kwartz/binding/rails.rb, line 183</span>
|
567
570
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">quote</span>(<span class="ruby-identifier">str</span>)
|
568
571
|
<span class="ruby-keyword kw">return</span> <span class="ruby-node">"'#{str.gsub(/['\\]/, '\\\\\&')}'"</span>
|
569
572
|
<span class="ruby-keyword kw">end</span>
|