erubis 1.1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +45 -18
- data/README.txt +80 -0
- data/benchmark/erubybench-lib.rb +189 -0
- data/benchmark/erubybench.rb +364 -0
- data/benchmark/erubybench.rhtml +61 -0
- data/benchmark/erubybench.yaml +61 -0
- data/bin/erubis +4 -180
- data/contrib/erubis +2297 -0
- data/contrib/inline-require +151 -0
- data/doc-api/classes/Erubis.html +236 -0
- data/doc-api/classes/Erubis/ArrayBufferEnhancer.html +175 -0
- data/doc-api/classes/Erubis/ArrayBufferEruby.html +120 -0
- data/doc-api/classes/Erubis/ArrayEnhancer.html +174 -0
- data/doc-api/classes/Erubis/ArrayEruby.html +120 -0
- data/doc-api/classes/Erubis/BiPatternEnhancer.html +212 -0
- data/doc-api/classes/Erubis/BiPatternEruby.html +120 -0
- data/doc-api/classes/Erubis/CommandOptionError.html +113 -0
- data/doc-api/classes/Erubis/Context.html +249 -0
- data/doc-api/classes/Erubis/Ec.html +399 -0
- data/doc-api/classes/Erubis/Ejava.html +366 -0
- data/doc-api/classes/Erubis/Ejavascript.html +390 -0
- data/doc-api/classes/Erubis/Engine.html +711 -0
- data/doc-api/classes/Erubis/Eperl.html +350 -0
- data/doc-api/classes/Erubis/Ephp.html +308 -0
- data/doc-api/classes/Erubis/ErubisError.html +117 -0
- data/doc-api/classes/Erubis/Eruby.html +310 -0
- data/doc-api/classes/Erubis/EscapeEnhancer.html +167 -0
- data/doc-api/classes/Erubis/EscapedEc.html +120 -0
- data/doc-api/classes/Erubis/EscapedEjava.html +120 -0
- data/doc-api/classes/Erubis/EscapedEjavascript.html +120 -0
- data/doc-api/classes/Erubis/EscapedEperl.html +120 -0
- data/doc-api/classes/Erubis/EscapedEphp.html +120 -0
- data/doc-api/classes/Erubis/EscapedEruby.html +127 -0
- data/doc-api/classes/Erubis/EscapedEscheme.html +120 -0
- data/doc-api/classes/Erubis/Escheme.html +389 -0
- data/doc-api/classes/Erubis/HeaderFooterEnhancer.html +264 -0
- data/doc-api/classes/Erubis/HeaderFooterEruby.html +120 -0
- data/doc-api/classes/Erubis/Main.html +318 -0
- data/doc-api/classes/Erubis/NoTextEnhancer.html +159 -0
- data/doc-api/classes/Erubis/NoTextEruby.html +120 -0
- data/doc-api/classes/Erubis/OptimizedEruby.html +445 -0
- data/doc-api/classes/Erubis/OptimizedXmlEruby.html +163 -0
- data/doc-api/classes/Erubis/PercentLineEnhancer.html +174 -0
- data/doc-api/classes/Erubis/PercentLineEruby.html +120 -0
- data/doc-api/classes/Erubis/PrintEnabledEnhancer.html +212 -0
- data/doc-api/classes/Erubis/PrintEnabledEruby.html +120 -0
- data/doc-api/classes/Erubis/PrintOutEnhancer.html +244 -0
- data/doc-api/classes/Erubis/PrintOutEruby.html +120 -0
- data/doc-api/classes/Erubis/PrintOutSimplifiedEruby.html +121 -0
- data/doc-api/classes/Erubis/SimplifiedEruby.html +120 -0
- data/doc-api/classes/Erubis/SimplifyEnhancer.html +185 -0
- data/doc-api/classes/Erubis/StdoutEnhancer.html +173 -0
- data/doc-api/classes/Erubis/StdoutEruby.html +120 -0
- data/doc-api/classes/Erubis/StdoutSimplifiedEruby.html +121 -0
- data/doc-api/classes/Erubis/StringBufferEnhancer.html +174 -0
- data/doc-api/classes/Erubis/StringBufferEruby.html +120 -0
- data/doc-api/classes/Erubis/StringIOEruby.html +120 -0
- data/doc-api/classes/Erubis/TinyEruby.html +305 -0
- data/doc-api/classes/Erubis/XmlEruby.html +130 -0
- data/doc-api/classes/Erubis/XmlHelper.html +193 -0
- data/doc-api/created.rid +1 -0
- data/doc-api/files/__/README_txt.html +214 -0
- data/doc-api/files/erubis/engine/ec_rb.html +115 -0
- data/doc-api/files/erubis/engine/ejava_rb.html +115 -0
- data/doc-api/files/erubis/engine/ejavascript_rb.html +115 -0
- data/doc-api/files/erubis/engine/enhanced_rb.html +115 -0
- data/doc-api/files/erubis/engine/eperl_rb.html +115 -0
- data/doc-api/files/erubis/engine/ephp_rb.html +115 -0
- data/doc-api/files/erubis/engine/eruby_rb.html +115 -0
- data/doc-api/files/erubis/engine/escheme_rb.html +115 -0
- data/doc-api/files/erubis/engine/optimized_rb.html +114 -0
- data/doc-api/files/erubis/engine_rb.html +114 -0
- data/doc-api/files/erubis/enhancer_rb.html +114 -0
- data/doc-api/files/erubis/helper_rb.html +107 -0
- data/doc-api/files/erubis/local-setting_rb.html +107 -0
- data/doc-api/files/erubis/main_rb.html +125 -0
- data/doc-api/files/erubis/tiny_rb.html +107 -0
- data/doc-api/files/erubis_rb.html +118 -0
- data/doc-api/fr_class_index.html +77 -0
- data/doc-api/fr_file_index.html +43 -0
- data/doc-api/fr_method_index.html +157 -0
- data/doc-api/index.html +24 -0
- data/doc-api/rdoc-style.css +208 -0
- data/doc/users-guide.html +1507 -375
- data/examples/Makefile +53 -0
- data/examples/example.ec +24 -0
- data/examples/example.ejava +41 -0
- data/examples/example.ejavascript +16 -0
- data/examples/example.eperl +16 -0
- data/examples/example.ephp +17 -0
- data/examples/example.eruby +15 -0
- data/examples/example.escheme +26 -0
- data/lib/erubis.rb +37 -269
- data/lib/erubis/engine.rb +260 -0
- data/lib/erubis/engine/ec.rb +106 -0
- data/lib/erubis/engine/ejava.rb +101 -0
- data/lib/erubis/engine/ejavascript.rb +104 -0
- data/lib/erubis/engine/enhanced.rb +102 -0
- data/lib/erubis/engine/eperl.rb +83 -0
- data/lib/erubis/engine/ephp.rb +84 -0
- data/lib/erubis/engine/eruby.rb +91 -0
- data/lib/erubis/engine/escheme.rb +96 -0
- data/lib/erubis/engine/optimized.rb +114 -0
- data/lib/erubis/enhancer.rb +487 -0
- data/lib/erubis/helper.rb +53 -0
- data/lib/erubis/local-setting.rb +10 -0
- data/lib/erubis/main.rb +368 -0
- data/lib/erubis/tiny.rb +65 -0
- data/test/assert-text-equal.rb +45 -0
- data/test/test-bin.rb +222 -45
- data/test/test-engines.rb +343 -0
- data/test/test-erubis.rb +836 -501
- data/test/test.rb +27 -0
- data/test/testutil.rb +86 -0
- metadata +131 -8
- data/README +0 -50
@@ -0,0 +1,151 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
###
|
4
|
+
### inline-require - expand 'require "foo"' into inline code
|
5
|
+
###
|
6
|
+
### usage: inline-require [-h] [-I path[,path2,..]] script
|
7
|
+
###
|
8
|
+
### copyright(c) 2006 kuwata-lab all rights reserved.
|
9
|
+
### $Release: 2.0.0 $
|
10
|
+
### $Rev: 2 $
|
11
|
+
###
|
12
|
+
|
13
|
+
|
14
|
+
class InlineRequire
|
15
|
+
|
16
|
+
def expand(filename)
|
17
|
+
sbuf = ''
|
18
|
+
inlined = []
|
19
|
+
level = 0
|
20
|
+
expand_require(filename, sbuf, inlined, level)
|
21
|
+
return sbuf
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def expand_require(filename, sbuf, inlined, level)
|
27
|
+
raise "*** assertion error" if inlined.include?(filename)
|
28
|
+
inlined << filename
|
29
|
+
prog = File.read(filename)
|
30
|
+
n = 0
|
31
|
+
flag_if_file = false
|
32
|
+
prog.each_line do |line|
|
33
|
+
n += 1
|
34
|
+
|
35
|
+
## comment out from 'if __FILE__ == $0' to 'end'
|
36
|
+
if level > 0
|
37
|
+
if flag_if_file
|
38
|
+
sbuf << "#" << line
|
39
|
+
flag_if_file = false if line =~ /^end$/
|
40
|
+
next
|
41
|
+
end
|
42
|
+
if line =~ /^if\s+__FILE__\s*==\s*\$0(\s+then)?$/ || line =~ /^if\s+\$0\s*==\s*__FILE__(\s+then)?$/
|
43
|
+
flag_if_file = true
|
44
|
+
sbuf << "#" << line
|
45
|
+
next
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
## find 'require "foo"' and expand it to inline code
|
50
|
+
flag_inline = false
|
51
|
+
if line =~ /^\s*require ['"](.*)["']\s*$/
|
52
|
+
libname = $1
|
53
|
+
libpath = find_library(libname)
|
54
|
+
$stderr.puts "*** debug: libpath=#{libpath.inspect}" if $debug_mode
|
55
|
+
unless libpath
|
56
|
+
raise "file '#{filename}'(line #{n}): library '#{libname}' not found."
|
57
|
+
end
|
58
|
+
flag_inline = true if libpath =~ /\.rb$/ && local_library?(libpath)
|
59
|
+
end
|
60
|
+
if !flag_inline
|
61
|
+
sbuf << line
|
62
|
+
elsif inlined.include?(libpath)
|
63
|
+
sbuf << "#--already included #{line}"
|
64
|
+
else
|
65
|
+
sbuf << "#--begin of #{line}"
|
66
|
+
expand_require(libpath, sbuf, inlined, level+1)
|
67
|
+
sbuf << "#--end of #{line}"
|
68
|
+
end
|
69
|
+
end
|
70
|
+
#sbuf << "\n" if sbuf[-1] != ?\n
|
71
|
+
end
|
72
|
+
|
73
|
+
def local_library?(libpath)
|
74
|
+
return libpath !~ /^\//
|
75
|
+
end
|
76
|
+
|
77
|
+
def find_library(libname)
|
78
|
+
if libname =~ /^\.rb$/
|
79
|
+
libname_rb = libname
|
80
|
+
libname_so = nil
|
81
|
+
elsif libname =~ /^\.so$/
|
82
|
+
libname_rb = nil
|
83
|
+
libname_so = libname
|
84
|
+
else
|
85
|
+
libname_rb = libname + ".rb"
|
86
|
+
libname_so = libname + ".so"
|
87
|
+
end
|
88
|
+
$LOAD_PATH.each do |path|
|
89
|
+
if libname_rb
|
90
|
+
libpath = path + "/" + libname_rb
|
91
|
+
return libpath if test(?f, libpath)
|
92
|
+
end
|
93
|
+
if libname_so
|
94
|
+
libpath = path + "/" + libname_so
|
95
|
+
return libpath if test(?f, libpath)
|
96
|
+
end
|
97
|
+
end
|
98
|
+
return nil
|
99
|
+
end
|
100
|
+
|
101
|
+
end
|
102
|
+
|
103
|
+
if __FILE__ == $0
|
104
|
+
|
105
|
+
begin
|
106
|
+
rubylib_paths = []
|
107
|
+
flag_help = false
|
108
|
+
while ARGV[0] && ARGV[0][0] == ?-
|
109
|
+
opt = ARGV.shift
|
110
|
+
case opt
|
111
|
+
when '-h', '--help'
|
112
|
+
flag_help = true
|
113
|
+
when '-I'
|
114
|
+
arg = ARGV.shift
|
115
|
+
raise "-I: library path required." unless arg
|
116
|
+
rubylib_paths.concat(arg.split(/,/))
|
117
|
+
when '-D'
|
118
|
+
$debug_mode = true
|
119
|
+
else
|
120
|
+
raise "#{opt}: invalid option."
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
if flag_help
|
125
|
+
command = File.basename($0)
|
126
|
+
puts "Usage: #{command} [-h] [-I path[,path2,..]] script"
|
127
|
+
puts " -h : help"
|
128
|
+
puts " -I path[,path2,...] : ruby library path"
|
129
|
+
exit(0)
|
130
|
+
end
|
131
|
+
|
132
|
+
$stderr.puts "*** debug: rubylib_paths=#{rubylib_paths.inspect}" if $debug_mode
|
133
|
+
$LOAD_PATH.concat(rubylib_paths)
|
134
|
+
|
135
|
+
filenames = ARGV
|
136
|
+
|
137
|
+
inline_require = InlineRequire.new
|
138
|
+
filenames.each do |filename|
|
139
|
+
print inline_require.expand(filename)
|
140
|
+
end
|
141
|
+
|
142
|
+
rescue => ex
|
143
|
+
if $debug_mode
|
144
|
+
raise ex
|
145
|
+
else
|
146
|
+
$stderr.puts ex.message
|
147
|
+
end
|
148
|
+
|
149
|
+
end
|
150
|
+
|
151
|
+
end
|
@@ -0,0 +1,236 @@
|
|
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</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</td>
|
54
|
+
</tr>
|
55
|
+
<tr class="top-aligned-row">
|
56
|
+
<td><strong>In:</strong></td>
|
57
|
+
<td>
|
58
|
+
<a href="../files/erubis/engine/ec_rb.html">
|
59
|
+
erubis/engine/ec.rb
|
60
|
+
</a>
|
61
|
+
<br />
|
62
|
+
<a href="../files/erubis/engine/ejava_rb.html">
|
63
|
+
erubis/engine/ejava.rb
|
64
|
+
</a>
|
65
|
+
<br />
|
66
|
+
<a href="../files/erubis/engine/ejavascript_rb.html">
|
67
|
+
erubis/engine/ejavascript.rb
|
68
|
+
</a>
|
69
|
+
<br />
|
70
|
+
<a href="../files/erubis/engine/enhanced_rb.html">
|
71
|
+
erubis/engine/enhanced.rb
|
72
|
+
</a>
|
73
|
+
<br />
|
74
|
+
<a href="../files/erubis/engine/eperl_rb.html">
|
75
|
+
erubis/engine/eperl.rb
|
76
|
+
</a>
|
77
|
+
<br />
|
78
|
+
<a href="../files/erubis/engine/ephp_rb.html">
|
79
|
+
erubis/engine/ephp.rb
|
80
|
+
</a>
|
81
|
+
<br />
|
82
|
+
<a href="../files/erubis/engine/eruby_rb.html">
|
83
|
+
erubis/engine/eruby.rb
|
84
|
+
</a>
|
85
|
+
<br />
|
86
|
+
<a href="../files/erubis/engine/escheme_rb.html">
|
87
|
+
erubis/engine/escheme.rb
|
88
|
+
</a>
|
89
|
+
<br />
|
90
|
+
<a href="../files/erubis/engine/optimized_rb.html">
|
91
|
+
erubis/engine/optimized.rb
|
92
|
+
</a>
|
93
|
+
<br />
|
94
|
+
<a href="../files/erubis/engine_rb.html">
|
95
|
+
erubis/engine.rb
|
96
|
+
</a>
|
97
|
+
<br />
|
98
|
+
<a href="../files/erubis/enhancer_rb.html">
|
99
|
+
erubis/enhancer.rb
|
100
|
+
</a>
|
101
|
+
<br />
|
102
|
+
<a href="../files/erubis/helper_rb.html">
|
103
|
+
erubis/helper.rb
|
104
|
+
</a>
|
105
|
+
<br />
|
106
|
+
<a href="../files/erubis/main_rb.html">
|
107
|
+
erubis/main.rb
|
108
|
+
</a>
|
109
|
+
<br />
|
110
|
+
<a href="../files/erubis/tiny_rb.html">
|
111
|
+
erubis/tiny.rb
|
112
|
+
</a>
|
113
|
+
<br />
|
114
|
+
</td>
|
115
|
+
</tr>
|
116
|
+
|
117
|
+
</table>
|
118
|
+
</div>
|
119
|
+
<!-- banner header -->
|
120
|
+
|
121
|
+
<div id="bodyContent">
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
<div id="contextContent">
|
126
|
+
|
127
|
+
<div id="description">
|
128
|
+
<p>
|
129
|
+
$Rev: 21 $ $Release: 2.0.0 $ copyright(c) 2006 kuwata-lab all rights reserved.
|
130
|
+
</p>
|
131
|
+
|
132
|
+
</div>
|
133
|
+
|
134
|
+
|
135
|
+
</div>
|
136
|
+
|
137
|
+
|
138
|
+
</div>
|
139
|
+
|
140
|
+
|
141
|
+
<!-- if includes -->
|
142
|
+
|
143
|
+
<div id="section">
|
144
|
+
|
145
|
+
<div id="class-list">
|
146
|
+
<h3 class="section-bar">Classes and Modules</h3>
|
147
|
+
|
148
|
+
Module <a href="Erubis/ArrayBufferEnhancer.html" class="link">Erubis::ArrayBufferEnhancer</a><br />
|
149
|
+
Module <a href="Erubis/ArrayEnhancer.html" class="link">Erubis::ArrayEnhancer</a><br />
|
150
|
+
Module <a href="Erubis/BiPatternEnhancer.html" class="link">Erubis::BiPatternEnhancer</a><br />
|
151
|
+
Module <a href="Erubis/EscapeEnhancer.html" class="link">Erubis::EscapeEnhancer</a><br />
|
152
|
+
Module <a href="Erubis/HeaderFooterEnhancer.html" class="link">Erubis::HeaderFooterEnhancer</a><br />
|
153
|
+
Module <a href="Erubis/NoTextEnhancer.html" class="link">Erubis::NoTextEnhancer</a><br />
|
154
|
+
Module <a href="Erubis/PercentLineEnhancer.html" class="link">Erubis::PercentLineEnhancer</a><br />
|
155
|
+
Module <a href="Erubis/PrintEnabledEnhancer.html" class="link">Erubis::PrintEnabledEnhancer</a><br />
|
156
|
+
Module <a href="Erubis/PrintOutEnhancer.html" class="link">Erubis::PrintOutEnhancer</a><br />
|
157
|
+
Module <a href="Erubis/SimplifyEnhancer.html" class="link">Erubis::SimplifyEnhancer</a><br />
|
158
|
+
Module <a href="Erubis/StdoutEnhancer.html" class="link">Erubis::StdoutEnhancer</a><br />
|
159
|
+
Module <a href="Erubis/StringBufferEnhancer.html" class="link">Erubis::StringBufferEnhancer</a><br />
|
160
|
+
Module <a href="Erubis/XmlHelper.html" class="link">Erubis::XmlHelper</a><br />
|
161
|
+
Class <a href="Erubis/ArrayBufferEruby.html" class="link">Erubis::ArrayBufferEruby</a><br />
|
162
|
+
Class <a href="Erubis/ArrayEruby.html" class="link">Erubis::ArrayEruby</a><br />
|
163
|
+
Class <a href="Erubis/BiPatternEruby.html" class="link">Erubis::BiPatternEruby</a><br />
|
164
|
+
Class <a href="Erubis/CommandOptionError.html" class="link">Erubis::CommandOptionError</a><br />
|
165
|
+
Class <a href="Erubis/Context.html" class="link">Erubis::Context</a><br />
|
166
|
+
Class <a href="Erubis/Ec.html" class="link">Erubis::Ec</a><br />
|
167
|
+
Class <a href="Erubis/Ejava.html" class="link">Erubis::Ejava</a><br />
|
168
|
+
Class <a href="Erubis/Ejavascript.html" class="link">Erubis::Ejavascript</a><br />
|
169
|
+
Class <a href="Erubis/Engine.html" class="link">Erubis::Engine</a><br />
|
170
|
+
Class <a href="Erubis/Eperl.html" class="link">Erubis::Eperl</a><br />
|
171
|
+
Class <a href="Erubis/Ephp.html" class="link">Erubis::Ephp</a><br />
|
172
|
+
Class <a href="Erubis/ErubisError.html" class="link">Erubis::ErubisError</a><br />
|
173
|
+
Class <a href="Erubis/Eruby.html" class="link">Erubis::Eruby</a><br />
|
174
|
+
Class <a href="Erubis/EscapedEc.html" class="link">Erubis::EscapedEc</a><br />
|
175
|
+
Class <a href="Erubis/EscapedEjava.html" class="link">Erubis::EscapedEjava</a><br />
|
176
|
+
Class <a href="Erubis/EscapedEjavascript.html" class="link">Erubis::EscapedEjavascript</a><br />
|
177
|
+
Class <a href="Erubis/EscapedEperl.html" class="link">Erubis::EscapedEperl</a><br />
|
178
|
+
Class <a href="Erubis/EscapedEphp.html" class="link">Erubis::EscapedEphp</a><br />
|
179
|
+
Class <a href="Erubis/EscapedEruby.html" class="link">Erubis::EscapedEruby</a><br />
|
180
|
+
Class <a href="Erubis/EscapedEscheme.html" class="link">Erubis::EscapedEscheme</a><br />
|
181
|
+
Class <a href="Erubis/Escheme.html" class="link">Erubis::Escheme</a><br />
|
182
|
+
Class <a href="Erubis/HeaderFooterEruby.html" class="link">Erubis::HeaderFooterEruby</a><br />
|
183
|
+
Class <a href="Erubis/Main.html" class="link">Erubis::Main</a><br />
|
184
|
+
Class <a href="Erubis/NoTextEruby.html" class="link">Erubis::NoTextEruby</a><br />
|
185
|
+
Class <a href="Erubis/OptimizedEruby.html" class="link">Erubis::OptimizedEruby</a><br />
|
186
|
+
Class <a href="Erubis/OptimizedXmlEruby.html" class="link">Erubis::OptimizedXmlEruby</a><br />
|
187
|
+
Class <a href="Erubis/PercentLineEruby.html" class="link">Erubis::PercentLineEruby</a><br />
|
188
|
+
Class <a href="Erubis/PrintEnabledEruby.html" class="link">Erubis::PrintEnabledEruby</a><br />
|
189
|
+
Class <a href="Erubis/PrintOutEruby.html" class="link">Erubis::PrintOutEruby</a><br />
|
190
|
+
Class <a href="Erubis/PrintOutSimplifiedEruby.html" class="link">Erubis::PrintOutSimplifiedEruby</a><br />
|
191
|
+
Class <a href="Erubis/SimplifiedEruby.html" class="link">Erubis::SimplifiedEruby</a><br />
|
192
|
+
Class <a href="Erubis/StdoutEruby.html" class="link">Erubis::StdoutEruby</a><br />
|
193
|
+
Class <a href="Erubis/StdoutSimplifiedEruby.html" class="link">Erubis::StdoutSimplifiedEruby</a><br />
|
194
|
+
Class <a href="Erubis/StringBufferEruby.html" class="link">Erubis::StringBufferEruby</a><br />
|
195
|
+
Class <a href="Erubis/StringIOEruby.html" class="link">Erubis::StringIOEruby</a><br />
|
196
|
+
Class <a href="Erubis/TinyEruby.html" class="link">Erubis::TinyEruby</a><br />
|
197
|
+
Class <a href="Erubis/XmlEruby.html" class="link">Erubis::XmlEruby</a><br />
|
198
|
+
|
199
|
+
</div>
|
200
|
+
|
201
|
+
<div id="constants-list">
|
202
|
+
<h3 class="section-bar">Constants</h3>
|
203
|
+
|
204
|
+
<div class="name-list">
|
205
|
+
<table summary="Constants">
|
206
|
+
<tr class="top-aligned-row context-row">
|
207
|
+
<td class="context-item-name">Ejs</td>
|
208
|
+
<td>=</td>
|
209
|
+
<td class="context-item-value">Ejavascript</td>
|
210
|
+
</tr>
|
211
|
+
<tr class="top-aligned-row context-row">
|
212
|
+
<td class="context-item-name">EscapedEjs</td>
|
213
|
+
<td>=</td>
|
214
|
+
<td class="context-item-value">EscapedEjavascript</td>
|
215
|
+
</tr>
|
216
|
+
</table>
|
217
|
+
</div>
|
218
|
+
</div>
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
<!-- if method_list -->
|
226
|
+
|
227
|
+
|
228
|
+
</div>
|
229
|
+
|
230
|
+
|
231
|
+
<div id="validator-badges">
|
232
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
233
|
+
</div>
|
234
|
+
|
235
|
+
</body>
|
236
|
+
</html>
|
@@ -0,0 +1,175 @@
|
|
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::ArrayBufferEnhancer</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::ArrayBufferEnhancer</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
|
+
use an Array object as buffer (included in <a href="Eruby.html">Eruby</a>
|
78
|
+
by default)
|
79
|
+
</p>
|
80
|
+
<p>
|
81
|
+
this is only for <a href="Eruby.html">Eruby</a>.
|
82
|
+
</p>
|
83
|
+
|
84
|
+
</div>
|
85
|
+
|
86
|
+
|
87
|
+
</div>
|
88
|
+
|
89
|
+
<div id="method-list">
|
90
|
+
<h3 class="section-bar">Methods</h3>
|
91
|
+
|
92
|
+
<div class="name-list">
|
93
|
+
<a href="#M000002">add_postamble</a>
|
94
|
+
<a href="#M000001">add_preamble</a>
|
95
|
+
</div>
|
96
|
+
</div>
|
97
|
+
|
98
|
+
</div>
|
99
|
+
|
100
|
+
|
101
|
+
<!-- if includes -->
|
102
|
+
|
103
|
+
<div id="section">
|
104
|
+
|
105
|
+
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
|
110
|
+
|
111
|
+
|
112
|
+
<!-- if method_list -->
|
113
|
+
<div id="methods">
|
114
|
+
<h3 class="section-bar">Public Instance methods</h3>
|
115
|
+
|
116
|
+
<div id="method-M000002" class="method-detail">
|
117
|
+
<a name="M000002"></a>
|
118
|
+
|
119
|
+
<div class="method-heading">
|
120
|
+
<a href="#M000002" class="method-signature">
|
121
|
+
<span class="method-name">add_postamble</span><span class="method-args">(src)</span>
|
122
|
+
</a>
|
123
|
+
</div>
|
124
|
+
|
125
|
+
<div class="method-description">
|
126
|
+
<p><a class="source-toggle" href="#"
|
127
|
+
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
128
|
+
<div class="method-source-code" id="M000002-source">
|
129
|
+
<pre>
|
130
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 197</span>
|
131
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_postamble</span>(<span class="ruby-identifier">src</span>)
|
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
|
+
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"_buf.join\n"</span>
|
134
|
+
<span class="ruby-keyword kw">end</span>
|
135
|
+
</pre>
|
136
|
+
</div>
|
137
|
+
</div>
|
138
|
+
</div>
|
139
|
+
|
140
|
+
<div id="method-M000001" class="method-detail">
|
141
|
+
<a name="M000001"></a>
|
142
|
+
|
143
|
+
<div class="method-heading">
|
144
|
+
<a href="#M000001" class="method-signature">
|
145
|
+
<span class="method-name">add_preamble</span><span class="method-args">(src)</span>
|
146
|
+
</a>
|
147
|
+
</div>
|
148
|
+
|
149
|
+
<div class="method-description">
|
150
|
+
<p><a class="source-toggle" href="#"
|
151
|
+
onclick="toggleCode('M000001-source');return false;">[Source]</a></p>
|
152
|
+
<div class="method-source-code" id="M000001-source">
|
153
|
+
<pre>
|
154
|
+
<span class="ruby-comment cmt"># File erubis/enhancer.rb, line 193</span>
|
155
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">add_preamble</span>(<span class="ruby-identifier">src</span>)
|
156
|
+
<span class="ruby-identifier">src</span> <span class="ruby-operator"><<</span> <span class="ruby-value str">"_buf = [];"</span>
|
157
|
+
<span class="ruby-keyword kw">end</span>
|
158
|
+
</pre>
|
159
|
+
</div>
|
160
|
+
</div>
|
161
|
+
</div>
|
162
|
+
|
163
|
+
|
164
|
+
</div>
|
165
|
+
|
166
|
+
|
167
|
+
</div>
|
168
|
+
|
169
|
+
|
170
|
+
<div id="validator-badges">
|
171
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
172
|
+
</div>
|
173
|
+
|
174
|
+
</body>
|
175
|
+
</html>
|