erubis 2.3.1 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/{CHANGES → CHANGES.txt} +373 -3
- data/MIT-LICENSE +1 -1
- data/README.txt +6 -5
- data/benchmark/bench.rb +18 -11
- data/bin/erubis +3 -4
- data/contrib/erubis +3462 -5
- data/contrib/inline-require +54 -28
- data/doc/docstyle.css +25 -4
- data/doc/users-guide.html +814 -110
- data/doc-api/classes/ActionView/TemplateHandlers/ErubisHandler.html +209 -0
- data/doc-api/classes/ActionView.html +105 -0
- data/doc-api/classes/Erubis/ArrayBufferEnhancer.html +14 -14
- data/doc-api/classes/Erubis/ArrayEnhancer.html +16 -16
- data/doc-api/classes/Erubis/Basic/Converter.html +36 -31
- data/doc-api/classes/Erubis/BiPatternEnhancer.html +16 -13
- data/doc-api/classes/Erubis/CGenerator.html +70 -70
- data/doc-api/classes/Erubis/Context.html +49 -49
- data/doc-api/classes/Erubis/Converter.html +30 -29
- data/doc-api/classes/Erubis/CppGenerator.html +382 -0
- data/doc-api/classes/Erubis/DeleteIndentEnhancer.html +7 -7
- data/doc-api/classes/Erubis/Ecpp.html +126 -0
- data/doc-api/classes/Erubis/Engine.html +46 -43
- data/doc-api/classes/Erubis/ErboutEnhancer.html +16 -16
- data/doc-api/classes/Erubis/EscapeEnhancer.html +7 -7
- data/doc-api/classes/Erubis/EscapedEcpp.html +120 -0
- data/doc-api/classes/Erubis/Evaluator.html +22 -22
- data/doc-api/classes/Erubis/Generator.html +70 -70
- data/doc-api/classes/Erubis/HeaderFooterEnhancer.html +18 -15
- data/doc-api/classes/Erubis/Helpers/RailsFormHelper.html +787 -0
- data/doc-api/classes/Erubis/Helpers/RailsHelper/TemplateConverter.html +213 -0
- data/doc-api/classes/Erubis/Helpers/RailsHelper.html +103 -54
- data/doc-api/classes/Erubis/Helpers.html +6 -1
- data/doc-api/classes/Erubis/InterpolationEnhancer.html +42 -41
- data/doc-api/classes/Erubis/JavaGenerator.html +69 -69
- data/doc-api/classes/Erubis/JavascriptGenerator.html +79 -74
- data/doc-api/classes/Erubis/Main.html +49 -48
- data/doc-api/classes/Erubis/NoCodeEnhancer.html +35 -35
- data/doc-api/classes/Erubis/NoTextEnhancer.html +7 -7
- data/doc-api/classes/Erubis/OptimizedEruby.html +7 -7
- data/doc-api/classes/Erubis/OptimizedGenerator.html +84 -84
- data/doc-api/classes/Erubis/OptimizedXmlEruby.html +7 -7
- data/doc-api/classes/Erubis/PI/Converter.html +23 -22
- data/doc-api/classes/Erubis/PI/Ec.html +7 -7
- data/doc-api/classes/Erubis/PI/Ecpp.html +166 -0
- data/doc-api/classes/Erubis/PI/Ejava.html +7 -7
- data/doc-api/classes/Erubis/PI/Ejavascript.html +7 -7
- data/doc-api/classes/Erubis/PI/Eperl.html +7 -7
- data/doc-api/classes/Erubis/PI/Ephp.html +7 -7
- data/doc-api/classes/Erubis/PI/Eruby.html +6 -6
- data/doc-api/classes/Erubis/PI/Escheme.html +7 -7
- data/doc-api/classes/Erubis/PI/TinyEruby.html +28 -27
- data/doc-api/classes/Erubis/PI.html +1 -0
- data/doc-api/classes/Erubis/PercentLineEnhancer.html +18 -29
- data/doc-api/classes/Erubis/PerlGenerator.html +63 -63
- data/doc-api/classes/Erubis/PhpGenerator.html +63 -63
- data/doc-api/classes/Erubis/PrefixedLineEnhancer.html +210 -0
- data/doc-api/classes/Erubis/PrefixedLineEruby.html +120 -0
- data/doc-api/classes/Erubis/PreprocessingEruby.html +183 -0
- data/doc-api/classes/Erubis/PreprocessingHelper.html +212 -0
- data/doc-api/classes/Erubis/PrintEnabledEnhancer.html +23 -23
- data/doc-api/classes/Erubis/PrintOutEnhancer.html +38 -38
- data/doc-api/classes/Erubis/RubyEvaluator.html +59 -22
- data/doc-api/classes/Erubis/RubyGenerator.html +53 -52
- data/doc-api/classes/Erubis/SchemeGenerator.html +70 -70
- data/doc-api/classes/Erubis/SimplifyEnhancer.html +10 -9
- data/doc-api/classes/Erubis/StdoutEnhancer.html +3 -3
- data/doc-api/classes/Erubis/StringBufferEnhancer.html +16 -16
- data/doc-api/classes/Erubis/TinyEruby.html +33 -33
- data/doc-api/classes/Erubis/XmlHelper.html +80 -15
- data/doc-api/classes/Erubis.html +25 -1
- data/doc-api/classes/Kernel.html +155 -0
- data/doc-api/created.rid +1 -1
- data/doc-api/files/README_txt.html +8 -8
- data/doc-api/files/erubis/context_rb.html +2 -2
- data/doc-api/files/erubis/converter_rb.html +3 -3
- data/doc-api/files/erubis/engine/ec_rb.html +2 -2
- data/doc-api/files/erubis/engine/ecpp_rb.html +115 -0
- 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 -2
- 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 +3 -3
- data/doc-api/files/erubis/helper_rb.html +2 -2
- data/doc-api/files/erubis/helpers/rails_form_helper_rb.html +107 -0
- data/doc-api/files/erubis/helpers/rails_helper_rb.html +3 -2
- 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/preprocessing_rb.html +114 -0
- data/doc-api/files/erubis/tiny_rb.html +2 -2
- data/doc-api/files/erubis/util_rb.html +107 -0
- data/doc-api/files/erubis_rb.html +2 -2
- data/doc-api/fr_class_index.html +13 -0
- data/doc-api/fr_file_index.html +4 -0
- data/doc-api/fr_method_index.html +237 -179
- data/examples/basic/Makefile +7 -2
- data/examples/basic/example.ecpp +33 -0
- data/lib/erubis/context.rb +2 -3
- data/lib/erubis/converter.rb +17 -11
- data/lib/erubis/engine/ec.rb +2 -3
- data/lib/erubis/engine/ecpp.rb +113 -0
- data/lib/erubis/engine/ejava.rb +9 -10
- data/lib/erubis/engine/ejavascript.rb +14 -9
- data/lib/erubis/engine/enhanced.rb +7 -3
- data/lib/erubis/engine/eperl.rb +2 -3
- data/lib/erubis/engine/ephp.rb +2 -3
- data/lib/erubis/engine/eruby.rb +8 -8
- data/lib/erubis/engine/escheme.rb +2 -3
- data/lib/erubis/engine/optimized.rb +2 -3
- data/lib/erubis/engine.rb +13 -11
- data/lib/erubis/enhancer.rb +101 -34
- data/lib/erubis/error.rb +2 -3
- data/lib/erubis/evaluator.rb +27 -10
- data/lib/erubis/generator.rb +3 -4
- data/lib/erubis/helper.rb +14 -3
- data/lib/erubis/helpers/rails_form_helper.rb +197 -0
- data/lib/erubis/helpers/rails_helper.rb +219 -77
- data/lib/erubis/local-setting.rb +2 -3
- data/lib/erubis/main.rb +85 -60
- data/lib/erubis/preprocessing.rb +58 -0
- data/lib/erubis/tiny.rb +9 -9
- data/lib/erubis/util.rb +22 -0
- data/lib/erubis.rb +4 -4
- data/test/assert-text-equal.rb +2 -3
- data/test/data/users-guide/bufvar-example.rb +10 -0
- data/test/data/users-guide/bufvar-example.result +17 -0
- data/test/data/users-guide/def_method.rb +14 -0
- data/test/data/users-guide/def_method.result +3 -0
- data/test/data/users-guide/example.ecpp +30 -0
- data/test/data/users-guide/example1.rb +1 -0
- data/test/data/users-guide/example_c.result +22 -19
- data/test/data/users-guide/fasteruby-example.rb +8 -0
- data/test/data/users-guide/fasteruby-example.result +18 -0
- data/test/data/users-guide/main_program1.rb +8 -0
- data/test/data/users-guide/main_program1.result +6 -0
- data/test/data/users-guide/main_program2.rb +8 -0
- data/test/data/users-guide/main_program2.result +6 -0
- data/test/data/users-guide/percentline-example.rhtml +3 -1
- data/test/data/users-guide/percentline_example.result +5 -3
- data/test/data/users-guide/prefixedline-example.rb +9 -0
- data/test/data/users-guide/prefixedline-example.rhtml +6 -0
- data/test/data/users-guide/prefixedline_example.result +9 -0
- data/test/data/users-guide/tail_260.result +4 -0
- data/test/data/users-guide/tailnewline.rhtml +3 -0
- data/test/data/users-guide/template1.rhtml +4 -0
- data/test/data/users-guide/template2.rhtml +4 -0
- data/test/test-engines.rb +88 -5
- data/test/test-enhancers.rb +83 -6
- data/test/test-erubis.rb +115 -11
- data/test/test-index-cgi.rb +191 -0
- data/test/test-main.rb +143 -31
- data/test/test-users-guide.rb +20 -3
- data/test/test.rb +18 -3
- data/test/testutil.rb +44 -8
- metadata +104 -67
- data/contrib/action_view_base_rb.patch +0 -23
|
@@ -0,0 +1,209 @@
|
|
|
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: ActionView::TemplateHandlers::ErubisHandler</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">ActionView::TemplateHandlers::ErubisHandler</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
|
+
<tr class="top-aligned-row">
|
|
66
|
+
<td><strong>Parent:</strong></td>
|
|
67
|
+
<td>
|
|
68
|
+
TemplateHandler
|
|
69
|
+
</td>
|
|
70
|
+
</tr>
|
|
71
|
+
</table>
|
|
72
|
+
</div>
|
|
73
|
+
<!-- banner header -->
|
|
74
|
+
|
|
75
|
+
<div id="bodyContent">
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
<div id="contextContent">
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
</div>
|
|
84
|
+
|
|
85
|
+
<div id="method-list">
|
|
86
|
+
<h3 class="section-bar">Methods</h3>
|
|
87
|
+
|
|
88
|
+
<div class="name-list">
|
|
89
|
+
<a href="#M000001">compile</a>
|
|
90
|
+
<a href="#M000002">compile</a>
|
|
91
|
+
<a href="#M000003">compile</a>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
|
|
95
|
+
</div>
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
<!-- if includes -->
|
|
99
|
+
<div id="includes">
|
|
100
|
+
<h3 class="section-bar">Included Modules</h3>
|
|
101
|
+
|
|
102
|
+
<div id="includes-list">
|
|
103
|
+
<span class="include-name">Compilable</span>
|
|
104
|
+
<span class="include-name"><a href="../../Erubis/Helpers/RailsHelper/TemplateConverter.html">::Erubis::Helpers::RailsHelper::TemplateConverter</a></span>
|
|
105
|
+
<span class="include-name"><a href="../../Erubis/PreprocessingHelper.html">::Erubis::PreprocessingHelper</a></span>
|
|
106
|
+
<span class="include-name">Compilable</span>
|
|
107
|
+
<span class="include-name"><a href="../../Erubis/Helpers/RailsHelper/TemplateConverter.html">Erubis::Helpers::RailsHelper::TemplateConverter</a></span>
|
|
108
|
+
<span class="include-name"><a href="../../Erubis/PreprocessingHelper.html">Erubis::PreprocessingHelper</a></span>
|
|
109
|
+
<span class="include-name"><a href="../../Erubis/Helpers/RailsHelper/TemplateConverter.html">Erubis::Helpers::RailsHelper::TemplateConverter</a></span>
|
|
110
|
+
<span class="include-name"><a href="../../Erubis/PreprocessingHelper.html">Erubis::PreprocessingHelper</a></span>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
<div id="section">
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
<!-- if method_list -->
|
|
124
|
+
<div id="methods">
|
|
125
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
|
126
|
+
|
|
127
|
+
<div id="method-M000001" class="method-detail">
|
|
128
|
+
<a name="M000001"></a>
|
|
129
|
+
|
|
130
|
+
<div class="method-heading">
|
|
131
|
+
<a href="#M000001" class="method-signature">
|
|
132
|
+
<span class="method-name">compile</span><span class="method-args">(template)</span>
|
|
133
|
+
</a>
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
<div class="method-description">
|
|
137
|
+
<p><a class="source-toggle" href="#"
|
|
138
|
+
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
|
139
|
+
<div class="method-source-code" id="M000001-source">
|
|
140
|
+
<pre>
|
|
141
|
+
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 153</span>
|
|
142
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">compile</span>(<span class="ruby-identifier">template</span>)
|
|
143
|
+
<span class="ruby-comment cmt">#src = ::ERB.new("<% __in_erb_template=true %>#{template.source}", nil, erb_trim_mode, '@output_buffer').src</span>
|
|
144
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">_convert_template</span>(<span class="ruby-node">"<% __in_erb_template=true %>#{template.source}"</span>)
|
|
145
|
+
<span class="ruby-keyword kw">end</span>
|
|
146
|
+
</pre>
|
|
147
|
+
</div>
|
|
148
|
+
</div>
|
|
149
|
+
</div>
|
|
150
|
+
|
|
151
|
+
<div id="method-M000002" class="method-detail">
|
|
152
|
+
<a name="M000002"></a>
|
|
153
|
+
|
|
154
|
+
<div class="method-heading">
|
|
155
|
+
<a href="#M000002" class="method-signature">
|
|
156
|
+
<span class="method-name">compile</span><span class="method-args">(template)</span>
|
|
157
|
+
</a>
|
|
158
|
+
</div>
|
|
159
|
+
|
|
160
|
+
<div class="method-description">
|
|
161
|
+
<p><a class="source-toggle" href="#"
|
|
162
|
+
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
|
163
|
+
<div class="method-source-code" id="M000002-source">
|
|
164
|
+
<pre>
|
|
165
|
+
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 179</span>
|
|
166
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">compile</span>(<span class="ruby-identifier">template</span>)
|
|
167
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">_convert_template</span>(<span class="ruby-identifier">template</span>.<span class="ruby-identifier">source</span>) <span class="ruby-comment cmt"># template.is_a?(ActionView::Template)</span>
|
|
168
|
+
<span class="ruby-keyword kw">end</span>
|
|
169
|
+
</pre>
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
|
|
174
|
+
<div id="method-M000003" class="method-detail">
|
|
175
|
+
<a name="M000003"></a>
|
|
176
|
+
|
|
177
|
+
<div class="method-heading">
|
|
178
|
+
<a href="#M000003" class="method-signature">
|
|
179
|
+
<span class="method-name">compile</span><span class="method-args">(template)</span>
|
|
180
|
+
</a>
|
|
181
|
+
</div>
|
|
182
|
+
|
|
183
|
+
<div class="method-description">
|
|
184
|
+
<p><a class="source-toggle" href="#"
|
|
185
|
+
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
|
186
|
+
<div class="method-source-code" id="M000003-source">
|
|
187
|
+
<pre>
|
|
188
|
+
<span class="ruby-comment cmt"># File erubis/helpers/rails_helper.rb, line 209</span>
|
|
189
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">compile</span>(<span class="ruby-identifier">template</span>)
|
|
190
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-identifier">_convert_template</span>(<span class="ruby-identifier">template</span>) <span class="ruby-comment cmt"># template.is_a?(String)</span>
|
|
191
|
+
<span class="ruby-keyword kw">end</span>
|
|
192
|
+
</pre>
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
</div>
|
|
199
|
+
|
|
200
|
+
|
|
201
|
+
</div>
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
<div id="validator-badges">
|
|
205
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
206
|
+
</div>
|
|
207
|
+
|
|
208
|
+
</body>
|
|
209
|
+
</html>
|
|
@@ -0,0 +1,105 @@
|
|
|
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: ActionView</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">ActionView</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
|
+
|
|
76
|
+
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
<!-- if includes -->
|
|
84
|
+
|
|
85
|
+
<div id="section">
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
<!-- if method_list -->
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
<div id="validator-badges">
|
|
101
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
102
|
+
</div>
|
|
103
|
+
|
|
104
|
+
</body>
|
|
105
|
+
</html>
|
|
@@ -90,8 +90,8 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
90
90
|
<h3 class="section-bar">Methods</h3>
|
|
91
91
|
|
|
92
92
|
<div class="name-list">
|
|
93
|
-
<a href="#
|
|
94
|
-
<a href="#
|
|
93
|
+
<a href="#M000012">add_postamble</a>
|
|
94
|
+
<a href="#M000011">add_preamble</a>
|
|
95
95
|
</div>
|
|
96
96
|
</div>
|
|
97
97
|
|
|
@@ -113,21 +113,21 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
113
113
|
<div id="methods">
|
|
114
114
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
115
115
|
|
|
116
|
-
<div id="method-
|
|
117
|
-
<a name="
|
|
116
|
+
<div id="method-M000012" class="method-detail">
|
|
117
|
+
<a name="M000012"></a>
|
|
118
118
|
|
|
119
119
|
<div class="method-heading">
|
|
120
|
-
<a href="#
|
|
120
|
+
<a href="#M000012" class="method-signature">
|
|
121
121
|
<span class="method-name">add_postamble</span><span class="method-args">(src)</span>
|
|
122
122
|
</a>
|
|
123
123
|
</div>
|
|
124
124
|
|
|
125
125
|
<div class="method-description">
|
|
126
126
|
<p><a class="source-toggle" href="#"
|
|
127
|
-
onclick="toggleCode('
|
|
128
|
-
<div class="method-source-code" id="
|
|
127
|
+
onclick="toggleCode('M000012-source');return false;">[Source]</a></p>
|
|
128
|
+
<div class="method-source-code" id="M000012-source">
|
|
129
129
|
<pre>
|
|
130
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
130
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 191</span>
|
|
131
131
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
|
|
132
132
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"\n"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">src</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?\n</span>
|
|
133
133
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"_buf.join\n"</span>
|
|
@@ -137,21 +137,21 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
137
137
|
</div>
|
|
138
138
|
</div>
|
|
139
139
|
|
|
140
|
-
<div id="method-
|
|
141
|
-
<a name="
|
|
140
|
+
<div id="method-M000011" class="method-detail">
|
|
141
|
+
<a name="M000011"></a>
|
|
142
142
|
|
|
143
143
|
<div class="method-heading">
|
|
144
|
-
<a href="#
|
|
144
|
+
<a href="#M000011" class="method-signature">
|
|
145
145
|
<span class="method-name">add_preamble</span><span class="method-args">(src)</span>
|
|
146
146
|
</a>
|
|
147
147
|
</div>
|
|
148
148
|
|
|
149
149
|
<div class="method-description">
|
|
150
150
|
<p><a class="source-toggle" href="#"
|
|
151
|
-
onclick="toggleCode('
|
|
152
|
-
<div class="method-source-code" id="
|
|
151
|
+
onclick="toggleCode('M000011-source');return false;">[Source]</a></p>
|
|
152
|
+
<div class="method-source-code" id="M000011-source">
|
|
153
153
|
<pre>
|
|
154
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
154
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 187</span>
|
|
155
155
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
|
|
156
156
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"_buf = [];"</span>
|
|
157
157
|
<span class="ruby-keyword kw">end</span>
|
|
@@ -89,8 +89,8 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
89
89
|
<h3 class="section-bar">Methods</h3>
|
|
90
90
|
|
|
91
91
|
<div class="name-list">
|
|
92
|
-
<a href="#
|
|
93
|
-
<a href="#
|
|
92
|
+
<a href="#M000207">add_postamble</a>
|
|
93
|
+
<a href="#M000206">add_preamble</a>
|
|
94
94
|
</div>
|
|
95
95
|
</div>
|
|
96
96
|
|
|
@@ -112,47 +112,47 @@ this is only for <a href="Eruby.html">Eruby</a>.
|
|
|
112
112
|
<div id="methods">
|
|
113
113
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
114
114
|
|
|
115
|
-
<div id="method-
|
|
116
|
-
<a name="
|
|
115
|
+
<div id="method-M000207" class="method-detail">
|
|
116
|
+
<a name="M000207"></a>
|
|
117
117
|
|
|
118
118
|
<div class="method-heading">
|
|
119
|
-
<a href="#
|
|
119
|
+
<a href="#M000207" class="method-signature">
|
|
120
120
|
<span class="method-name">add_postamble</span><span class="method-args">(src)</span>
|
|
121
121
|
</a>
|
|
122
122
|
</div>
|
|
123
123
|
|
|
124
124
|
<div class="method-description">
|
|
125
125
|
<p><a class="source-toggle" href="#"
|
|
126
|
-
onclick="toggleCode('
|
|
127
|
-
<div class="method-source-code" id="
|
|
126
|
+
onclick="toggleCode('M000207-source');return false;">[Source]</a></p>
|
|
127
|
+
<div class="method-source-code" id="M000207-source">
|
|
128
128
|
<pre>
|
|
129
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
129
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 168</span>
|
|
130
130
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
|
|
131
131
|
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"\n"</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">src</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?\n</span>
|
|
132
|
-
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-
|
|
132
|
+
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{@bufvar}\n"</span>
|
|
133
133
|
<span class="ruby-keyword kw">end</span>
|
|
134
134
|
</pre>
|
|
135
135
|
</div>
|
|
136
136
|
</div>
|
|
137
137
|
</div>
|
|
138
138
|
|
|
139
|
-
<div id="method-
|
|
140
|
-
<a name="
|
|
139
|
+
<div id="method-M000206" class="method-detail">
|
|
140
|
+
<a name="M000206"></a>
|
|
141
141
|
|
|
142
142
|
<div class="method-heading">
|
|
143
|
-
<a href="#
|
|
143
|
+
<a href="#M000206" class="method-signature">
|
|
144
144
|
<span class="method-name">add_preamble</span><span class="method-args">(src)</span>
|
|
145
145
|
</a>
|
|
146
146
|
</div>
|
|
147
147
|
|
|
148
148
|
<div class="method-description">
|
|
149
149
|
<p><a class="source-toggle" href="#"
|
|
150
|
-
onclick="toggleCode('
|
|
151
|
-
<div class="method-source-code" id="
|
|
150
|
+
onclick="toggleCode('M000206-source');return false;">[Source]</a></p>
|
|
151
|
+
<div class="method-source-code" id="M000206-source">
|
|
152
152
|
<pre>
|
|
153
|
-
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line
|
|
153
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 164</span>
|
|
154
154
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
|
|
155
|
-
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-
|
|
155
|
+
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-node">"#{@bufvar} = [];"</span>
|
|
156
156
|
<span class="ruby-keyword kw">end</span>
|
|
157
157
|
</pre>
|
|
158
158
|
</div>
|
|
@@ -86,10 +86,10 @@ basic converter which supports ’<% … %>’ notation.
|
|
|
86
86
|
<h3 class="section-bar">Methods</h3>
|
|
87
87
|
|
|
88
88
|
<div class="name-list">
|
|
89
|
-
<a href="#
|
|
90
|
-
<a href="#
|
|
91
|
-
<a href="#
|
|
92
|
-
<a href="#
|
|
89
|
+
<a href="#M000144">add_expr</a>
|
|
90
|
+
<a href="#M000143">convert_input</a>
|
|
91
|
+
<a href="#M000141">init_converter</a>
|
|
92
|
+
<a href="#M000142">pattern_regexp</a>
|
|
93
93
|
</div>
|
|
94
94
|
</div>
|
|
95
95
|
|
|
@@ -156,11 +156,11 @@ DEFAULT_REGEXP = /<%(=+|\#)?(.*?)-?%>([ \t]*\r?\n)?/m
|
|
|
156
156
|
<div id="methods">
|
|
157
157
|
<h3 class="section-bar">Public Instance methods</h3>
|
|
158
158
|
|
|
159
|
-
<div id="method-
|
|
160
|
-
<a name="
|
|
159
|
+
<div id="method-M000144" class="method-detail">
|
|
160
|
+
<a name="M000144"></a>
|
|
161
161
|
|
|
162
162
|
<div class="method-heading">
|
|
163
|
-
<a href="#
|
|
163
|
+
<a href="#M000144" class="method-signature">
|
|
164
164
|
<span class="method-name">add_expr</span><span class="method-args">(src, code, indicator)</span>
|
|
165
165
|
</a>
|
|
166
166
|
</div>
|
|
@@ -170,10 +170,10 @@ DEFAULT_REGEXP = /<%(=+|\#)?(.*?)-?%>([ \t]*\r?\n)?/m
|
|
|
170
170
|
add expression code to src
|
|
171
171
|
</p>
|
|
172
172
|
<p><a class="source-toggle" href="#"
|
|
173
|
-
onclick="toggleCode('
|
|
174
|
-
<div class="method-source-code" id="
|
|
173
|
+
onclick="toggleCode('M000144-source');return false;">[Source]</a></p>
|
|
174
|
+
<div class="method-source-code" id="M000144-source">
|
|
175
175
|
<pre>
|
|
176
|
-
<span class="ruby-comment cmt"># File erubis/converter.rb, line
|
|
176
|
+
<span class="ruby-comment cmt"># File erubis/converter.rb, line 176</span>
|
|
177
177
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_expr</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>, <span class="ruby-identifier">indicator</span>)
|
|
178
178
|
<span class="ruby-keyword kw">case</span> <span class="ruby-identifier">indicator</span>
|
|
179
179
|
<span class="ruby-keyword kw">when</span> <span class="ruby-value str">'='</span>
|
|
@@ -189,19 +189,19 @@ add expression code to src
|
|
|
189
189
|
</div>
|
|
190
190
|
</div>
|
|
191
191
|
|
|
192
|
-
<div id="method-
|
|
193
|
-
<a name="
|
|
192
|
+
<div id="method-M000143" class="method-detail">
|
|
193
|
+
<a name="M000143"></a>
|
|
194
194
|
|
|
195
195
|
<div class="method-heading">
|
|
196
|
-
<a href="#
|
|
196
|
+
<a href="#M000143" class="method-signature">
|
|
197
197
|
<span class="method-name">convert_input</span><span class="method-args">(src, input)</span>
|
|
198
198
|
</a>
|
|
199
199
|
</div>
|
|
200
200
|
|
|
201
201
|
<div class="method-description">
|
|
202
202
|
<p><a class="source-toggle" href="#"
|
|
203
|
-
onclick="toggleCode('
|
|
204
|
-
<div class="method-source-code" id="
|
|
203
|
+
onclick="toggleCode('M000143-source');return false;">[Source]</a></p>
|
|
204
|
+
<div class="method-source-code" id="M000143-source">
|
|
205
205
|
<pre>
|
|
206
206
|
<span class="ruby-comment cmt"># File erubis/converter.rb, line 127</span>
|
|
207
207
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">convert_input</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">input</span>)
|
|
@@ -209,7 +209,7 @@ add expression code to src
|
|
|
209
209
|
<span class="ruby-identifier">regexp</span> = <span class="ruby-identifier">pat</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">pat</span> <span class="ruby-operator">==</span> <span class="ruby-value str">'<% %>'</span> <span class="ruby-operator">?</span> <span class="ruby-constant">DEFAULT_REGEXP</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">pattern_regexp</span>(<span class="ruby-identifier">pat</span>)
|
|
210
210
|
<span class="ruby-identifier">pos</span> = <span class="ruby-value">0</span>
|
|
211
211
|
<span class="ruby-identifier">is_bol</span> = <span class="ruby-keyword kw">true</span> <span class="ruby-comment cmt"># is beginning of line</span>
|
|
212
|
-
<span class="ruby-identifier">input</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-identifier">regexp</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">indicator</span>, <span class="ruby-identifier">code</span>, <span class="ruby-identifier">rspace</span><span class="ruby-operator">|</span>
|
|
212
|
+
<span class="ruby-identifier">input</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-identifier">regexp</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">indicator</span>, <span class="ruby-identifier">code</span>, <span class="ruby-identifier">tailch</span>, <span class="ruby-identifier">rspace</span><span class="ruby-operator">|</span>
|
|
213
213
|
<span class="ruby-identifier">match</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">last_match</span>()
|
|
214
214
|
<span class="ruby-identifier">len</span> = <span class="ruby-identifier">match</span>.<span class="ruby-identifier">begin</span>(<span class="ruby-value">0</span>) <span class="ruby-operator">-</span> <span class="ruby-identifier">pos</span>
|
|
215
215
|
<span class="ruby-identifier">text</span> = <span class="ruby-identifier">input</span>[<span class="ruby-identifier">pos</span>, <span class="ruby-identifier">len</span>]
|
|
@@ -221,6 +221,7 @@ add expression code to src
|
|
|
221
221
|
<span class="ruby-comment cmt">## * when '<%= %>', do nothing</span>
|
|
222
222
|
<span class="ruby-comment cmt">## * when '<% %>' or '<%# %>', delete spaces iff only spaces are around '<% %>'</span>
|
|
223
223
|
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">ch</span> <span class="ruby-operator">==</span> <span class="ruby-value">?=</span> <span class="ruby-comment cmt"># <%= %></span>
|
|
224
|
+
<span class="ruby-identifier">rspace</span> = <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">tailch</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">tailch</span>.<span class="ruby-identifier">empty?</span>
|
|
224
225
|
<span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">lspace</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">lspace</span>
|
|
225
226
|
<span class="ruby-identifier">add_expr</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">code</span>, <span class="ruby-identifier">indicator</span>)
|
|
226
227
|
<span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">rspace</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rspace</span>
|
|
@@ -233,6 +234,9 @@ add expression code to src
|
|
|
233
234
|
<span class="ruby-identifier">add_stmt</span>(<span class="ruby-identifier">src</span>, <span class="ruby-value str">"\n"</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">n</span>)
|
|
234
235
|
<span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">rspace</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">rspace</span>
|
|
235
236
|
<span class="ruby-keyword kw">end</span>
|
|
237
|
+
<span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">ch</span> <span class="ruby-operator">==</span> <span class="ruby-value">?%</span> <span class="ruby-comment cmt"># <%% %></span>
|
|
238
|
+
<span class="ruby-identifier">s</span> = <span class="ruby-node">"#{lspace}#{@prefix||='<%'}#{code}#{tailch}#{@postfix||='%>'}#{rspace}"</span>
|
|
239
|
+
<span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">s</span>)
|
|
236
240
|
<span class="ruby-keyword kw">else</span> <span class="ruby-comment cmt"># <% %></span>
|
|
237
241
|
<span class="ruby-keyword kw">if</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>
|
|
238
242
|
<span class="ruby-identifier">add_stmt</span>(<span class="ruby-identifier">src</span>, <span class="ruby-node">"#{lspace}#{code}#{rspace}"</span>)
|
|
@@ -243,7 +247,8 @@ add expression code to src
|
|
|
243
247
|
<span class="ruby-keyword kw">end</span>
|
|
244
248
|
<span class="ruby-keyword kw">end</span>
|
|
245
249
|
<span class="ruby-keyword kw">end</span>
|
|
246
|
-
<span class="ruby-
|
|
250
|
+
<span class="ruby-comment cmt">#rest = $' || input # ruby1.8</span>
|
|
251
|
+
<span class="ruby-identifier">rest</span> = <span class="ruby-identifier">pos</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">input</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">input</span>[<span class="ruby-identifier">pos</span><span class="ruby-operator">..</span><span class="ruby-value">-1</span>] <span class="ruby-comment cmt"># ruby1.9</span>
|
|
247
252
|
<span class="ruby-identifier">add_text</span>(<span class="ruby-identifier">src</span>, <span class="ruby-identifier">rest</span>)
|
|
248
253
|
<span class="ruby-keyword kw">end</span>
|
|
249
254
|
</pre>
|
|
@@ -251,19 +256,19 @@ add expression code to src
|
|
|
251
256
|
</div>
|
|
252
257
|
</div>
|
|
253
258
|
|
|
254
|
-
<div id="method-
|
|
255
|
-
<a name="
|
|
259
|
+
<div id="method-M000141" class="method-detail">
|
|
260
|
+
<a name="M000141"></a>
|
|
256
261
|
|
|
257
262
|
<div class="method-heading">
|
|
258
|
-
<a href="#
|
|
263
|
+
<a href="#M000141" class="method-signature">
|
|
259
264
|
<span class="method-name">init_converter</span><span class="method-args">(properties={})</span>
|
|
260
265
|
</a>
|
|
261
266
|
</div>
|
|
262
267
|
|
|
263
268
|
<div class="method-description">
|
|
264
269
|
<p><a class="source-toggle" href="#"
|
|
265
|
-
onclick="toggleCode('
|
|
266
|
-
<div class="method-source-code" id="
|
|
270
|
+
onclick="toggleCode('M000141-source');return false;">[Source]</a></p>
|
|
271
|
+
<div class="method-source-code" id="M000141-source">
|
|
267
272
|
<pre>
|
|
268
273
|
<span class="ruby-comment cmt"># File erubis/converter.rb, line 103</span>
|
|
269
274
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">init_converter</span>(<span class="ruby-identifier">properties</span>={})
|
|
@@ -278,11 +283,11 @@ add expression code to src
|
|
|
278
283
|
|
|
279
284
|
<h3 class="section-bar">Protected Instance methods</h3>
|
|
280
285
|
|
|
281
|
-
<div id="method-
|
|
282
|
-
<a name="
|
|
286
|
+
<div id="method-M000142" class="method-detail">
|
|
287
|
+
<a name="M000142"></a>
|
|
283
288
|
|
|
284
289
|
<div class="method-heading">
|
|
285
|
-
<a href="#
|
|
290
|
+
<a href="#M000142" class="method-signature">
|
|
286
291
|
<span class="method-name">pattern_regexp</span><span class="method-args">(pattern)</span>
|
|
287
292
|
</a>
|
|
288
293
|
</div>
|
|
@@ -292,15 +297,15 @@ add expression code to src
|
|
|
292
297
|
return regexp of pattern to parse eRuby script
|
|
293
298
|
</p>
|
|
294
299
|
<p><a class="source-toggle" href="#"
|
|
295
|
-
onclick="toggleCode('
|
|
296
|
-
<div class="method-source-code" id="
|
|
300
|
+
onclick="toggleCode('M000142-source');return false;">[Source]</a></p>
|
|
301
|
+
<div class="method-source-code" id="M000142-source">
|
|
297
302
|
<pre>
|
|
298
303
|
<span class="ruby-comment cmt"># File erubis/converter.rb, line 112</span>
|
|
299
304
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pattern_regexp</span>(<span class="ruby-identifier">pattern</span>)
|
|
300
|
-
<span class="ruby-
|
|
301
|
-
<span class="ruby-comment cmt">#return /(.*?)(^[ \t]*)?#{prefix}(=+|\#)?(.*?)-?#{postfix}([ \t]*\r?\n)?/m</span>
|
|
302
|
-
<span class="ruby-comment cmt">#return /(^[ \t]*)?#{prefix}(=+|\#)?(.*?)-?#{postfix}([ \t]*\r?\n)?/m</span>
|
|
303
|
-
<span class="ruby-keyword kw">return</span> <span class="ruby-node">/#{prefix}(
|
|
305
|
+
<span class="ruby-ivar">@prefix</span>, <span class="ruby-ivar">@postfix</span> = <span class="ruby-identifier">pattern</span>.<span class="ruby-identifier">split</span>() <span class="ruby-comment cmt"># '<% %>' => '<%', '%>'</span>
|
|
306
|
+
<span class="ruby-comment cmt">#return /(.*?)(^[ \t]*)?#{@prefix}(=+|\#)?(.*?)-?#{@postfix}([ \t]*\r?\n)?/m</span>
|
|
307
|
+
<span class="ruby-comment cmt">#return /(^[ \t]*)?#{@prefix}(=+|\#)?(.*?)-?#{@postfix}([ \t]*\r?\n)?/m</span>
|
|
308
|
+
<span class="ruby-keyword kw">return</span> <span class="ruby-node">/#{@prefix}(=+|-|\#|%)?(.*?)([-=])?#{@postfix}([ \t]*\r?\n)?/</span><span class="ruby-identifier">m</span>
|
|
304
309
|
<span class="ruby-keyword kw">end</span>
|
|
305
310
|
</pre>
|
|
306
311
|
</div>
|