erbook 6.1.0 → 7.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/erbook +29 -25
- data/doc/HelloWorld.spec +3 -1
- data/doc/api/classes/ERBook.html +86 -0
- data/doc/api/classes/ERBook/Document.html +399 -0
- data/doc/api/classes/ERBook/Document/Node.html +110 -0
- data/doc/api/classes/ERBook/Template.html +309 -0
- data/doc/api/classes/ERBook/Template/Sandbox.html +134 -0
- data/doc/api/classes/RDoc.html +69 -0
- data/doc/api/classes/RDoc/AnyMethod.html +249 -0
- data/doc/api/classes/RDoc/DummyMarkup.html +60 -0
- data/doc/api/classes/RDoc/DummyMixin.html +54 -0
- data/doc/api/classes/RDoc/DummyOptions.html +60 -0
- data/doc/api/classes/RDoc/TopLevel.html +344 -0
- data/doc/api/classes/String.html +212 -0
- data/doc/api/created.rid +1 -0
- data/doc/api/css/main.css +263 -0
- data/doc/api/css/panel.css +383 -0
- data/doc/api/css/reset.css +53 -0
- data/doc/api/files/ANN_eml.html +276 -0
- data/doc/api/files/ANN_html.html +407 -0
- data/doc/api/files/ANN_txt.html +271 -0
- data/doc/api/files/LICENSE.html +76 -0
- data/doc/api/files/lib/erbook/document_rb.html +74 -0
- data/doc/api/files/lib/erbook/rdoc_rb.html +77 -0
- data/doc/api/files/lib/erbook/template_rb.html +66 -0
- data/doc/api/files/lib/erbook/to_xhtml_rb.html +89 -0
- data/doc/api/files/lib/erbook_rb.html +70 -0
- data/doc/api/i/arrows.png +0 -0
- data/doc/api/i/results_bg.png +0 -0
- data/doc/api/i/tree_bg.png +0 -0
- data/doc/api/index.html +14 -18
- data/doc/api/js/jquery-1.3.2.min.js +19 -0
- data/doc/api/js/jquery-effect.js +593 -0
- data/doc/api/js/main.js +22 -0
- data/doc/api/js/searchdoc.js +605 -0
- data/doc/api/panel/index.html +63 -0
- data/doc/api/panel/search_index.js +1 -0
- data/doc/api/panel/tree.js +1 -0
- data/doc/formats.erb +63 -115
- data/doc/history.erb +125 -92
- data/doc/index.erb +12 -7
- data/doc/index.xhtml +1020 -1347
- data/doc/intro.erb +42 -40
- data/doc/setup.erb +18 -18
- data/doc/theory.erb +24 -31
- data/doc/usage.erb +14 -24
- data/fmt/xhtml.icons/index.yaml +16 -14
- data/fmt/xhtml.icons/rakefile +33 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/16x16/places/start-here.png +0 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/32x32/actions/go-down.png +0 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/32x32/actions/go-up.png +0 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/32x32/places/start-here.png +0 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/32x32/status/software-update-available.png +0 -0
- data/fmt/xhtml.icons/{tango-icon-theme-0.8.1 → tango-icon-theme-0.8.90}/48x48/apps/accessories-text-editor.png +0 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/48x48/apps/internet-group-chat.png +0 -0
- data/fmt/xhtml.icons/{tango-icon-theme-0.8.1 → tango-icon-theme-0.8.90}/48x48/emblems/emblem-important.png +0 -0
- data/fmt/xhtml.icons/{tango-icon-theme-0.8.1 → tango-icon-theme-0.8.90}/48x48/status/dialog-error.png +0 -0
- data/fmt/xhtml.icons/{tango-icon-theme-0.8.1 → tango-icon-theme-0.8.90}/48x48/status/dialog-information.png +0 -0
- data/fmt/xhtml.icons/{tango-icon-theme-0.8.1 → tango-icon-theme-0.8.90}/48x48/status/dialog-warning.png +0 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/COPYING +1 -0
- data/fmt/xhtml.icons/{tango-icon-theme-0.8.1 → tango-icon-theme-0.8.90}/README +0 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/actions/bookmark-new.svg +672 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/actions/go-down.svg +200 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/actions/go-home.svg +445 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/actions/go-up.svg +196 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/actions/view-refresh.svg +393 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/apps/accessories-text-editor.svg +554 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/apps/internet-group-chat.svg +312 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/emblems/emblem-favorite.svg +242 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/emblems/emblem-important.svg +164 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/mimetypes/application-certificate.svg +443 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/places/start-here.svg +492 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/status/dialog-error.svg +330 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/status/dialog-information.svg +1159 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/status/dialog-warning.svg +373 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.90/scalable/status/software-update-available.svg +209 -0
- data/fmt/xhtml.scripts/jquery-1.3.2.min.js +19 -0
- data/fmt/xhtml.scripts/jquery.localscroll-1.2.7-min.js +9 -0
- data/fmt/xhtml.scripts/jquery.scrollTo-1.4.1-min.js +11 -0
- data/fmt/xhtml.yaml +470 -454
- data/lang/de.yaml +5 -5
- data/lang/el.yaml +4 -4
- data/lang/es.yaml +5 -5
- data/lang/fr.yaml +5 -5
- data/lang/it.yaml +5 -5
- data/lang/ja.yaml +4 -4
- data/lang/ko.yaml +4 -4
- data/lang/nl.yaml +4 -4
- data/lang/phrases.yaml +4 -4
- data/lang/pt.yaml +5 -5
- data/lang/ru.yaml +5 -5
- data/lang/zh.yaml +5 -5
- data/lang/zt.yaml +5 -5
- data/lib/erbook.rb +12 -5
- data/lib/erbook/document.rb +127 -107
- data/lib/erbook/rdoc.rb +18 -11
- data/lib/erbook/template.rb +86 -176
- data/lib/erbook/to_xhtml.rb +98 -25
- data/{Rakefile → rakefile} +1 -0
- metadata +106 -53
- data/doc/api/ERBook.html +0 -35
- data/doc/api/ERBook/Document.html +0 -669
- data/doc/api/ERBook/Document/Node.html +0 -102
- data/doc/api/ERBook/Template.html +0 -670
- data/doc/api/RDoc.html +0 -23
- data/doc/api/RDoc/AnyMethod.html +0 -302
- data/doc/api/RDoc/DummyMarkup.html +0 -73
- data/doc/api/RDoc/DummyMixin.html +0 -23
- data/doc/api/RDoc/DummyOptions.html +0 -140
- data/doc/api/RDoc/TopLevel.html +0 -465
- data/doc/api/String.html +0 -372
- data/doc/api/all-methods.html +0 -253
- data/doc/api/all-namespaces.html +0 -42
- data/doc/api/app.js +0 -18
- data/doc/api/jquery.js +0 -11
- data/doc/api/readme.html +0 -38
- data/doc/api/style.css +0 -68
- data/doc/api/syntax_highlight.css +0 -21
- data/fmt/xhtml.icons/tango-icon-theme-0.8.1/48x48/README +0 -2
- data/fmt/xhtml.icons/tango-icon-theme-0.8.1/48x48/apps/internet-group-chat.png +0 -0
- data/fmt/xhtml.icons/tango-icon-theme-0.8.1/COPYING +0 -67
@@ -0,0 +1,110 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<title>ERBook::Document::Node</title>
|
7
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
8
|
+
<link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
|
9
|
+
<link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
|
10
|
+
<script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
|
11
|
+
<script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
</head>
|
14
|
+
|
15
|
+
<body>
|
16
|
+
<div class="banner">
|
17
|
+
<h1>
|
18
|
+
<span class="type">Class</span>
|
19
|
+
ERBook::Document::Node
|
20
|
+
|
21
|
+
<span class="parent"><
|
22
|
+
|
23
|
+
OpenStruct
|
24
|
+
|
25
|
+
</span>
|
26
|
+
|
27
|
+
</h1>
|
28
|
+
<ul class="files">
|
29
|
+
|
30
|
+
<li><a href="../../../files/lib/erbook/document_rb.html">lib/erbook/document.rb</a></li>
|
31
|
+
|
32
|
+
</ul>
|
33
|
+
</div>
|
34
|
+
<div id="bodyContent">
|
35
|
+
<div id="content">
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
<div class="sectiontitle">Methods</div>
|
46
|
+
<dl class="methods">
|
47
|
+
|
48
|
+
<dt>T</dt>
|
49
|
+
<dd>
|
50
|
+
<ul>
|
51
|
+
|
52
|
+
<li><a href="#M000056">to_s</a></li>
|
53
|
+
|
54
|
+
</ul>
|
55
|
+
</dd>
|
56
|
+
|
57
|
+
</dl>
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
<div class="sectiontitle">Instance Public methods</div>
|
72
|
+
|
73
|
+
<div class="method">
|
74
|
+
<div class="title" id="M000056">
|
75
|
+
|
76
|
+
<a name="M000056"></a><b>to_s</b>()
|
77
|
+
|
78
|
+
</div>
|
79
|
+
|
80
|
+
<div class="description">
|
81
|
+
<p>
|
82
|
+
Returns the output of this node.
|
83
|
+
</p>
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
<div class="sourcecode">
|
91
|
+
<p class="source-link">
|
92
|
+
Source: <a href="javascript:toggleSource('M000056_source')" id="l_M000056_source">show</a>
|
93
|
+
|
94
|
+
| <a href="http://github.com/sunaku/erbook/blob/a096a4140d3d9ea230c89aba50526af5e4613f82/lib/erbook/document.rb#L236" target="_blank" class="github_url">on GitHub</a>
|
95
|
+
|
96
|
+
</p>
|
97
|
+
<div id="M000056_source" class="dyn-source">
|
98
|
+
<pre><span class="ruby-comment cmt"># File lib/erbook/document.rb, line 236</span>
|
99
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
|
100
|
+
<span class="ruby-identifier">defn</span>[<span class="ruby-value str">'silent'</span>] <span class="ruby-operator">?</span> <span class="ruby-value str">''</span> <span class="ruby-operator">:</span> <span class="ruby-identifier">output</span>
|
101
|
+
<span class="ruby-keyword kw">end</span></pre>
|
102
|
+
</div>
|
103
|
+
</div>
|
104
|
+
|
105
|
+
</div>
|
106
|
+
|
107
|
+
</div>
|
108
|
+
</div>
|
109
|
+
</body>
|
110
|
+
</html>
|
@@ -0,0 +1,309 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<title>ERBook::Template</title>
|
7
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
8
|
+
<link rel="stylesheet" href="../../css/reset.css" type="text/css" media="screen" />
|
9
|
+
<link rel="stylesheet" href="../../css/main.css" type="text/css" media="screen" />
|
10
|
+
<script src="../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
|
11
|
+
<script src="../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="../../js/main.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
</head>
|
14
|
+
|
15
|
+
<body>
|
16
|
+
<div class="banner">
|
17
|
+
<h1>
|
18
|
+
<span class="type">Class</span>
|
19
|
+
ERBook::Template
|
20
|
+
|
21
|
+
<span class="parent"><
|
22
|
+
|
23
|
+
Ember::Template
|
24
|
+
|
25
|
+
</span>
|
26
|
+
|
27
|
+
</h1>
|
28
|
+
<ul class="files">
|
29
|
+
|
30
|
+
<li><a href="../../files/lib/erbook/template_rb.html">lib/erbook/template.rb</a></li>
|
31
|
+
|
32
|
+
</ul>
|
33
|
+
</div>
|
34
|
+
<div id="bodyContent">
|
35
|
+
<div id="content">
|
36
|
+
|
37
|
+
<div class="description">
|
38
|
+
<p>
|
39
|
+
eRuby template that provides access to the underlying result buffer (which
|
40
|
+
contains the result of template evaluation thus far) and provides
|
41
|
+
sandboxing for isolated template rendering.
|
42
|
+
</p>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
|
54
|
+
<div class="sectiontitle">Methods</div>
|
55
|
+
<dl class="methods">
|
56
|
+
|
57
|
+
<dt>B</dt>
|
58
|
+
<dd>
|
59
|
+
<ul>
|
60
|
+
|
61
|
+
<li><a href="#M000034">buffer</a></li>
|
62
|
+
|
63
|
+
</ul>
|
64
|
+
</dd>
|
65
|
+
|
66
|
+
<dt>N</dt>
|
67
|
+
<dd>
|
68
|
+
<ul>
|
69
|
+
|
70
|
+
<li><a href="#M000032">new</a></li>
|
71
|
+
|
72
|
+
</ul>
|
73
|
+
</dd>
|
74
|
+
|
75
|
+
<dt>R</dt>
|
76
|
+
<dd>
|
77
|
+
<ul>
|
78
|
+
|
79
|
+
<li><a href="#M000033">render</a>,</li>
|
80
|
+
|
81
|
+
<li><a href="#M000035">render_with</a></li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
</dd>
|
85
|
+
|
86
|
+
</dl>
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
<div class="sectiontitle">Classes and Modules</div>
|
95
|
+
<ul>
|
96
|
+
|
97
|
+
<li><span class="type">CLASS</span> <a href="Template/Sandbox.html">ERBook::Template::Sandbox</a></li>
|
98
|
+
|
99
|
+
</ul>
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
|
104
|
+
|
105
|
+
<div class="sectiontitle">Attributes</div>
|
106
|
+
<table border='0' cellpadding='5'>
|
107
|
+
|
108
|
+
<tr valign='top'>
|
109
|
+
<td class='attr-rw'>
|
110
|
+
[R]
|
111
|
+
</td>
|
112
|
+
<td class='attr-name'>sandbox</td>
|
113
|
+
<td class='attr-desc'></td>
|
114
|
+
</tr>
|
115
|
+
|
116
|
+
</table>
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
<div class="sectiontitle">Class Public methods</div>
|
121
|
+
|
122
|
+
<div class="method">
|
123
|
+
<div class="title" id="M000032">
|
124
|
+
|
125
|
+
<a name="M000032"></a><b>new</b>(source, input, unindent = true, safe_level = nil)
|
126
|
+
|
127
|
+
</div>
|
128
|
+
|
129
|
+
<div class="description">
|
130
|
+
<h4>Parameters</h4>
|
131
|
+
<dl>
|
132
|
+
<dt>source</dt><dd>Replacement for the ambiguous ’(erb)’ identifier in stack
|
133
|
+
traces; so that the user can better determine the source of an error.
|
134
|
+
|
135
|
+
</dd>
|
136
|
+
<dt>input</dt><dd>A string containing eRuby directives.
|
137
|
+
|
138
|
+
</dd>
|
139
|
+
<dt>unindent</dt><dd>If true, then all content blocks will be unindented hierarchically,
|
140
|
+
|
141
|
+
</dd>
|
142
|
+
<dt>safe_level</dt><dd>See safe_level in ERB::new().
|
143
|
+
|
144
|
+
</dd>
|
145
|
+
</dl>
|
146
|
+
|
147
|
+
</div>
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
<div class="sourcecode">
|
153
|
+
<p class="source-link">
|
154
|
+
Source: <a href="javascript:toggleSource('M000032_source')" id="l_M000032_source">show</a>
|
155
|
+
|
156
|
+
| <a href="http://github.com/sunaku/erbook/blob/a096a4140d3d9ea230c89aba50526af5e4613f82/lib/erbook/template.rb#L33" target="_blank" class="github_url">on GitHub</a>
|
157
|
+
|
158
|
+
</p>
|
159
|
+
<div id="M000032_source" class="dyn-source">
|
160
|
+
<pre><span class="ruby-comment cmt"># File lib/erbook/template.rb, line 33</span>
|
161
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">source</span>, <span class="ruby-identifier">input</span>, <span class="ruby-identifier">unindent</span> = <span class="ruby-keyword kw">true</span>, <span class="ruby-identifier">safe_level</span> = <span class="ruby-keyword kw">nil</span>
|
162
|
+
<span class="ruby-keyword kw">super</span> <span class="ruby-identifier">input</span>,
|
163
|
+
<span class="ruby-identifier">:result_variable</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">:@buffer</span>,
|
164
|
+
<span class="ruby-identifier">:source_file</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">source</span>,
|
165
|
+
<span class="ruby-identifier">:unindent</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">unindent</span>,
|
166
|
+
<span class="ruby-identifier">:shorthand</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">true</span>,
|
167
|
+
<span class="ruby-identifier">:infer_end</span> =<span class="ruby-operator">></span> <span class="ruby-keyword kw">true</span>
|
168
|
+
|
169
|
+
<span class="ruby-ivar">@sandbox</span> = <span class="ruby-constant">Sandbox</span>.<span class="ruby-identifier">new</span>
|
170
|
+
|
171
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">$DEBUG</span>
|
172
|
+
<span class="ruby-constant">IO</span>.<span class="ruby-identifier">popen</span>(<span class="ruby-value str">'cat -n'</span>, <span class="ruby-value str">'w+'</span>) <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">io</span><span class="ruby-operator">|</span>
|
173
|
+
<span class="ruby-identifier">io</span>.<span class="ruby-identifier">write</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">program</span>
|
174
|
+
<span class="ruby-identifier">io</span>.<span class="ruby-identifier">close_write</span>
|
175
|
+
<span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">io</span>.<span class="ruby-identifier">read</span>
|
176
|
+
<span class="ruby-keyword kw">end</span>
|
177
|
+
<span class="ruby-keyword kw">end</span>
|
178
|
+
<span class="ruby-keyword kw">end</span></pre>
|
179
|
+
</div>
|
180
|
+
</div>
|
181
|
+
|
182
|
+
</div>
|
183
|
+
|
184
|
+
<div class="sectiontitle">Instance Public methods</div>
|
185
|
+
|
186
|
+
<div class="method">
|
187
|
+
<div class="title" id="M000034">
|
188
|
+
|
189
|
+
<a name="M000034"></a><b>buffer</b>()
|
190
|
+
|
191
|
+
</div>
|
192
|
+
|
193
|
+
<div class="description">
|
194
|
+
<p>
|
195
|
+
Returns the result of template evaluation thus far.
|
196
|
+
</p>
|
197
|
+
|
198
|
+
</div>
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
|
203
|
+
<div class="sourcecode">
|
204
|
+
<p class="source-link">
|
205
|
+
Source: <a href="javascript:toggleSource('M000034_source')" id="l_M000034_source">show</a>
|
206
|
+
|
207
|
+
| <a href="http://github.com/sunaku/erbook/blob/a096a4140d3d9ea230c89aba50526af5e4613f82/lib/erbook/template.rb#L64" target="_blank" class="github_url">on GitHub</a>
|
208
|
+
|
209
|
+
</p>
|
210
|
+
<div id="M000034_source" class="dyn-source">
|
211
|
+
<pre><span class="ruby-comment cmt"># File lib/erbook/template.rb, line 64</span>
|
212
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">buffer</span>
|
213
|
+
<span class="ruby-ivar">@sandbox</span>.<span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-identifier">:@buffer</span>)
|
214
|
+
<span class="ruby-keyword kw">end</span></pre>
|
215
|
+
</div>
|
216
|
+
</div>
|
217
|
+
|
218
|
+
</div>
|
219
|
+
|
220
|
+
<div class="method">
|
221
|
+
<div class="title" id="M000033">
|
222
|
+
|
223
|
+
<a name="M000033"></a><b>render</b>()
|
224
|
+
|
225
|
+
</div>
|
226
|
+
|
227
|
+
<div class="description">
|
228
|
+
<p>
|
229
|
+
Returns the output of evaluating this template inside the given context.
|
230
|
+
</p>
|
231
|
+
<p>
|
232
|
+
If no context is given, then the sandbox of this template is used.
|
233
|
+
</p>
|
234
|
+
|
235
|
+
</div>
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
<div class="sourcecode">
|
241
|
+
<p class="source-link">
|
242
|
+
Source: <a href="javascript:toggleSource('M000033_source')" id="l_M000033_source">show</a>
|
243
|
+
|
244
|
+
| <a href="http://github.com/sunaku/erbook/blob/a096a4140d3d9ea230c89aba50526af5e4613f82/lib/erbook/template.rb#L57" target="_blank" class="github_url">on GitHub</a>
|
245
|
+
|
246
|
+
</p>
|
247
|
+
<div id="M000033_source" class="dyn-source">
|
248
|
+
<pre><span class="ruby-comment cmt"># File lib/erbook/template.rb, line 57</span>
|
249
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render</span>
|
250
|
+
<span class="ruby-keyword kw">super</span> <span class="ruby-ivar">@sandbox</span>.<span class="ruby-identifier">instance_eval</span>(<span class="ruby-value str">'binding'</span>)
|
251
|
+
<span class="ruby-keyword kw">end</span></pre>
|
252
|
+
</div>
|
253
|
+
</div>
|
254
|
+
|
255
|
+
</div>
|
256
|
+
|
257
|
+
<div class="method">
|
258
|
+
<div class="title" id="M000035">
|
259
|
+
|
260
|
+
<a name="M000035"></a><b>render_with</b>(inst_vars = {})
|
261
|
+
|
262
|
+
</div>
|
263
|
+
|
264
|
+
<div class="description">
|
265
|
+
<p>
|
266
|
+
Renders this template within a fresh sandbox that is populated with the
|
267
|
+
given instance variables, whose names must be prefixed with
|
268
|
+
’@’.
|
269
|
+
</p>
|
270
|
+
|
271
|
+
</div>
|
272
|
+
|
273
|
+
|
274
|
+
|
275
|
+
|
276
|
+
<div class="sourcecode">
|
277
|
+
<p class="source-link">
|
278
|
+
Source: <a href="javascript:toggleSource('M000035_source')" id="l_M000035_source">show</a>
|
279
|
+
|
280
|
+
| <a href="http://github.com/sunaku/erbook/blob/a096a4140d3d9ea230c89aba50526af5e4613f82/lib/erbook/template.rb#L72" target="_blank" class="github_url">on GitHub</a>
|
281
|
+
|
282
|
+
</p>
|
283
|
+
<div id="M000035_source" class="dyn-source">
|
284
|
+
<pre><span class="ruby-comment cmt"># File lib/erbook/template.rb, line 72</span>
|
285
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">render_with</span> <span class="ruby-identifier">inst_vars</span> = {}
|
286
|
+
<span class="ruby-identifier">old_sandbox</span> = <span class="ruby-ivar">@sandbox</span>
|
287
|
+
|
288
|
+
<span class="ruby-keyword kw">begin</span>
|
289
|
+
<span class="ruby-ivar">@sandbox</span> = <span class="ruby-constant">Sandbox</span>.<span class="ruby-identifier">new</span>
|
290
|
+
|
291
|
+
<span class="ruby-identifier">inst_vars</span>.<span class="ruby-identifier">each_pair</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">var</span>, <span class="ruby-identifier">val</span><span class="ruby-operator">|</span>
|
292
|
+
<span class="ruby-ivar">@sandbox</span>.<span class="ruby-identifier">instance_variable_set</span> <span class="ruby-identifier">var</span>, <span class="ruby-identifier">val</span>
|
293
|
+
<span class="ruby-keyword kw">end</span>
|
294
|
+
|
295
|
+
<span class="ruby-identifier">render</span>
|
296
|
+
|
297
|
+
<span class="ruby-keyword kw">ensure</span>
|
298
|
+
<span class="ruby-ivar">@sandbox</span> = <span class="ruby-identifier">old_sandbox</span>
|
299
|
+
<span class="ruby-keyword kw">end</span>
|
300
|
+
<span class="ruby-keyword kw">end</span></pre>
|
301
|
+
</div>
|
302
|
+
</div>
|
303
|
+
|
304
|
+
</div>
|
305
|
+
|
306
|
+
</div>
|
307
|
+
</div>
|
308
|
+
</body>
|
309
|
+
</html>
|
@@ -0,0 +1,134 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<title>ERBook::Template::Sandbox</title>
|
7
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
8
|
+
<link rel="stylesheet" href="../../../css/reset.css" type="text/css" media="screen" />
|
9
|
+
<link rel="stylesheet" href="../../../css/main.css" type="text/css" media="screen" />
|
10
|
+
<script src="../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
|
11
|
+
<script src="../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
|
12
|
+
<script src="../../../js/main.js" type="text/javascript" charset="utf-8"></script>
|
13
|
+
</head>
|
14
|
+
|
15
|
+
<body>
|
16
|
+
<div class="banner">
|
17
|
+
<h1>
|
18
|
+
<span class="type">Class</span>
|
19
|
+
ERBook::Template::Sandbox
|
20
|
+
|
21
|
+
<span class="parent"><
|
22
|
+
|
23
|
+
Object
|
24
|
+
|
25
|
+
</span>
|
26
|
+
|
27
|
+
</h1>
|
28
|
+
<ul class="files">
|
29
|
+
|
30
|
+
<li><a href="../../../files/lib/erbook/template_rb.html">lib/erbook/template.rb</a></li>
|
31
|
+
|
32
|
+
</ul>
|
33
|
+
</div>
|
34
|
+
<div id="bodyContent">
|
35
|
+
<div id="content">
|
36
|
+
|
37
|
+
<div class="description">
|
38
|
+
<p>
|
39
|
+
Environment for template evaluation.
|
40
|
+
</p>
|
41
|
+
|
42
|
+
</div>
|
43
|
+
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
<div class="sectiontitle">Methods</div>
|
53
|
+
<dl class="methods">
|
54
|
+
|
55
|
+
<dt>#</dt>
|
56
|
+
<dd>
|
57
|
+
<ul>
|
58
|
+
|
59
|
+
<li><a href="#M000038">__block_content__</a></li>
|
60
|
+
|
61
|
+
</ul>
|
62
|
+
</dd>
|
63
|
+
|
64
|
+
</dl>
|
65
|
+
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
|
76
|
+
|
77
|
+
|
78
|
+
<div class="sectiontitle">Instance Public methods</div>
|
79
|
+
|
80
|
+
<div class="method">
|
81
|
+
<div class="title" id="M000038">
|
82
|
+
|
83
|
+
<a name="M000038"></a><b>__block_content__</b>(*block_args)
|
84
|
+
|
85
|
+
</div>
|
86
|
+
|
87
|
+
<div class="description">
|
88
|
+
<p>
|
89
|
+
Returns an array of things that the given block wants to append to the
|
90
|
+
buffer. If the given block does not want to append to the buffer, then
|
91
|
+
returns the result of invoking the given block inside an array.
|
92
|
+
</p>
|
93
|
+
|
94
|
+
</div>
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
<div class="sourcecode">
|
100
|
+
<p class="source-link">
|
101
|
+
Source: <a href="javascript:toggleSource('M000038_source')" id="l_M000038_source">show</a>
|
102
|
+
|
103
|
+
| <a href="http://github.com/sunaku/erbook/blob/a096a4140d3d9ea230c89aba50526af5e4613f82/lib/erbook/template.rb#L100" target="_blank" class="github_url">on GitHub</a>
|
104
|
+
|
105
|
+
</p>
|
106
|
+
<div id="M000038_source" class="dyn-source">
|
107
|
+
<pre><span class="ruby-comment cmt"># File lib/erbook/template.rb, line 100</span>
|
108
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">__block_content__</span> <span class="ruby-operator">*</span><span class="ruby-identifier">block_args</span>
|
109
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-value str">'block must be given'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">block_given?</span>
|
110
|
+
|
111
|
+
<span class="ruby-identifier">original</span> = <span class="ruby-ivar">@buffer</span>
|
112
|
+
|
113
|
+
<span class="ruby-keyword kw">begin</span>
|
114
|
+
<span class="ruby-identifier">block_content</span> = <span class="ruby-ivar">@buffer</span> = []
|
115
|
+
<span class="ruby-identifier">return_value</span> = <span class="ruby-keyword kw">yield</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">block_args</span>) <span class="ruby-comment cmt"># this appends content to @buffer</span>
|
116
|
+
<span class="ruby-keyword kw">ensure</span>
|
117
|
+
<span class="ruby-ivar">@buffer</span> = <span class="ruby-identifier">original</span>
|
118
|
+
<span class="ruby-keyword kw">end</span>
|
119
|
+
|
120
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_content</span>.<span class="ruby-identifier">empty?</span>
|
121
|
+
[<span class="ruby-identifier">return_value</span>]
|
122
|
+
<span class="ruby-keyword kw">else</span>
|
123
|
+
<span class="ruby-identifier">block_content</span>
|
124
|
+
<span class="ruby-keyword kw">end</span>
|
125
|
+
<span class="ruby-keyword kw">end</span></pre>
|
126
|
+
</div>
|
127
|
+
</div>
|
128
|
+
|
129
|
+
</div>
|
130
|
+
|
131
|
+
</div>
|
132
|
+
</div>
|
133
|
+
</body>
|
134
|
+
</html>
|