erubis 2.1.0 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/{ChangeLog → CHANGES} +139 -6
- data/MIT-LICENSE +20 -0
- data/README.txt +20 -5
- data/benchmark/erubybench.rb +465 -229
- data/benchmark/erubybench.rhtml +39 -15
- data/benchmark/erubybench.yaml +126 -46
- data/bin/erubis +2 -2
- data/bin/notext +3 -3
- data/contrib/action_view_base_rb.patch +23 -0
- data/contrib/erubis +466 -308
- data/contrib/inline-require +2 -2
- data/doc-api/classes/ERB.html +101 -0
- data/doc-api/classes/Erubis.html +59 -6
- data/doc-api/classes/Erubis/ArrayEnhancer.html +12 -12
- data/doc-api/classes/Erubis/Basic/Converter.html +61 -57
- data/doc-api/classes/Erubis/BiPatternEnhancer.html +14 -14
- data/doc-api/classes/Erubis/CGenerator.html +60 -60
- data/doc-api/classes/Erubis/Context.html +125 -29
- data/doc-api/classes/Erubis/Converter.html +73 -22
- data/doc-api/classes/Erubis/Engine.html +55 -39
- data/doc-api/classes/Erubis/EscapeEnhancer.html +6 -6
- data/doc-api/classes/Erubis/Evaluator.html +19 -19
- data/doc-api/classes/Erubis/Generator.html +16 -10
- data/doc-api/classes/Erubis/HeaderFooterEnhancer.html +14 -14
- data/doc-api/classes/Erubis/{Helper.html → Helpers.html} +5 -6
- data/doc-api/classes/Erubis/Helpers/RailsHelper.html +296 -0
- data/doc-api/classes/Erubis/JavaGenerator.html +54 -54
- data/doc-api/classes/Erubis/JavascriptGenerator.html +60 -60
- data/doc-api/classes/Erubis/Main.html +42 -30
- data/doc-api/classes/Erubis/NoCodeEnhancer.html +5 -5
- data/doc-api/classes/Erubis/NoTextEnhancer.html +7 -7
- data/doc-api/classes/Erubis/OptimizedEruby.html +6 -6
- data/doc-api/classes/Erubis/OptimizedGenerator.html +72 -72
- data/doc-api/classes/Erubis/OptimizedXmlEruby.html +6 -6
- data/doc-api/classes/Erubis/PI/Converter.html +28 -81
- data/doc-api/classes/Erubis/PI/Ec.html +6 -6
- data/doc-api/classes/Erubis/PI/Ejava.html +6 -6
- data/doc-api/classes/Erubis/PI/Ejavascript.html +6 -6
- data/doc-api/classes/Erubis/PI/Eperl.html +6 -6
- data/doc-api/classes/Erubis/PI/Ephp.html +6 -6
- data/doc-api/classes/Erubis/PI/Eruby.html +7 -7
- data/doc-api/classes/Erubis/PI/Escheme.html +6 -6
- data/doc-api/classes/Erubis/PI/TinyEruby.html +66 -79
- data/doc-api/classes/Erubis/PercentLineEnhancer.html +8 -8
- data/doc-api/classes/Erubis/PerlGenerator.html +54 -54
- data/doc-api/classes/Erubis/PhpGenerator.html +54 -54
- data/doc-api/classes/Erubis/PrintEnabledEnhancer.html +21 -21
- data/doc-api/classes/Erubis/PrintOutEnhancer.html +30 -30
- data/doc-api/classes/Erubis/RubyEvaluator.html +12 -12
- data/doc-api/classes/Erubis/RubyGenerator.html +9 -9
- data/doc-api/classes/Erubis/SimplifyEnhancer.html +7 -6
- data/doc-api/classes/Erubis/StdoutEnhancer.html +12 -12
- data/doc-api/classes/Erubis/StringBufferEnhancer.html +13 -13
- data/doc-api/classes/Erubis/TinyEruby.html +56 -68
- data/doc-api/classes/Erubis/XmlHelper.html +20 -23
- data/doc-api/created.rid +1 -1
- data/doc-api/files/{__/README_txt.html → README_txt.html} +35 -20
- data/doc-api/files/erubis/context_rb.html +2 -2
- data/doc-api/files/erubis/converter_rb.html +2 -2
- data/doc-api/files/erubis/engine/ec_rb.html +2 -2
- data/doc-api/files/erubis/engine/ejava_rb.html +2 -2
- data/doc-api/files/erubis/engine/ejavascript_rb.html +2 -2
- data/doc-api/files/erubis/engine/enhanced_rb.html +2 -2
- data/doc-api/files/erubis/engine/eperl_rb.html +2 -2
- data/doc-api/files/erubis/engine/ephp_rb.html +2 -2
- data/doc-api/files/erubis/engine/eruby_rb.html +2 -3
- data/doc-api/files/erubis/engine/escheme_rb.html +2 -2
- data/doc-api/files/erubis/engine/optimized_rb.html +2 -2
- data/doc-api/files/erubis/engine_rb.html +2 -2
- data/doc-api/files/erubis/enhancer_rb.html +2 -2
- data/doc-api/files/erubis/error_rb.html +2 -2
- data/doc-api/files/erubis/evaluator_rb.html +2 -2
- data/doc-api/files/erubis/generator_rb.html +2 -2
- data/doc-api/files/erubis/helper_rb.html +2 -2
- data/doc-api/files/erubis/{helper/rails_rb.html → helpers/rails_helper_rb.html} +6 -31
- data/doc-api/files/erubis/local-setting_rb.html +2 -2
- data/doc-api/files/erubis/main_rb.html +4 -2
- data/doc-api/files/erubis/tiny_rb.html +2 -2
- data/doc-api/files/erubis_rb.html +2 -2
- data/doc-api/fr_class_index.html +3 -3
- data/doc-api/fr_file_index.html +2 -2
- data/doc-api/fr_method_index.html +142 -147
- data/doc-api/index.html +1 -1
- data/doc/users-guide.html +387 -218
- data/lib/erubis.rb +21 -25
- data/lib/erubis/context.rb +34 -4
- data/lib/erubis/converter.rb +159 -115
- data/lib/erubis/engine.rb +29 -12
- data/lib/erubis/engine/ec.rb +2 -2
- data/lib/erubis/engine/ejava.rb +2 -2
- data/lib/erubis/engine/ejavascript.rb +2 -2
- data/lib/erubis/engine/enhanced.rb +2 -2
- data/lib/erubis/engine/eperl.rb +2 -2
- data/lib/erubis/engine/ephp.rb +2 -2
- data/lib/erubis/engine/eruby.rb +5 -6
- data/lib/erubis/engine/escheme.rb +2 -2
- data/lib/erubis/engine/optimized.rb +2 -2
- data/lib/erubis/enhancer.rb +33 -7
- data/lib/erubis/error.rb +2 -2
- data/lib/erubis/evaluator.rb +2 -2
- data/lib/erubis/generator.rb +6 -3
- data/lib/erubis/helper.rb +6 -23
- data/lib/erubis/helpers/rails_helper.rb +202 -0
- data/lib/erubis/local-setting.rb +4 -4
- data/lib/erubis/main.rb +90 -35
- data/lib/erubis/tiny.rb +57 -52
- data/test/assert-text-equal.rb +2 -2
- data/test/test-engines.rb +5 -5
- data/test/test-erubis.rb +173 -63
- data/test/test-main.rb +135 -27
- data/test/test-notext.rb +2 -2
- data/test/test.rb +2 -2
- data/test/testutil.rb +2 -2
- metadata +16 -16
- data/LGPL +0 -504
- data/doc-api/classes/Erubis/Helper/CachedRailsTemplate.html +0 -198
- data/doc-api/classes/Erubis/Helper/RailsTemplate.html +0 -366
- data/lib/erubis/helper/rails.rb +0 -159
@@ -72,6 +72,12 @@
|
|
72
72
|
|
73
73
|
<div id="contextContent">
|
74
74
|
|
75
|
+
<div id="description">
|
76
|
+
<p>
|
77
|
+
code generator, called by <a href="Converter.html">Converter</a> module
|
78
|
+
</p>
|
79
|
+
|
80
|
+
</div>
|
75
81
|
|
76
82
|
|
77
83
|
</div>
|
@@ -142,7 +148,7 @@ add_expr().
|
|
142
148
|
onclick="toggleCode('M000016-source');return false;">[Source]</a></p>
|
143
149
|
<div class="method-source-code" id="M000016-source">
|
144
150
|
<pre>
|
145
|
-
<span class="ruby-comment cmt"># File erubis/generator.rb, line
|
151
|
+
<span class="ruby-comment cmt"># File erubis/generator.rb, line 73</span>
|
146
152
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_expr_debug</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
|
147
153
|
<span class="ruby-identifier">not_implemented</span>
|
148
154
|
<span class="ruby-keyword kw">end</span>
|
@@ -169,7 +175,7 @@ add_expr().
|
|
169
175
|
onclick="toggleCode('M000015-source');return false;">[Source]</a></p>
|
170
176
|
<div class="method-source-code" id="M000015-source">
|
171
177
|
<pre>
|
172
|
-
<span class="ruby-comment cmt"># File erubis/generator.rb, line
|
178
|
+
<span class="ruby-comment cmt"># File erubis/generator.rb, line 68</span>
|
173
179
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_expr_escaped</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
|
174
180
|
<span class="ruby-identifier">not_implemented</span>
|
175
181
|
<span class="ruby-keyword kw">end</span>
|
@@ -196,7 +202,7 @@ add_expr().
|
|
196
202
|
onclick="toggleCode('M000014-source');return false;">[Source]</a></p>
|
197
203
|
<div class="method-source-code" id="M000014-source">
|
198
204
|
<pre>
|
199
|
-
<span class="ruby-comment cmt"># File erubis/generator.rb, line
|
205
|
+
<span class="ruby-comment cmt"># File erubis/generator.rb, line 63</span>
|
200
206
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_expr_literal</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
|
201
207
|
<span class="ruby-identifier">not_implemented</span>
|
202
208
|
<span class="ruby-keyword kw">end</span>
|
@@ -222,7 +228,7 @@ add_expr().
|
|
222
228
|
onclick="toggleCode('M000017-source');return false;">[Source]</a></p>
|
223
229
|
<div class="method-source-code" id="M000017-source">
|
224
230
|
<pre>
|
225
|
-
<span class="ruby-comment cmt"># File erubis/generator.rb, line
|
231
|
+
<span class="ruby-comment cmt"># File erubis/generator.rb, line 78</span>
|
226
232
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
|
227
233
|
<span class="ruby-identifier">not_implemented</span>
|
228
234
|
<span class="ruby-keyword kw">end</span>
|
@@ -248,7 +254,7 @@ add_expr().
|
|
248
254
|
onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
|
249
255
|
<div class="method-source-code" id="M000011-source">
|
250
256
|
<pre>
|
251
|
-
<span class="ruby-comment cmt"># File erubis/generator.rb, line
|
257
|
+
<span class="ruby-comment cmt"># File erubis/generator.rb, line 48</span>
|
252
258
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
|
253
259
|
<span class="ruby-identifier">not_implemented</span>
|
254
260
|
<span class="ruby-keyword kw">end</span>
|
@@ -274,7 +280,7 @@ add_expr().
|
|
274
280
|
onclick="toggleCode('M000013-source');return false;">[Source]</a></p>
|
275
281
|
<div class="method-source-code" id="M000013-source">
|
276
282
|
<pre>
|
277
|
-
<span class="ruby-comment cmt"># File erubis/generator.rb, line
|
283
|
+
<span class="ruby-comment cmt"># File erubis/generator.rb, line 58</span>
|
278
284
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_stmt</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>)
|
279
285
|
<span class="ruby-identifier">not_implemented</span>
|
280
286
|
<span class="ruby-keyword kw">end</span>
|
@@ -300,7 +306,7 @@ add_expr().
|
|
300
306
|
onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
|
301
307
|
<div class="method-source-code" id="M000012-source">
|
302
308
|
<pre>
|
303
|
-
<span class="ruby-comment cmt"># File erubis/generator.rb, line
|
309
|
+
<span class="ruby-comment cmt"># File erubis/generator.rb, line 53</span>
|
304
310
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">text</span>)
|
305
311
|
<span class="ruby-identifier">not_implemented</span>
|
306
312
|
<span class="ruby-keyword kw">end</span>
|
@@ -335,7 +341,7 @@ ex.
|
|
335
341
|
onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
|
336
342
|
<div class="method-source-code" id="M000009-source">
|
337
343
|
<pre>
|
338
|
-
<span class="ruby-comment cmt"># File erubis/generator.rb, line
|
344
|
+
<span class="ruby-comment cmt"># File erubis/generator.rb, line 37</span>
|
339
345
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>)
|
340
346
|
<span class="ruby-identifier">not_implemented</span>
|
341
347
|
<span class="ruby-keyword kw">end</span>
|
@@ -362,7 +368,7 @@ return escaped expression code (ex. ‘h(…)’ or
|
|
362
368
|
onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
|
363
369
|
<div class="method-source-code" id="M000010-source">
|
364
370
|
<pre>
|
365
|
-
<span class="ruby-comment cmt"># File erubis/generator.rb, line
|
371
|
+
<span class="ruby-comment cmt"># File erubis/generator.rb, line 42</span>
|
366
372
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escaped_expr</span>(<span class="ruby-identifier">code</span>)
|
367
373
|
<span class="ruby-identifier">code</span>.<span class="ruby-identifier">strip!</span>
|
368
374
|
<span class="ruby-keyword kw">return</span> <span class="ruby-node">"#{@escapefunc}(#{code})"</span>
|
@@ -386,7 +392,7 @@ return escaped expression code (ex. ‘h(…)’ or
|
|
386
392
|
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
|
387
393
|
<div class="method-source-code" id="M000008-source">
|
388
394
|
<pre>
|
389
|
-
<span class="ruby-comment cmt"># File erubis/generator.rb, line
|
395
|
+
<span class="ruby-comment cmt"># File erubis/generator.rb, line 25</span>
|
390
396
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_generator</span>(<span class="ruby-identifier">properties</span>={})
|
391
397
|
<span class="ruby-ivar">@escapefunc</span> = <span class="ruby-identifier">properties</span>[<span class="ruby-identifier">:escapefunc</span>]
|
392
398
|
<span class="ruby-keyword kw">end</span>
|
@@ -139,8 +139,8 @@ this is language-independent.
|
|
139
139
|
<h3 class="section-bar">Methods</h3>
|
140
140
|
|
141
141
|
<div class="name-list">
|
142
|
-
<a href="#
|
143
|
-
<a href="#
|
142
|
+
<a href="#M000082">add_text</a>
|
143
|
+
<a href="#M000083">convert</a>
|
144
144
|
</div>
|
145
145
|
</div>
|
146
146
|
|
@@ -193,21 +193,21 @@ this is language-independent.
|
|
193
193
|
<div id="methods">
|
194
194
|
<h3 class="section-bar">Public Instance methods</h3>
|
195
195
|
|
196
|
-
<div id="method-
|
197
|
-
<a name="
|
196
|
+
<div id="method-M000082" class="method-detail">
|
197
|
+
<a name="M000082"></a>
|
198
198
|
|
199
199
|
<div class="method-heading">
|
200
|
-
<a href="#
|
200
|
+
<a href="#M000082" class="method-signature">
|
201
201
|
<span class="method-name">add_text</span><span class="method-args">(src, text)</span>
|
202
202
|
</a>
|
203
203
|
</div>
|
204
204
|
|
205
205
|
<div class="method-description">
|
206
206
|
<p><a class="source-toggle" href="#"
|
207
|
-
onclick="toggleCode('
|
208
|
-
<div class="method-source-code" id="
|
207
|
+
onclick="toggleCode('M000082-source');return false;">[Source]</a></p>
|
208
|
+
<div class="method-source-code" id="M000082-source">
|
209
209
|
<pre>
|
210
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
210
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 524</span>
|
211
211
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">text</span>)
|
212
212
|
<span class="ruby-identifier">text</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-constant">HEADER_FOOTER_PATTERN</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">txt</span>, <span class="ruby-identifier">lspace</span>, <span class="ruby-identifier">word</span>, <span class="ruby-identifier">content</span>, <span class="ruby-identifier">rspace</span><span class="ruby-operator">|</span>
|
213
213
|
<span class="ruby-identifier">flag_trim</span> = <span class="ruby-ivar">@trim</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">lspace</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">rspace</span>
|
@@ -225,21 +225,21 @@ this is language-independent.
|
|
225
225
|
</div>
|
226
226
|
</div>
|
227
227
|
|
228
|
-
<div id="method-
|
229
|
-
<a name="
|
228
|
+
<div id="method-M000083" class="method-detail">
|
229
|
+
<a name="M000083"></a>
|
230
230
|
|
231
231
|
<div class="method-heading">
|
232
|
-
<a href="#
|
232
|
+
<a href="#M000083" class="method-signature">
|
233
233
|
<span class="method-name">convert</span><span class="method-args">(input)</span>
|
234
234
|
</a>
|
235
235
|
</div>
|
236
236
|
|
237
237
|
<div class="method-description">
|
238
238
|
<p><a class="source-toggle" href="#"
|
239
|
-
onclick="toggleCode('
|
240
|
-
<div class="method-source-code" id="
|
239
|
+
onclick="toggleCode('M000083-source');return false;">[Source]</a></p>
|
240
|
+
<div class="method-source-code" id="M000083-source">
|
241
241
|
<pre>
|
242
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
242
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 539</span>
|
243
243
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">convert</span>(<span class="ruby-identifier">input</span>)
|
244
244
|
<span class="ruby-identifier">source</span> = <span class="ruby-keyword kw">super</span>
|
245
245
|
<span class="ruby-keyword kw">return</span> <span class="ruby-ivar">@src</span> = <span class="ruby-node">"#{@header}#{source}#{@footer}"</span>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
7
|
<head>
|
8
|
-
<title>Module: Erubis::
|
8
|
+
<title>Module: Erubis::Helpers</title>
|
9
9
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
10
|
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
11
|
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
@@ -50,13 +50,13 @@
|
|
50
50
|
<table class="header-table">
|
51
51
|
<tr class="top-aligned-row">
|
52
52
|
<td><strong>Module</strong></td>
|
53
|
-
<td class="class-name-in-header">Erubis::
|
53
|
+
<td class="class-name-in-header">Erubis::Helpers</td>
|
54
54
|
</tr>
|
55
55
|
<tr class="top-aligned-row">
|
56
56
|
<td><strong>In:</strong></td>
|
57
57
|
<td>
|
58
|
-
<a href="../../files/erubis/
|
59
|
-
erubis/
|
58
|
+
<a href="../../files/erubis/helpers/rails_helper_rb.html">
|
59
|
+
erubis/helpers/rails_helper.rb
|
60
60
|
</a>
|
61
61
|
<br />
|
62
62
|
</td>
|
@@ -87,8 +87,7 @@
|
|
87
87
|
<div id="class-list">
|
88
88
|
<h3 class="section-bar">Classes and Modules</h3>
|
89
89
|
|
90
|
-
|
91
|
-
Class <a href="Helper/RailsTemplate.html" class="link">Erubis::Helper::RailsTemplate</a><br />
|
90
|
+
Module <a href="Helpers/RailsHelper.html" class="link">Erubis::Helpers::RailsHelper</a><br />
|
92
91
|
|
93
92
|
</div>
|
94
93
|
|
@@ -0,0 +1,296 @@
|
|
1
|
+
<?xml version="1.0" encoding="iso-8859-1"?>
|
2
|
+
<!DOCTYPE html
|
3
|
+
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
4
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
5
|
+
|
6
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
7
|
+
<head>
|
8
|
+
<title>Module: Erubis::Helpers::RailsHelper</title>
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
10
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
11
|
+
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
12
|
+
<script type="text/javascript">
|
13
|
+
// <![CDATA[
|
14
|
+
|
15
|
+
function popupCode( url ) {
|
16
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
17
|
+
}
|
18
|
+
|
19
|
+
function toggleCode( id ) {
|
20
|
+
if ( document.getElementById )
|
21
|
+
elem = document.getElementById( id );
|
22
|
+
else if ( document.all )
|
23
|
+
elem = eval( "document.all." + id );
|
24
|
+
else
|
25
|
+
return false;
|
26
|
+
|
27
|
+
elemStyle = elem.style;
|
28
|
+
|
29
|
+
if ( elemStyle.display != "block" ) {
|
30
|
+
elemStyle.display = "block"
|
31
|
+
} else {
|
32
|
+
elemStyle.display = "none"
|
33
|
+
}
|
34
|
+
|
35
|
+
return true;
|
36
|
+
}
|
37
|
+
|
38
|
+
// Make codeblocks hidden by default
|
39
|
+
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
40
|
+
|
41
|
+
// ]]>
|
42
|
+
</script>
|
43
|
+
|
44
|
+
</head>
|
45
|
+
<body>
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
<div id="classHeader">
|
50
|
+
<table class="header-table">
|
51
|
+
<tr class="top-aligned-row">
|
52
|
+
<td><strong>Module</strong></td>
|
53
|
+
<td class="class-name-in-header">Erubis::Helpers::RailsHelper</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../../../files/erubis/helpers/rails_helper_rb.html">
|
59
|
+
erubis/helpers/rails_helper.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
</td>
|
63
|
+
</tr>
|
64
|
+
|
65
|
+
</table>
|
66
|
+
</div>
|
67
|
+
<!-- banner header -->
|
68
|
+
|
69
|
+
<div id="bodyContent">
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
<div id="contextContent">
|
74
|
+
|
75
|
+
<div id="description">
|
76
|
+
<p>
|
77
|
+
helper module for Ruby on Rails
|
78
|
+
</p>
|
79
|
+
<p>
|
80
|
+
howto:
|
81
|
+
</p>
|
82
|
+
<ol>
|
83
|
+
<li>add the folliwng code in your ‘config/environment.rb‘
|
84
|
+
|
85
|
+
<pre>
|
86
|
+
require 'erubis/helpers/rails_helper'
|
87
|
+
#Erubis::Helpers::RailsHelper.engine_class = Erubis::Eruby
|
88
|
+
#Erubis::Helpers::RailsHelper.init_properties = {}
|
89
|
+
#Erubis::Helpers::RailsHelper.show_src = false
|
90
|
+
</pre>
|
91
|
+
</li>
|
92
|
+
<li>(optional) apply the patch for ‘action_view/base.rb‘
|
93
|
+
|
94
|
+
<pre>
|
95
|
+
$ cd /usr/local/lib/ruby/gems/1.8/gems/actionpack-1.13.1/lib/action_view/
|
96
|
+
$ sudo patch -p1 < /tmp/erubis_2.X.X/contrib/action_view_base_rb.patch
|
97
|
+
</pre>
|
98
|
+
</li>
|
99
|
+
<li>restart web server.
|
100
|
+
|
101
|
+
</li>
|
102
|
+
</ol>
|
103
|
+
<p>
|
104
|
+
if Erubis::Helper::Rails.show_src is ture, <a
|
105
|
+
href="../../Erubis.html">Erubis</a> prints converted Ruby code into log
|
106
|
+
file (‘log/development.log’ or so). This may be useful for
|
107
|
+
debug.
|
108
|
+
</p>
|
109
|
+
|
110
|
+
</div>
|
111
|
+
|
112
|
+
|
113
|
+
</div>
|
114
|
+
|
115
|
+
<div id="method-list">
|
116
|
+
<h3 class="section-bar">Methods</h3>
|
117
|
+
|
118
|
+
<div class="name-list">
|
119
|
+
<a href="#M000073">engine_class</a>
|
120
|
+
<a href="#M000074">engine_class=</a>
|
121
|
+
<a href="#M000075">init_properties</a>
|
122
|
+
<a href="#M000076">init_properties=</a>
|
123
|
+
<a href="#M000077">show_src</a>
|
124
|
+
<a href="#M000078">show_src=</a>
|
125
|
+
</div>
|
126
|
+
</div>
|
127
|
+
|
128
|
+
</div>
|
129
|
+
|
130
|
+
|
131
|
+
<!-- if includes -->
|
132
|
+
|
133
|
+
<div id="section">
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
<!-- if method_list -->
|
143
|
+
<div id="methods">
|
144
|
+
<h3 class="section-bar">Public Class methods</h3>
|
145
|
+
|
146
|
+
<div id="method-M000073" class="method-detail">
|
147
|
+
<a name="M000073"></a>
|
148
|
+
|
149
|
+
<div class="method-heading">
|
150
|
+
<a href="#M000073" class="method-signature">
|
151
|
+
<span class="method-name">engine_class</span><span class="method-args">()</span>
|
152
|
+
</a>
|
153
|
+
</div>
|
154
|
+
|
155
|
+
<div class="method-description">
|
156
|
+
<p><a class="source-toggle" href="#"
|
157
|
+
onclick="toggleCode('M000073-source');return false;">[Source]</a></p>
|
158
|
+
<div class="method-source-code" id="M000073-source">
|
159
|
+
<pre>
|
160
|
+
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 42</span>
|
161
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">engine_class</span>
|
162
|
+
<span class="ruby-ivar">@@engine_class</span>
|
163
|
+
<span class="ruby-keyword kw">end</span>
|
164
|
+
</pre>
|
165
|
+
</div>
|
166
|
+
</div>
|
167
|
+
</div>
|
168
|
+
|
169
|
+
<div id="method-M000074" class="method-detail">
|
170
|
+
<a name="M000074"></a>
|
171
|
+
|
172
|
+
<div class="method-heading">
|
173
|
+
<a href="#M000074" class="method-signature">
|
174
|
+
<span class="method-name">engine_class=</span><span class="method-args">(klass)</span>
|
175
|
+
</a>
|
176
|
+
</div>
|
177
|
+
|
178
|
+
<div class="method-description">
|
179
|
+
<p><a class="source-toggle" href="#"
|
180
|
+
onclick="toggleCode('M000074-source');return false;">[Source]</a></p>
|
181
|
+
<div class="method-source-code" id="M000074-source">
|
182
|
+
<pre>
|
183
|
+
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 46</span>
|
184
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">engine_class=</span>(<span class="ruby-identifier">klass</span>)
|
185
|
+
<span class="ruby-ivar">@@engine_class</span> = <span class="ruby-identifier">klass</span>
|
186
|
+
<span class="ruby-keyword kw">end</span>
|
187
|
+
</pre>
|
188
|
+
</div>
|
189
|
+
</div>
|
190
|
+
</div>
|
191
|
+
|
192
|
+
<div id="method-M000075" class="method-detail">
|
193
|
+
<a name="M000075"></a>
|
194
|
+
|
195
|
+
<div class="method-heading">
|
196
|
+
<a href="#M000075" class="method-signature">
|
197
|
+
<span class="method-name">init_properties</span><span class="method-args">()</span>
|
198
|
+
</a>
|
199
|
+
</div>
|
200
|
+
|
201
|
+
<div class="method-description">
|
202
|
+
<p><a class="source-toggle" href="#"
|
203
|
+
onclick="toggleCode('M000075-source');return false;">[Source]</a></p>
|
204
|
+
<div class="method-source-code" id="M000075-source">
|
205
|
+
<pre>
|
206
|
+
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 53</span>
|
207
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">init_properties</span>
|
208
|
+
<span class="ruby-ivar">@@init_properties</span>
|
209
|
+
<span class="ruby-keyword kw">end</span>
|
210
|
+
</pre>
|
211
|
+
</div>
|
212
|
+
</div>
|
213
|
+
</div>
|
214
|
+
|
215
|
+
<div id="method-M000076" class="method-detail">
|
216
|
+
<a name="M000076"></a>
|
217
|
+
|
218
|
+
<div class="method-heading">
|
219
|
+
<a href="#M000076" class="method-signature">
|
220
|
+
<span class="method-name">init_properties=</span><span class="method-args">(hash)</span>
|
221
|
+
</a>
|
222
|
+
</div>
|
223
|
+
|
224
|
+
<div class="method-description">
|
225
|
+
<p><a class="source-toggle" href="#"
|
226
|
+
onclick="toggleCode('M000076-source');return false;">[Source]</a></p>
|
227
|
+
<div class="method-source-code" id="M000076-source">
|
228
|
+
<pre>
|
229
|
+
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 57</span>
|
230
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">init_properties=</span>(<span class="ruby-identifier">hash</span>)
|
231
|
+
<span class="ruby-ivar">@@init_properties</span> = <span class="ruby-identifier">hash</span>
|
232
|
+
<span class="ruby-keyword kw">end</span>
|
233
|
+
</pre>
|
234
|
+
</div>
|
235
|
+
</div>
|
236
|
+
</div>
|
237
|
+
|
238
|
+
<div id="method-M000077" class="method-detail">
|
239
|
+
<a name="M000077"></a>
|
240
|
+
|
241
|
+
<div class="method-heading">
|
242
|
+
<a href="#M000077" class="method-signature">
|
243
|
+
<span class="method-name">show_src</span><span class="method-args">()</span>
|
244
|
+
</a>
|
245
|
+
</div>
|
246
|
+
|
247
|
+
<div class="method-description">
|
248
|
+
<p><a class="source-toggle" href="#"
|
249
|
+
onclick="toggleCode('M000077-source');return false;">[Source]</a></p>
|
250
|
+
<div class="method-source-code" id="M000077-source">
|
251
|
+
<pre>
|
252
|
+
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 64</span>
|
253
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">show_src</span>
|
254
|
+
<span class="ruby-ivar">@@show_src</span>
|
255
|
+
<span class="ruby-keyword kw">end</span>
|
256
|
+
</pre>
|
257
|
+
</div>
|
258
|
+
</div>
|
259
|
+
</div>
|
260
|
+
|
261
|
+
<div id="method-M000078" class="method-detail">
|
262
|
+
<a name="M000078"></a>
|
263
|
+
|
264
|
+
<div class="method-heading">
|
265
|
+
<a href="#M000078" class="method-signature">
|
266
|
+
<span class="method-name">show_src=</span><span class="method-args">(flag)</span>
|
267
|
+
</a>
|
268
|
+
</div>
|
269
|
+
|
270
|
+
<div class="method-description">
|
271
|
+
<p><a class="source-toggle" href="#"
|
272
|
+
onclick="toggleCode('M000078-source');return false;">[Source]</a></p>
|
273
|
+
<div class="method-source-code" id="M000078-source">
|
274
|
+
<pre>
|
275
|
+
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 68</span>
|
276
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">show_src=</span>(<span class="ruby-identifier">flag</span>)
|
277
|
+
<span class="ruby-ivar">@@show_src</span> = <span class="ruby-identifier">flag</span>
|
278
|
+
<span class="ruby-keyword kw">end</span>
|
279
|
+
</pre>
|
280
|
+
</div>
|
281
|
+
</div>
|
282
|
+
</div>
|
283
|
+
|
284
|
+
|
285
|
+
</div>
|
286
|
+
|
287
|
+
|
288
|
+
</div>
|
289
|
+
|
290
|
+
|
291
|
+
<div id="validator-badges">
|
292
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
293
|
+
</div>
|
294
|
+
|
295
|
+
</body>
|
296
|
+
</html>
|