erubis 1.1.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. data/ChangeLog +45 -18
  2. data/README.txt +80 -0
  3. data/benchmark/erubybench-lib.rb +189 -0
  4. data/benchmark/erubybench.rb +364 -0
  5. data/benchmark/erubybench.rhtml +61 -0
  6. data/benchmark/erubybench.yaml +61 -0
  7. data/bin/erubis +4 -180
  8. data/contrib/erubis +2297 -0
  9. data/contrib/inline-require +151 -0
  10. data/doc-api/classes/Erubis.html +236 -0
  11. data/doc-api/classes/Erubis/ArrayBufferEnhancer.html +175 -0
  12. data/doc-api/classes/Erubis/ArrayBufferEruby.html +120 -0
  13. data/doc-api/classes/Erubis/ArrayEnhancer.html +174 -0
  14. data/doc-api/classes/Erubis/ArrayEruby.html +120 -0
  15. data/doc-api/classes/Erubis/BiPatternEnhancer.html +212 -0
  16. data/doc-api/classes/Erubis/BiPatternEruby.html +120 -0
  17. data/doc-api/classes/Erubis/CommandOptionError.html +113 -0
  18. data/doc-api/classes/Erubis/Context.html +249 -0
  19. data/doc-api/classes/Erubis/Ec.html +399 -0
  20. data/doc-api/classes/Erubis/Ejava.html +366 -0
  21. data/doc-api/classes/Erubis/Ejavascript.html +390 -0
  22. data/doc-api/classes/Erubis/Engine.html +711 -0
  23. data/doc-api/classes/Erubis/Eperl.html +350 -0
  24. data/doc-api/classes/Erubis/Ephp.html +308 -0
  25. data/doc-api/classes/Erubis/ErubisError.html +117 -0
  26. data/doc-api/classes/Erubis/Eruby.html +310 -0
  27. data/doc-api/classes/Erubis/EscapeEnhancer.html +167 -0
  28. data/doc-api/classes/Erubis/EscapedEc.html +120 -0
  29. data/doc-api/classes/Erubis/EscapedEjava.html +120 -0
  30. data/doc-api/classes/Erubis/EscapedEjavascript.html +120 -0
  31. data/doc-api/classes/Erubis/EscapedEperl.html +120 -0
  32. data/doc-api/classes/Erubis/EscapedEphp.html +120 -0
  33. data/doc-api/classes/Erubis/EscapedEruby.html +127 -0
  34. data/doc-api/classes/Erubis/EscapedEscheme.html +120 -0
  35. data/doc-api/classes/Erubis/Escheme.html +389 -0
  36. data/doc-api/classes/Erubis/HeaderFooterEnhancer.html +264 -0
  37. data/doc-api/classes/Erubis/HeaderFooterEruby.html +120 -0
  38. data/doc-api/classes/Erubis/Main.html +318 -0
  39. data/doc-api/classes/Erubis/NoTextEnhancer.html +159 -0
  40. data/doc-api/classes/Erubis/NoTextEruby.html +120 -0
  41. data/doc-api/classes/Erubis/OptimizedEruby.html +445 -0
  42. data/doc-api/classes/Erubis/OptimizedXmlEruby.html +163 -0
  43. data/doc-api/classes/Erubis/PercentLineEnhancer.html +174 -0
  44. data/doc-api/classes/Erubis/PercentLineEruby.html +120 -0
  45. data/doc-api/classes/Erubis/PrintEnabledEnhancer.html +212 -0
  46. data/doc-api/classes/Erubis/PrintEnabledEruby.html +120 -0
  47. data/doc-api/classes/Erubis/PrintOutEnhancer.html +244 -0
  48. data/doc-api/classes/Erubis/PrintOutEruby.html +120 -0
  49. data/doc-api/classes/Erubis/PrintOutSimplifiedEruby.html +121 -0
  50. data/doc-api/classes/Erubis/SimplifiedEruby.html +120 -0
  51. data/doc-api/classes/Erubis/SimplifyEnhancer.html +185 -0
  52. data/doc-api/classes/Erubis/StdoutEnhancer.html +173 -0
  53. data/doc-api/classes/Erubis/StdoutEruby.html +120 -0
  54. data/doc-api/classes/Erubis/StdoutSimplifiedEruby.html +121 -0
  55. data/doc-api/classes/Erubis/StringBufferEnhancer.html +174 -0
  56. data/doc-api/classes/Erubis/StringBufferEruby.html +120 -0
  57. data/doc-api/classes/Erubis/StringIOEruby.html +120 -0
  58. data/doc-api/classes/Erubis/TinyEruby.html +305 -0
  59. data/doc-api/classes/Erubis/XmlEruby.html +130 -0
  60. data/doc-api/classes/Erubis/XmlHelper.html +193 -0
  61. data/doc-api/created.rid +1 -0
  62. data/doc-api/files/__/README_txt.html +214 -0
  63. data/doc-api/files/erubis/engine/ec_rb.html +115 -0
  64. data/doc-api/files/erubis/engine/ejava_rb.html +115 -0
  65. data/doc-api/files/erubis/engine/ejavascript_rb.html +115 -0
  66. data/doc-api/files/erubis/engine/enhanced_rb.html +115 -0
  67. data/doc-api/files/erubis/engine/eperl_rb.html +115 -0
  68. data/doc-api/files/erubis/engine/ephp_rb.html +115 -0
  69. data/doc-api/files/erubis/engine/eruby_rb.html +115 -0
  70. data/doc-api/files/erubis/engine/escheme_rb.html +115 -0
  71. data/doc-api/files/erubis/engine/optimized_rb.html +114 -0
  72. data/doc-api/files/erubis/engine_rb.html +114 -0
  73. data/doc-api/files/erubis/enhancer_rb.html +114 -0
  74. data/doc-api/files/erubis/helper_rb.html +107 -0
  75. data/doc-api/files/erubis/local-setting_rb.html +107 -0
  76. data/doc-api/files/erubis/main_rb.html +125 -0
  77. data/doc-api/files/erubis/tiny_rb.html +107 -0
  78. data/doc-api/files/erubis_rb.html +118 -0
  79. data/doc-api/fr_class_index.html +77 -0
  80. data/doc-api/fr_file_index.html +43 -0
  81. data/doc-api/fr_method_index.html +157 -0
  82. data/doc-api/index.html +24 -0
  83. data/doc-api/rdoc-style.css +208 -0
  84. data/doc/users-guide.html +1507 -375
  85. data/examples/Makefile +53 -0
  86. data/examples/example.ec +24 -0
  87. data/examples/example.ejava +41 -0
  88. data/examples/example.ejavascript +16 -0
  89. data/examples/example.eperl +16 -0
  90. data/examples/example.ephp +17 -0
  91. data/examples/example.eruby +15 -0
  92. data/examples/example.escheme +26 -0
  93. data/lib/erubis.rb +37 -269
  94. data/lib/erubis/engine.rb +260 -0
  95. data/lib/erubis/engine/ec.rb +106 -0
  96. data/lib/erubis/engine/ejava.rb +101 -0
  97. data/lib/erubis/engine/ejavascript.rb +104 -0
  98. data/lib/erubis/engine/enhanced.rb +102 -0
  99. data/lib/erubis/engine/eperl.rb +83 -0
  100. data/lib/erubis/engine/ephp.rb +84 -0
  101. data/lib/erubis/engine/eruby.rb +91 -0
  102. data/lib/erubis/engine/escheme.rb +96 -0
  103. data/lib/erubis/engine/optimized.rb +114 -0
  104. data/lib/erubis/enhancer.rb +487 -0
  105. data/lib/erubis/helper.rb +53 -0
  106. data/lib/erubis/local-setting.rb +10 -0
  107. data/lib/erubis/main.rb +368 -0
  108. data/lib/erubis/tiny.rb +65 -0
  109. data/test/assert-text-equal.rb +45 -0
  110. data/test/test-bin.rb +222 -45
  111. data/test/test-engines.rb +343 -0
  112. data/test/test-erubis.rb +836 -501
  113. data/test/test.rb +27 -0
  114. data/test/testutil.rb +86 -0
  115. metadata +131 -8
  116. data/README +0 -50
@@ -0,0 +1,159 @@
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::NoTextEnhancer</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::NoTextEnhancer</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/erubis/enhancer_rb.html">
59
+ erubis/enhancer.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
+ remove text and leave code, especially useful when debugging.
78
+ </p>
79
+ <p>
80
+ ex.
81
+ </p>
82
+ <pre>
83
+ $ erubis -s -e NoText file.eruby | more
84
+ </pre>
85
+ <p>
86
+ this is language independent.
87
+ </p>
88
+
89
+ </div>
90
+
91
+
92
+ </div>
93
+
94
+ <div id="method-list">
95
+ <h3 class="section-bar">Methods</h3>
96
+
97
+ <div class="name-list">
98
+ <a href="#M000023">add_text</a>&nbsp;&nbsp;
99
+ </div>
100
+ </div>
101
+
102
+ </div>
103
+
104
+
105
+ <!-- if includes -->
106
+
107
+ <div id="section">
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+ <!-- if method_list -->
117
+ <div id="methods">
118
+ <h3 class="section-bar">Public Instance methods</h3>
119
+
120
+ <div id="method-M000023" class="method-detail">
121
+ <a name="M000023"></a>
122
+
123
+ <div class="method-heading">
124
+ <a href="#M000023" class="method-signature">
125
+ <span class="method-name">add_text</span><span class="method-args">(src, text)</span>
126
+ </a>
127
+ </div>
128
+
129
+ <div class="method-description">
130
+ <p><a class="source-toggle" href="#"
131
+ onclick="toggleCode('M000023-source');return false;">[Source]</a></p>
132
+ <div class="method-source-code" id="M000023-source">
133
+ <pre>
134
+ <span class="ruby-comment cmt"># File erubis/enhancer.rb, line 265</span>
135
+ <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>)
136
+ <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-value str">&quot;\n&quot;</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">count</span>(<span class="ruby-value str">&quot;\n&quot;</span>))
137
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">text</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">!=</span> <span class="ruby-value">?\n</span>
138
+ <span class="ruby-identifier">text</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/^(.*?)\z/</span>
139
+ <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> (<span class="ruby-value str">' '</span> <span class="ruby-operator">*</span> <span class="ruby-identifier">$1</span>.<span class="ruby-identifier">length</span>)
140
+ <span class="ruby-keyword kw">end</span>
141
+ <span class="ruby-keyword kw">end</span>
142
+ </pre>
143
+ </div>
144
+ </div>
145
+ </div>
146
+
147
+
148
+ </div>
149
+
150
+
151
+ </div>
152
+
153
+
154
+ <div id="validator-badges">
155
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
156
+ </div>
157
+
158
+ </body>
159
+ </html>
@@ -0,0 +1,120 @@
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: Erubis::NoTextEruby</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">Erubis::NoTextEruby</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/erubis/engine/enhanced_rb.html">
59
+ erubis/engine/enhanced.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ <a href="Eruby.html">
69
+ Eruby
70
+ </a>
71
+ </td>
72
+ </tr>
73
+ </table>
74
+ </div>
75
+ <!-- banner header -->
76
+
77
+ <div id="bodyContent">
78
+
79
+
80
+
81
+ <div id="contextContent">
82
+
83
+
84
+
85
+ </div>
86
+
87
+
88
+ </div>
89
+
90
+
91
+ <!-- if includes -->
92
+ <div id="includes">
93
+ <h3 class="section-bar">Included Modules</h3>
94
+
95
+ <div id="includes-list">
96
+ <span class="include-name"><a href="NoTextEnhancer.html">NoTextEnhancer</a></span>
97
+ </div>
98
+ </div>
99
+
100
+ <div id="section">
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+
109
+ <!-- if method_list -->
110
+
111
+
112
+ </div>
113
+
114
+
115
+ <div id="validator-badges">
116
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
117
+ </div>
118
+
119
+ </body>
120
+ </html>
@@ -0,0 +1,445 @@
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: Erubis::OptimizedEruby</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">Erubis::OptimizedEruby</td>
54
+ </tr>
55
+ <tr class="top-aligned-row">
56
+ <td><strong>In:</strong></td>
57
+ <td>
58
+ <a href="../../files/erubis/engine/optimized_rb.html">
59
+ erubis/engine/optimized.rb
60
+ </a>
61
+ <br />
62
+ </td>
63
+ </tr>
64
+
65
+ <tr class="top-aligned-row">
66
+ <td><strong>Parent:</strong></td>
67
+ <td>
68
+ <a href="Engine.html">
69
+ Engine
70
+ </a>
71
+ </td>
72
+ </tr>
73
+ </table>
74
+ </div>
75
+ <!-- banner header -->
76
+
77
+ <div id="bodyContent">
78
+
79
+
80
+
81
+ <div id="contextContent">
82
+
83
+ <div id="description">
84
+ <p>
85
+ <a href="Eruby.html">Eruby</a> class which generates optimized ruby code
86
+ </p>
87
+
88
+ </div>
89
+
90
+
91
+ </div>
92
+
93
+ <div id="method-list">
94
+ <h3 class="section-bar">Methods</h3>
95
+
96
+ <div class="name-list">
97
+ <a href="#M000086">add_expr_debug</a>&nbsp;&nbsp;
98
+ <a href="#M000085">add_expr_escaped</a>&nbsp;&nbsp;
99
+ <a href="#M000084">add_expr_literal</a>&nbsp;&nbsp;
100
+ <a href="#M000087">add_postamble</a>&nbsp;&nbsp;
101
+ <a href="#M000081">add_preamble</a>&nbsp;&nbsp;
102
+ <a href="#M000083">add_stmt</a>&nbsp;&nbsp;
103
+ <a href="#M000082">add_text</a>&nbsp;&nbsp;
104
+ <a href="#M000077">escape_text</a>&nbsp;&nbsp;
105
+ <a href="#M000078">escaped_expr</a>&nbsp;&nbsp;
106
+ <a href="#M000076">new</a>&nbsp;&nbsp;
107
+ <a href="#M000079">switch_to_expr</a>&nbsp;&nbsp;
108
+ <a href="#M000080">switch_to_stmt</a>&nbsp;&nbsp;
109
+ </div>
110
+ </div>
111
+
112
+ </div>
113
+
114
+
115
+ <!-- if includes -->
116
+
117
+ <div id="section">
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+ <!-- if method_list -->
127
+ <div id="methods">
128
+ <h3 class="section-bar">Public Class methods</h3>
129
+
130
+ <div id="method-M000076" class="method-detail">
131
+ <a name="M000076"></a>
132
+
133
+ <div class="method-heading">
134
+ <a href="#M000076" class="method-signature">
135
+ <span class="method-name">new</span><span class="method-args">(input, properties={})</span>
136
+ </a>
137
+ </div>
138
+
139
+ <div class="method-description">
140
+ <p><a class="source-toggle" href="#"
141
+ onclick="toggleCode('M000076-source');return false;">[Source]</a></p>
142
+ <div class="method-source-code" id="M000076-source">
143
+ <pre>
144
+ <span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 23</span>
145
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">input</span>, <span class="ruby-identifier">properties</span>={})
146
+ <span class="ruby-ivar">@initialized</span> = <span class="ruby-keyword kw">false</span>
147
+ <span class="ruby-ivar">@prev_is_expr</span> = <span class="ruby-keyword kw">false</span>
148
+ <span class="ruby-keyword kw">super</span>
149
+ <span class="ruby-keyword kw">end</span>
150
+ </pre>
151
+ </div>
152
+ </div>
153
+ </div>
154
+
155
+ <h3 class="section-bar">Protected Instance methods</h3>
156
+
157
+ <div id="method-M000086" class="method-detail">
158
+ <a name="M000086"></a>
159
+
160
+ <div class="method-heading">
161
+ <a href="#M000086" class="method-signature">
162
+ <span class="method-name">add_expr_debug</span><span class="method-args">(src, code)</span>
163
+ </a>
164
+ </div>
165
+
166
+ <div class="method-description">
167
+ <p><a class="source-toggle" href="#"
168
+ onclick="toggleCode('M000086-source');return false;">[Source]</a></p>
169
+ <div class="method-source-code" id="M000086-source">
170
+ <pre>
171
+ <span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 87</span>
172
+ <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>)
173
+ <span class="ruby-identifier">code</span>.<span class="ruby-identifier">strip!</span>
174
+ <span class="ruby-identifier">s</span> = (<span class="ruby-identifier">code</span>.<span class="ruby-identifier">dump</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp re">/\A&quot;(.*)&quot;\z/</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">$1</span>
175
+ <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">' $stderr.puts(&quot;*** debug: '</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">s</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">'=#{('</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">code</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">').inspect}&quot;);'</span>
176
+ <span class="ruby-keyword kw">end</span>
177
+ </pre>
178
+ </div>
179
+ </div>
180
+ </div>
181
+
182
+ <div id="method-M000085" class="method-detail">
183
+ <a name="M000085"></a>
184
+
185
+ <div class="method-heading">
186
+ <a href="#M000085" class="method-signature">
187
+ <span class="method-name">add_expr_escaped</span><span class="method-args">(src, code)</span>
188
+ </a>
189
+ </div>
190
+
191
+ <div class="method-description">
192
+ <p><a class="source-toggle" href="#"
193
+ onclick="toggleCode('M000085-source');return false;">[Source]</a></p>
194
+ <div class="method-source-code" id="M000085-source">
195
+ <pre>
196
+ <span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 81</span>
197
+ <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>)
198
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@initialized</span>; <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;_buf = ''&quot;</span>; <span class="ruby-ivar">@initialized</span> = <span class="ruby-keyword kw">true</span>; <span class="ruby-keyword kw">end</span>
199
+ <span class="ruby-identifier">switch_to_expr</span>(<span class="ruby-identifier">src</span>)
200
+ <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot; &lt;&lt; &quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">escaped_expr</span>(<span class="ruby-identifier">code</span>)
201
+ <span class="ruby-keyword kw">end</span>
202
+ </pre>
203
+ </div>
204
+ </div>
205
+ </div>
206
+
207
+ <div id="method-M000084" class="method-detail">
208
+ <a name="M000084"></a>
209
+
210
+ <div class="method-heading">
211
+ <a href="#M000084" class="method-signature">
212
+ <span class="method-name">add_expr_literal</span><span class="method-args">(src, code)</span>
213
+ </a>
214
+ </div>
215
+
216
+ <div class="method-description">
217
+ <p><a class="source-toggle" href="#"
218
+ onclick="toggleCode('M000084-source');return false;">[Source]</a></p>
219
+ <div class="method-source-code" id="M000084-source">
220
+ <pre>
221
+ <span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 75</span>
222
+ <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>)
223
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@initialized</span>; <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;_buf = ''&quot;</span>; <span class="ruby-ivar">@initialized</span> = <span class="ruby-keyword kw">true</span>; <span class="ruby-keyword kw">end</span>
224
+ <span class="ruby-identifier">switch_to_expr</span>(<span class="ruby-identifier">src</span>)
225
+ <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot; &lt;&lt; (&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">code</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;).to_s&quot;</span>
226
+ <span class="ruby-keyword kw">end</span>
227
+ </pre>
228
+ </div>
229
+ </div>
230
+ </div>
231
+
232
+ <div id="method-M000087" class="method-detail">
233
+ <a name="M000087"></a>
234
+
235
+ <div class="method-heading">
236
+ <a href="#M000087" class="method-signature">
237
+ <span class="method-name">add_postamble</span><span class="method-args">(src)</span>
238
+ </a>
239
+ </div>
240
+
241
+ <div class="method-description">
242
+ <p><a class="source-toggle" href="#"
243
+ onclick="toggleCode('M000087-source');return false;">[Source]</a></p>
244
+ <div class="method-source-code" id="M000087-source">
245
+ <pre>
246
+ <span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 93</span>
247
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
248
+ <span class="ruby-comment cmt">#super if @initialized</span>
249
+ <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;\n_buf\n&quot;</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@initialized</span>
250
+ <span class="ruby-keyword kw">end</span>
251
+ </pre>
252
+ </div>
253
+ </div>
254
+ </div>
255
+
256
+ <div id="method-M000081" class="method-detail">
257
+ <a name="M000081"></a>
258
+
259
+ <div class="method-heading">
260
+ <a href="#M000081" class="method-signature">
261
+ <span class="method-name">add_preamble</span><span class="method-args">(src)</span>
262
+ </a>
263
+ </div>
264
+
265
+ <div class="method-description">
266
+ <p><a class="source-toggle" href="#"
267
+ onclick="toggleCode('M000081-source');return false;">[Source]</a></p>
268
+ <div class="method-source-code" id="M000081-source">
269
+ <pre>
270
+ <span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 52</span>
271
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
272
+ <span class="ruby-comment cmt">#@initialized = false</span>
273
+ <span class="ruby-comment cmt">#@prev_is_expr = false</span>
274
+ <span class="ruby-keyword kw">end</span>
275
+ </pre>
276
+ </div>
277
+ </div>
278
+ </div>
279
+
280
+ <div id="method-M000083" class="method-detail">
281
+ <a name="M000083"></a>
282
+
283
+ <div class="method-heading">
284
+ <a href="#M000083" class="method-signature">
285
+ <span class="method-name">add_stmt</span><span class="method-args">(src, code)</span>
286
+ </a>
287
+ </div>
288
+
289
+ <div class="method-description">
290
+ <p><a class="source-toggle" href="#"
291
+ onclick="toggleCode('M000083-source');return false;">[Source]</a></p>
292
+ <div class="method-source-code" id="M000083-source">
293
+ <pre>
294
+ <span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 68</span>
295
+ <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>)
296
+ <span class="ruby-identifier">switch_to_stmt</span>(<span class="ruby-identifier">src</span>) <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@initialized</span>
297
+ <span class="ruby-comment cmt">#super</span>
298
+ <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">code</span>
299
+ <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">';'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">code</span>[<span class="ruby-value">-1</span>] <span class="ruby-operator">==</span> <span class="ruby-value">?\n</span>
300
+ <span class="ruby-keyword kw">end</span>
301
+ </pre>
302
+ </div>
303
+ </div>
304
+ </div>
305
+
306
+ <div id="method-M000082" class="method-detail">
307
+ <a name="M000082"></a>
308
+
309
+ <div class="method-heading">
310
+ <a href="#M000082" class="method-signature">
311
+ <span class="method-name">add_text</span><span class="method-args">(src, text)</span>
312
+ </a>
313
+ </div>
314
+
315
+ <div class="method-description">
316
+ <p><a class="source-toggle" href="#"
317
+ onclick="toggleCode('M000082-source');return false;">[Source]</a></p>
318
+ <div class="method-source-code" id="M000082-source">
319
+ <pre>
320
+ <span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 57</span>
321
+ <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>)
322
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">text</span>.<span class="ruby-identifier">empty?</span>
323
+ <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@initialized</span>
324
+ <span class="ruby-identifier">switch_to_expr</span>(<span class="ruby-identifier">src</span>)
325
+ <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot; &lt;&lt; '&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;'&quot;</span>
326
+ <span class="ruby-keyword kw">else</span>
327
+ <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;_buf = '&quot;</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>) <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">&quot;';&quot;</span>
328
+ <span class="ruby-ivar">@initialized</span> = <span class="ruby-keyword kw">true</span>
329
+ <span class="ruby-keyword kw">end</span>
330
+ <span class="ruby-keyword kw">end</span>
331
+ </pre>
332
+ </div>
333
+ </div>
334
+ </div>
335
+
336
+ <div id="method-M000077" class="method-detail">
337
+ <a name="M000077"></a>
338
+
339
+ <div class="method-heading">
340
+ <a href="#M000077" class="method-signature">
341
+ <span class="method-name">escape_text</span><span class="method-args">(text)</span>
342
+ </a>
343
+ </div>
344
+
345
+ <div class="method-description">
346
+ <p><a class="source-toggle" href="#"
347
+ onclick="toggleCode('M000077-source');return false;">[Source]</a></p>
348
+ <div class="method-source-code" id="M000077-source">
349
+ <pre>
350
+ <span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 31</span>
351
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escape_text</span>(<span class="ruby-identifier">text</span>)
352
+ <span class="ruby-identifier">text</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp re">/['\\]/</span>, <span class="ruby-value str">'\\\\\&amp;'</span>) <span class="ruby-comment cmt"># &quot;'&quot; =&gt; &quot;\\'&quot;, '\\' =&gt; '\\\\'</span>
353
+ <span class="ruby-keyword kw">end</span>
354
+ </pre>
355
+ </div>
356
+ </div>
357
+ </div>
358
+
359
+ <div id="method-M000078" class="method-detail">
360
+ <a name="M000078"></a>
361
+
362
+ <div class="method-heading">
363
+ <a href="#M000078" class="method-signature">
364
+ <span class="method-name">escaped_expr</span><span class="method-args">(code)</span>
365
+ </a>
366
+ </div>
367
+
368
+ <div class="method-description">
369
+ <p><a class="source-toggle" href="#"
370
+ onclick="toggleCode('M000078-source');return false;">[Source]</a></p>
371
+ <div class="method-source-code" id="M000078-source">
372
+ <pre>
373
+ <span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 35</span>
374
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">escaped_expr</span>(<span class="ruby-identifier">code</span>)
375
+ <span class="ruby-ivar">@escape</span> <span class="ruby-operator">||=</span> <span class="ruby-value str">'Erubis::XmlHelper.escape_xml'</span>
376
+ <span class="ruby-keyword kw">return</span> <span class="ruby-node">&quot;#{@escape}(#{code})&quot;</span>
377
+ <span class="ruby-keyword kw">end</span>
378
+ </pre>
379
+ </div>
380
+ </div>
381
+ </div>
382
+
383
+ <div id="method-M000079" class="method-detail">
384
+ <a name="M000079"></a>
385
+
386
+ <div class="method-heading">
387
+ <a href="#M000079" class="method-signature">
388
+ <span class="method-name">switch_to_expr</span><span class="method-args">(src)</span>
389
+ </a>
390
+ </div>
391
+
392
+ <div class="method-description">
393
+ <p><a class="source-toggle" href="#"
394
+ onclick="toggleCode('M000079-source');return false;">[Source]</a></p>
395
+ <div class="method-source-code" id="M000079-source">
396
+ <pre>
397
+ <span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 40</span>
398
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">switch_to_expr</span>(<span class="ruby-identifier">src</span>)
399
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@prev_is_expr</span>
400
+ <span class="ruby-ivar">@prev_is_expr</span> = <span class="ruby-keyword kw">true</span>
401
+ <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">' _buf'</span>
402
+ <span class="ruby-keyword kw">end</span>
403
+ </pre>
404
+ </div>
405
+ </div>
406
+ </div>
407
+
408
+ <div id="method-M000080" class="method-detail">
409
+ <a name="M000080"></a>
410
+
411
+ <div class="method-heading">
412
+ <a href="#M000080" class="method-signature">
413
+ <span class="method-name">switch_to_stmt</span><span class="method-args">(src)</span>
414
+ </a>
415
+ </div>
416
+
417
+ <div class="method-description">
418
+ <p><a class="source-toggle" href="#"
419
+ onclick="toggleCode('M000080-source');return false;">[Source]</a></p>
420
+ <div class="method-source-code" id="M000080-source">
421
+ <pre>
422
+ <span class="ruby-comment cmt"># File erubis/engine/optimized.rb, line 46</span>
423
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">switch_to_stmt</span>(<span class="ruby-identifier">src</span>)
424
+ <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@prev_is_expr</span>
425
+ <span class="ruby-ivar">@prev_is_expr</span> = <span class="ruby-keyword kw">false</span>
426
+ <span class="ruby-identifier">src</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value str">';'</span>
427
+ <span class="ruby-keyword kw">end</span>
428
+ </pre>
429
+ </div>
430
+ </div>
431
+ </div>
432
+
433
+
434
+ </div>
435
+
436
+
437
+ </div>
438
+
439
+
440
+ <div id="validator-badges">
441
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
442
+ </div>
443
+
444
+ </body>
445
+ </html>