ember 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/ember +2 -10
- data/lib/ember/inochi.rb +10 -54
- data/lib/ember/template.rb +1 -1
- data/man/man1/ember.1 +1742 -0
- metadata +13 -47
- data/CREDITS +0 -13
- data/man.html +0 -1031
- data/man/man1/ember.1.gz +0 -0
data/bin/ember
CHANGED
@@ -3,16 +3,8 @@
|
|
3
3
|
require 'ember'
|
4
4
|
|
5
5
|
if ARGV.delete('-h') or ARGV.delete('--help')
|
6
|
-
|
7
|
-
|
8
|
-
unless system 'man', '-M', man_path, '-a', 'ember'
|
9
|
-
# try to display HTML version of help manual
|
10
|
-
man_html = man_path + '.html'
|
11
|
-
unless %w[$BROWSER open start].any? {|b| system "#{b} #{man_html}" }
|
12
|
-
# no luck; direct user to project website
|
13
|
-
puts "See #{Ember::WEBSITE}"
|
14
|
-
end
|
15
|
-
end
|
6
|
+
system 'man', '-M', File.join(Ember::INSTDIR, 'man'), 'ember' or
|
7
|
+
warn "Could not display the help manual.\nSee #{Ember::WEBSITE} instead."
|
16
8
|
exit
|
17
9
|
elsif ARGV.delete('-v') or ARGV.delete('--version')
|
18
10
|
puts Ember::VERSION
|
data/lib/ember/inochi.rb
CHANGED
@@ -3,27 +3,27 @@ module Ember
|
|
3
3
|
##
|
4
4
|
# Official name of this project.
|
5
5
|
#
|
6
|
-
PROJECT =
|
6
|
+
PROJECT = 'Ember'
|
7
7
|
|
8
8
|
##
|
9
9
|
# Short single-line description of this project.
|
10
10
|
#
|
11
|
-
TAGLINE =
|
11
|
+
TAGLINE = 'eRuby template processor'
|
12
12
|
|
13
13
|
##
|
14
14
|
# Address of this project's official home page.
|
15
15
|
#
|
16
|
-
WEBSITE =
|
16
|
+
WEBSITE = 'http://snk.tuxfamily.org/lib/ember/'
|
17
17
|
|
18
18
|
##
|
19
19
|
# Number of this release of this project.
|
20
20
|
#
|
21
|
-
VERSION =
|
21
|
+
VERSION = '0.3.1'
|
22
22
|
|
23
23
|
##
|
24
24
|
# Date of this release of this project.
|
25
25
|
#
|
26
|
-
RELDATE =
|
26
|
+
RELDATE = '2011-04-22'
|
27
27
|
|
28
28
|
##
|
29
29
|
# Description of this release of this project.
|
@@ -42,62 +42,18 @@ module Ember
|
|
42
42
|
#
|
43
43
|
# @example
|
44
44
|
#
|
45
|
-
#
|
45
|
+
# GEMDEPS = {
|
46
46
|
# # this project needs exactly version 1.2.3 of the "an_example" gem
|
47
|
-
#
|
47
|
+
# 'an_example' => [ '1.2.3' ],
|
48
48
|
#
|
49
49
|
# # this project needs at least version 1.2 (but not
|
50
50
|
# # version 1.2.4 or newer) of the "another_example" gem
|
51
|
-
#
|
51
|
+
# 'another_example' => [ '>= 1.2' , '< 1.2.4' ],
|
52
52
|
#
|
53
53
|
# # this project needs any version of the "yet_another_example" gem
|
54
|
-
#
|
54
|
+
# 'yet_another_example' => [],
|
55
55
|
# }
|
56
56
|
#
|
57
|
-
|
58
|
-
|
59
|
-
##
|
60
|
-
# RubyGems required by this project during development.
|
61
|
-
#
|
62
|
-
# @example
|
63
|
-
#
|
64
|
-
# DEVTIME = {
|
65
|
-
# # this project needs exactly version 1.2.3 of the "an_example" gem
|
66
|
-
# "an_example" => [ "1.2.3" ],
|
67
|
-
#
|
68
|
-
# # this project needs at least version 1.2 (but not
|
69
|
-
# # version 1.2.4 or newer) of the "another_example" gem
|
70
|
-
# "another_example" => [ ">= 1.2" , "< 1.2.4" ],
|
71
|
-
#
|
72
|
-
# # this project needs any version of the "yet_another_example" gem
|
73
|
-
# "yet_another_example" => [],
|
74
|
-
# }
|
75
|
-
#
|
76
|
-
DEVTIME = {
|
77
|
-
"inochi" => [ "~> 2" ], # for managing this project
|
78
|
-
"dfect" => [ "~> 2" ], # for unit testing
|
79
|
-
}
|
80
|
-
|
81
|
-
##
|
82
|
-
# Loads the correct version (as defined by the {RUNTIME} or {DEVTIME}
|
83
|
-
# constant in this module) of the given gem or the gem that contains
|
84
|
-
# the given library.
|
85
|
-
#
|
86
|
-
def self.require gem_name_or_library
|
87
|
-
# prepare the correct version of the gem for loading
|
88
|
-
if respond_to? :gem
|
89
|
-
gem_name = gem_name_or_library.to_s.sub(%r{/.*$}, '')
|
90
|
-
if gem_version = RUNTIME[gem_name] || DEVTIME[gem_name]
|
91
|
-
begin
|
92
|
-
gem gem_name, *gem_version
|
93
|
-
rescue LoadError => error
|
94
|
-
warn "#{self.inspect}: #{error}"
|
95
|
-
end
|
96
|
-
end
|
97
|
-
end
|
98
|
-
|
99
|
-
# do the loading
|
100
|
-
super
|
101
|
-
end
|
57
|
+
GEMDEPS = {}
|
102
58
|
|
103
59
|
end
|
data/lib/ember/template.rb
CHANGED
@@ -161,7 +161,7 @@ module Ember
|
|
161
161
|
|
162
162
|
def resolve_path path, options = {}
|
163
163
|
unless Pathname.new(path).absolute?
|
164
|
-
if base = options[:source_file] and File.exist? base
|
164
|
+
if base = options[:source_file] and File.exist? base.to_s
|
165
165
|
# target is relative to the file in
|
166
166
|
# which the include directive exists
|
167
167
|
path = File.join(File.dirname(base), path)
|
data/man/man1/ember.1
ADDED
@@ -0,0 +1,1742 @@
|
|
1
|
+
'\" t
|
2
|
+
.\" Title: ember
|
3
|
+
.\" Author: [see the "AUTHORS" section]
|
4
|
+
.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
|
5
|
+
.\" Date: 2011-04-22
|
6
|
+
.\" Manual: \ \&
|
7
|
+
.\" Source: \ \& 0.3.1
|
8
|
+
.\" Language: English
|
9
|
+
.\"
|
10
|
+
.TH "EMBER" "1" "2011\-04\-22" "\ \& 0\&.3\&.1" "\ \&"
|
11
|
+
.\" -----------------------------------------------------------------
|
12
|
+
.\" * Define some portability stuff
|
13
|
+
.\" -----------------------------------------------------------------
|
14
|
+
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
15
|
+
.\" http://bugs.debian.org/507673
|
16
|
+
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
|
17
|
+
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
18
|
+
.ie \n(.g .ds Aq \(aq
|
19
|
+
.el .ds Aq '
|
20
|
+
.\" -----------------------------------------------------------------
|
21
|
+
.\" * set default formatting
|
22
|
+
.\" -----------------------------------------------------------------
|
23
|
+
.\" disable hyphenation
|
24
|
+
.nh
|
25
|
+
.\" disable justification (adjust text to left margin only)
|
26
|
+
.ad l
|
27
|
+
.\" -----------------------------------------------------------------
|
28
|
+
.\" * MAIN CONTENT STARTS HERE *
|
29
|
+
.\" -----------------------------------------------------------------
|
30
|
+
.SH "NAME"
|
31
|
+
ember \- eRuby template processor
|
32
|
+
.SH "SYNOPSIS"
|
33
|
+
.sp
|
34
|
+
\fBember\fR [\fIOPTIONS\fR] [\fIFILE\fR]
|
35
|
+
.SS "Command"
|
36
|
+
.sp
|
37
|
+
Evaluates eRuby directives (see [SYNTAX] below) in the given \fIFILE\fR and writes the result to the standard output stream\&. If \fIFILE\fR is not given, then the standard input stream is read and evaluated instead\&.
|
38
|
+
.SS "Options"
|
39
|
+
.PP
|
40
|
+
\fB\-s\fR, \fB\-\-shorthand\fR
|
41
|
+
.RS 4
|
42
|
+
Treat lines beginning with zero or more whitespace followed by the "%" character as eRuby directives\&.
|
43
|
+
.RE
|
44
|
+
.PP
|
45
|
+
\fB\-i\fR, \fB\-\-infer_end\fR
|
46
|
+
.RS 4
|
47
|
+
Add missing "<% end %>" directives based on indentation\&.
|
48
|
+
.RE
|
49
|
+
.PP
|
50
|
+
\fB\-u\fR, \fB\-\-unindent\fR
|
51
|
+
.RS 4
|
52
|
+
Unindent the bodies of directives that define a Ruby block (do \&... end) or scope (begin \&... end)\&.
|
53
|
+
.RE
|
54
|
+
.PP
|
55
|
+
\fB\-c\fR, \fB\-\-compile\fR
|
56
|
+
.RS 4
|
57
|
+
Print underlying Ruby program compiled from the input eRuby template and exit\&.
|
58
|
+
.RE
|
59
|
+
.PP
|
60
|
+
\fB\-h\fR, \fB\-\-help\fR
|
61
|
+
.RS 4
|
62
|
+
Display this manual and exit\&.
|
63
|
+
.RE
|
64
|
+
.PP
|
65
|
+
\fB\-v\fR, \fB\-\-version\fR
|
66
|
+
.RS 4
|
67
|
+
Print version number and exit\&.
|
68
|
+
.RE
|
69
|
+
.SH "DESCRIPTION"
|
70
|
+
.sp
|
71
|
+
Ember (\fBEMBE\fRdded \fBR\fRuby) is an [eRuby] template processor that allows debugging, reduces markup, and improves composability of eRuby templates\&.
|
72
|
+
.SS "Features"
|
73
|
+
.sp
|
74
|
+
.RS 4
|
75
|
+
.ie n \{\
|
76
|
+
\h'-04'\(bu\h'+03'\c
|
77
|
+
.\}
|
78
|
+
.el \{\
|
79
|
+
.sp -1
|
80
|
+
.IP \(bu 2.3
|
81
|
+
.\}
|
82
|
+
Reports correct line numbers in error message stack traces\&.
|
83
|
+
.RE
|
84
|
+
.sp
|
85
|
+
.RS 4
|
86
|
+
.ie n \{\
|
87
|
+
\h'-04'\(bu\h'+03'\c
|
88
|
+
.\}
|
89
|
+
.el \{\
|
90
|
+
.sp -1
|
91
|
+
.IP \(bu 2.3
|
92
|
+
.\}
|
93
|
+
Omits newlines trailing code\-only
|
94
|
+
<% \&.\&.\&. %>
|
95
|
+
directives\&.
|
96
|
+
.RE
|
97
|
+
.sp
|
98
|
+
.RS 4
|
99
|
+
.ie n \{\
|
100
|
+
\h'-04'\(bu\h'+03'\c
|
101
|
+
.\}
|
102
|
+
.el \{\
|
103
|
+
.sp -1
|
104
|
+
.IP \(bu 2.3
|
105
|
+
.\}
|
106
|
+
Can infer missing
|
107
|
+
<% end %>
|
108
|
+
directives based on indentation\&.
|
109
|
+
.RE
|
110
|
+
.sp
|
111
|
+
.RS 4
|
112
|
+
.ie n \{\
|
113
|
+
\h'-04'\(bu\h'+03'\c
|
114
|
+
.\}
|
115
|
+
.el \{\
|
116
|
+
.sp -1
|
117
|
+
.IP \(bu 2.3
|
118
|
+
.\}
|
119
|
+
Can unindent eRuby block bodies hierarchically\&.
|
120
|
+
.RE
|
121
|
+
.sp
|
122
|
+
.RS 4
|
123
|
+
.ie n \{\
|
124
|
+
\h'-04'\(bu\h'+03'\c
|
125
|
+
.\}
|
126
|
+
.el \{\
|
127
|
+
.sp -1
|
128
|
+
.IP \(bu 2.3
|
129
|
+
.\}
|
130
|
+
Implemented in 361 lines of pure Ruby\&.
|
131
|
+
.RE
|
132
|
+
.SS "Resources"
|
133
|
+
.PP
|
134
|
+
Project website
|
135
|
+
.RS 4
|
136
|
+
|
137
|
+
\m[blue]\fBhttp://snk\&.tuxfamily\&.org/lib/ember/\fR\m[]
|
138
|
+
.RE
|
139
|
+
.PP
|
140
|
+
Announcements feed
|
141
|
+
.RS 4
|
142
|
+
|
143
|
+
\m[blue]\fBhttp://snk\&.tuxfamily\&.org/lib/ember/ann\&.xml\fR\m[]
|
144
|
+
.RE
|
145
|
+
.PP
|
146
|
+
API documentation
|
147
|
+
.RS 4
|
148
|
+
|
149
|
+
\m[blue]\fBhttp://snk\&.tuxfamily\&.org/lib/ember/api/\fR\m[]
|
150
|
+
.RE
|
151
|
+
.PP
|
152
|
+
Source code (browse online, download, or checkout)
|
153
|
+
.RS 4
|
154
|
+
|
155
|
+
\m[blue]\fBhttp://github\&.com/sunaku/ember\fR\m[]
|
156
|
+
.RE
|
157
|
+
.PP
|
158
|
+
Issue tracker (report bugs, request features, get help)
|
159
|
+
.RS 4
|
160
|
+
|
161
|
+
\m[blue]\fBhttp://github\&.com/sunaku/ember/issues\fR\m[]
|
162
|
+
.RE
|
163
|
+
.SH "INSTALL"
|
164
|
+
.SS "Prerequisites"
|
165
|
+
.sp
|
166
|
+
.RS 4
|
167
|
+
.ie n \{\
|
168
|
+
\h'-04'\(bu\h'+03'\c
|
169
|
+
.\}
|
170
|
+
.el \{\
|
171
|
+
.sp -1
|
172
|
+
.IP \(bu 2.3
|
173
|
+
.\}
|
174
|
+
|
175
|
+
[Ruby]
|
176
|
+
1\&.8\&.6 or newer\&.
|
177
|
+
.RE
|
178
|
+
.sp
|
179
|
+
.RS 4
|
180
|
+
.ie n \{\
|
181
|
+
\h'-04'\(bu\h'+03'\c
|
182
|
+
.\}
|
183
|
+
.el \{\
|
184
|
+
.sp -1
|
185
|
+
.IP \(bu 2.3
|
186
|
+
.\}
|
187
|
+
|
188
|
+
[RubyGems]
|
189
|
+
1\&.3\&.6 or newer\&.
|
190
|
+
.RE
|
191
|
+
.SS "Installing"
|
192
|
+
.sp
|
193
|
+
Installing as a [Ruby] library:
|
194
|
+
.sp
|
195
|
+
.if n \{\
|
196
|
+
.RS 4
|
197
|
+
.\}
|
198
|
+
.nf
|
199
|
+
gem install ember
|
200
|
+
.fi
|
201
|
+
.if n \{\
|
202
|
+
.RE
|
203
|
+
.\}
|
204
|
+
.sp
|
205
|
+
Installing as a [Rails] plugin:
|
206
|
+
.sp
|
207
|
+
.if n \{\
|
208
|
+
.RS 4
|
209
|
+
.\}
|
210
|
+
.nf
|
211
|
+
script/plugin install git://github\&.com/sunaku/ember\&.git
|
212
|
+
.fi
|
213
|
+
.if n \{\
|
214
|
+
.RE
|
215
|
+
.\}
|
216
|
+
.SS "Upgrading"
|
217
|
+
.sp
|
218
|
+
.if n \{\
|
219
|
+
.RS 4
|
220
|
+
.\}
|
221
|
+
.nf
|
222
|
+
gem update ember
|
223
|
+
.fi
|
224
|
+
.if n \{\
|
225
|
+
.RE
|
226
|
+
.\}
|
227
|
+
.SS "Removing"
|
228
|
+
.sp
|
229
|
+
.if n \{\
|
230
|
+
.RS 4
|
231
|
+
.\}
|
232
|
+
.nf
|
233
|
+
gem uninstall ember
|
234
|
+
.fi
|
235
|
+
.if n \{\
|
236
|
+
.RE
|
237
|
+
.\}
|
238
|
+
.SH "SYNTAX"
|
239
|
+
.sp
|
240
|
+
This section explains [eRuby] template syntax and Ember extensions thereof\&.
|
241
|
+
.sp
|
242
|
+
eRuby templates are plain\-text documents that contain special processing instructions known as \fBdirectives\fR\&. These instructions are evaluated \fIin place\fR, meaning that they are replaced by the result of their evaluation\&.
|
243
|
+
.SS "Directives"
|
244
|
+
.sp
|
245
|
+
Directives are expressed in either \fBstandard\fR or \fBshorthand\fR notation:
|
246
|
+
.TS
|
247
|
+
allbox tab(:);
|
248
|
+
ltB ltB ltB ltB ltB ltB.
|
249
|
+
T{
|
250
|
+
Notation
|
251
|
+
T}:T{
|
252
|
+
Directive
|
253
|
+
T}:T{
|
254
|
+
Head
|
255
|
+
T}:T{
|
256
|
+
Operation
|
257
|
+
T}:T{
|
258
|
+
Body
|
259
|
+
T}:T{
|
260
|
+
Tail
|
261
|
+
T}
|
262
|
+
.T&
|
263
|
+
lt lt lt lt lt lt
|
264
|
+
lt lt lt lt lt lt.
|
265
|
+
T{
|
266
|
+
.sp
|
267
|
+
Standard
|
268
|
+
T}:T{
|
269
|
+
.sp
|
270
|
+
<%xy%>
|
271
|
+
T}:T{
|
272
|
+
.sp
|
273
|
+
<%
|
274
|
+
T}:T{
|
275
|
+
.sp
|
276
|
+
x
|
277
|
+
T}:T{
|
278
|
+
.sp
|
279
|
+
y
|
280
|
+
T}:T{
|
281
|
+
.sp
|
282
|
+
%>
|
283
|
+
T}
|
284
|
+
T{
|
285
|
+
.sp
|
286
|
+
Shorthand
|
287
|
+
T}:T{
|
288
|
+
.sp
|
289
|
+
%xy
|
290
|
+
T}:T{
|
291
|
+
.sp
|
292
|
+
%
|
293
|
+
T}:T{
|
294
|
+
.sp
|
295
|
+
x
|
296
|
+
T}:T{
|
297
|
+
.sp
|
298
|
+
y
|
299
|
+
T}:T{
|
300
|
+
.sp
|
301
|
+
T}
|
302
|
+
.TE
|
303
|
+
.sp 1
|
304
|
+
.sp
|
305
|
+
In standard notation, the directive is composed of a \fBhead\fR, an \fBoperation\fR, a \fBbody\fR, and a \fBtail\fR; and it may appear anywhere in the template\&.
|
306
|
+
.sp
|
307
|
+
In shorthand notation, the directive is composed of a \fBhead\fR, an \fBoperation\fR, and a \fBbody\fR; and it may only appear in the template if it occupies an entire line (leading whitespace is permitted only in Ember; trailing whitespace is permitted in both Ember and eRuby)\&.
|
308
|
+
.sp
|
309
|
+
Regardless of the notation used, directives are atomic constructs; they cannot be nested within one another\&.
|
310
|
+
.SS "Operations"
|
311
|
+
.sp
|
312
|
+
An \fBoperation\fR is the first character following the head of a directive\&. It specifies how the directive will be processed\&.
|
313
|
+
.sp
|
314
|
+
Ember supports the following operations, and here is what they do:
|
315
|
+
.TS
|
316
|
+
tab(:);
|
317
|
+
lt lt
|
318
|
+
lt lt
|
319
|
+
lt lt
|
320
|
+
lt lt
|
321
|
+
lt lt
|
322
|
+
lt lt
|
323
|
+
lt lt
|
324
|
+
lt lt.
|
325
|
+
T{
|
326
|
+
.sp
|
327
|
+
%
|
328
|
+
T}:T{
|
329
|
+
.sp
|
330
|
+
One "%" character is omitted from the head of the directive and the entire directive is inserted into the output\&.
|
331
|
+
T}
|
332
|
+
T{
|
333
|
+
.sp
|
334
|
+
#
|
335
|
+
T}:T{
|
336
|
+
.sp
|
337
|
+
The entire directive is omitted from the output\&.
|
338
|
+
T}
|
339
|
+
T{
|
340
|
+
.sp
|
341
|
+
=
|
342
|
+
T}:T{
|
343
|
+
.sp
|
344
|
+
The body of the directive is evaluated as Ruby code, and the result of this evaluation is inserted into the output\&.
|
345
|
+
T}
|
346
|
+
T{
|
347
|
+
.sp
|
348
|
+
~
|
349
|
+
T}:T{
|
350
|
+
.sp
|
351
|
+
(only in Ember) The body of the directive is evaluated as an eRuby template, and the result of this evaluation is inserted into the output\&.
|
352
|
+
T}
|
353
|
+
T{
|
354
|
+
.sp
|
355
|
+
+
|
356
|
+
T}:T{
|
357
|
+
.sp
|
358
|
+
(only in Ember) The body of the directive is evaluated as Ruby code, and the result of this evaluation is assumed to be a string that specifies the path (either absolute or relative to the eRuby template file in which this directive is found) to a file containing an eRuby template\&. This file is read and its contents are evaluated as an eRuby template, and the result of this evaluation is inserted into the output\&.
|
359
|
+
T}
|
360
|
+
T{
|
361
|
+
.sp
|
362
|
+
<
|
363
|
+
T}:T{
|
364
|
+
.sp
|
365
|
+
(only in Ember) The body of the directive is evaluated as Ruby code, and the result of this evaluation is assumed to be a string that specifies the path (either absolute or relative to the eRuby template file in which this directive is found) to a file\&. This file is read and its contents are inserted into the output\&.
|
366
|
+
T}
|
367
|
+
T{
|
368
|
+
.sp
|
369
|
+
|
|
370
|
+
T}:T{
|
371
|
+
.sp
|
372
|
+
(only in Ember) The body of the directive is treated as the beginning of a Ruby block\&. The \fBdo\fR keyword is automatically appended to the body of the directive if missing\&.
|
373
|
+
T}
|
374
|
+
T{
|
375
|
+
.sp
|
376
|
+
None of the above
|
377
|
+
T}:T{
|
378
|
+
.sp
|
379
|
+
The body of the directive is evaluated as Ruby code, but the result of this evaluation \fIis not\fR inserted into the output\&.
|
380
|
+
T}
|
381
|
+
.TE
|
382
|
+
.sp 1
|
383
|
+
.SH "USAGE"
|
384
|
+
.sp
|
385
|
+
Begin by loading the Ember library into your program:
|
386
|
+
.sp
|
387
|
+
.if n \{\
|
388
|
+
.RS 4
|
389
|
+
.\}
|
390
|
+
.nf
|
391
|
+
require \*(Aqrubygems\*(Aq # might not be necessary; see HACKING
|
392
|
+
require \*(Aqember\*(Aq
|
393
|
+
.fi
|
394
|
+
.if n \{\
|
395
|
+
.RE
|
396
|
+
.\}
|
397
|
+
.sp
|
398
|
+
Instantiate an Ember template processor:
|
399
|
+
.sp
|
400
|
+
.if n \{\
|
401
|
+
.RS 4
|
402
|
+
.\}
|
403
|
+
.nf
|
404
|
+
source = "your eRuby template here"
|
405
|
+
options = {} # see API documentation
|
406
|
+
template = Ember::Template\&.new(source, options)
|
407
|
+
.fi
|
408
|
+
.if n \{\
|
409
|
+
.RE
|
410
|
+
.\}
|
411
|
+
.sp
|
412
|
+
Inspect the Ruby program that was compiled (and is used) by the Ember template processor to evaluate the eRuby template given as input:
|
413
|
+
.sp
|
414
|
+
.if n \{\
|
415
|
+
.RS 4
|
416
|
+
.\}
|
417
|
+
.nf
|
418
|
+
puts template\&.program
|
419
|
+
.fi
|
420
|
+
.if n \{\
|
421
|
+
.RE
|
422
|
+
.\}
|
423
|
+
.sp
|
424
|
+
View the result of evaluating the eRuby template:
|
425
|
+
.sp
|
426
|
+
.if n \{\
|
427
|
+
.RS 4
|
428
|
+
.\}
|
429
|
+
.nf
|
430
|
+
puts template\&.render
|
431
|
+
.fi
|
432
|
+
.if n \{\
|
433
|
+
.RE
|
434
|
+
.\}
|
435
|
+
.sp
|
436
|
+
See the \m[blue]\fBAPI documentation\fR\m[] for more information\&.
|
437
|
+
.SS "An empty template"
|
438
|
+
.sp
|
439
|
+
.if n \{\
|
440
|
+
.RS 4
|
441
|
+
.\}
|
442
|
+
.nf
|
443
|
+
.fi
|
444
|
+
.if n \{\
|
445
|
+
.RE
|
446
|
+
.\}
|
447
|
+
.sp
|
448
|
+
The above template compiles into the following Ruby program:
|
449
|
+
.sp
|
450
|
+
.if n \{\
|
451
|
+
.RS 4
|
452
|
+
.\}
|
453
|
+
.nf
|
454
|
+
(e08afdfb_62c7_485f_87a0_80914e1b4703 = :_erbout; _erbout = []; ; _erbout\&.join)
|
455
|
+
.fi
|
456
|
+
.if n \{\
|
457
|
+
.RE
|
458
|
+
.\}
|
459
|
+
.sp
|
460
|
+
Which then produces the following output when rendered:
|
461
|
+
.sp
|
462
|
+
.if n \{\
|
463
|
+
.RS 4
|
464
|
+
.\}
|
465
|
+
.nf
|
466
|
+
.fi
|
467
|
+
.if n \{\
|
468
|
+
.RE
|
469
|
+
.\}
|
470
|
+
.SS "Comment directives"
|
471
|
+
.sp
|
472
|
+
.if n \{\
|
473
|
+
.RS 4
|
474
|
+
.\}
|
475
|
+
.nf
|
476
|
+
<%# this is a comment %>
|
477
|
+
%# this is also a comment
|
478
|
+
<%# this
|
479
|
+
is
|
480
|
+
a
|
481
|
+
multi\-line comment %>
|
482
|
+
.fi
|
483
|
+
.if n \{\
|
484
|
+
.RE
|
485
|
+
.\}
|
486
|
+
.sp
|
487
|
+
With {:shorthand=>true} options, the above template compiles into the following Ruby program:
|
488
|
+
.sp
|
489
|
+
.if n \{\
|
490
|
+
.RS 4
|
491
|
+
.\}
|
492
|
+
.nf
|
493
|
+
(e08afdfb_62c7_485f_87a0_80914e1b4703 = :_erbout; _erbout = []; _erbout << "\en"
|
494
|
+
_erbout << "\en"
|
495
|
+
|
496
|
+
|
497
|
+
|
498
|
+
|
499
|
+
; _erbout\&.join)
|
500
|
+
.fi
|
501
|
+
.if n \{\
|
502
|
+
.RE
|
503
|
+
.\}
|
504
|
+
.sp
|
505
|
+
Which then produces the following output when rendered:
|
506
|
+
.sp
|
507
|
+
.if n \{\
|
508
|
+
.RS 4
|
509
|
+
.\}
|
510
|
+
.nf
|
511
|
+
.fi
|
512
|
+
.if n \{\
|
513
|
+
.RE
|
514
|
+
.\}
|
515
|
+
.SS "Escaped directives"
|
516
|
+
.sp
|
517
|
+
.if n \{\
|
518
|
+
.RS 4
|
519
|
+
.\}
|
520
|
+
.nf
|
521
|
+
<%% this is an escaped directive %>
|
522
|
+
%% this is an escaped directive
|
523
|
+
.fi
|
524
|
+
.if n \{\
|
525
|
+
.RE
|
526
|
+
.\}
|
527
|
+
.sp
|
528
|
+
With {:shorthand=>true} options, the above template compiles into the following Ruby program:
|
529
|
+
.sp
|
530
|
+
.if n \{\
|
531
|
+
.RS 4
|
532
|
+
.\}
|
533
|
+
.nf
|
534
|
+
(e08afdfb_62c7_485f_87a0_80914e1b4703 = :_erbout; _erbout = []; _erbout << "<% this is an escaped directive %>\en"
|
535
|
+
_erbout << "% this is an escaped directive\en"
|
536
|
+
; _erbout\&.join)
|
537
|
+
.fi
|
538
|
+
.if n \{\
|
539
|
+
.RE
|
540
|
+
.\}
|
541
|
+
.sp
|
542
|
+
Which then produces the following output when rendered:
|
543
|
+
.sp
|
544
|
+
.if n \{\
|
545
|
+
.RS 4
|
546
|
+
.\}
|
547
|
+
.nf
|
548
|
+
<% this is an escaped directive %>
|
549
|
+
% this is an escaped directive
|
550
|
+
.fi
|
551
|
+
.if n \{\
|
552
|
+
.RE
|
553
|
+
.\}
|
554
|
+
.SS "Vocal directives"
|
555
|
+
.sp
|
556
|
+
.if n \{\
|
557
|
+
.RS 4
|
558
|
+
.\}
|
559
|
+
.nf
|
560
|
+
<%= "hello" %>
|
561
|
+
%= "world"
|
562
|
+
.fi
|
563
|
+
.if n \{\
|
564
|
+
.RE
|
565
|
+
.\}
|
566
|
+
.sp
|
567
|
+
With {:shorthand=>true} options, the above template compiles into the following Ruby program:
|
568
|
+
.sp
|
569
|
+
.if n \{\
|
570
|
+
.RS 4
|
571
|
+
.\}
|
572
|
+
.nf
|
573
|
+
(e08afdfb_62c7_485f_87a0_80914e1b4703 = :_erbout; _erbout = []; _erbout << ("hello") << "\en"
|
574
|
+
_erbout << ("world") << "\en"
|
575
|
+
; _erbout\&.join)
|
576
|
+
.fi
|
577
|
+
.if n \{\
|
578
|
+
.RE
|
579
|
+
.\}
|
580
|
+
.sp
|
581
|
+
Which then produces the following output when rendered:
|
582
|
+
.sp
|
583
|
+
.if n \{\
|
584
|
+
.RS 4
|
585
|
+
.\}
|
586
|
+
.nf
|
587
|
+
hello
|
588
|
+
world
|
589
|
+
.fi
|
590
|
+
.if n \{\
|
591
|
+
.RE
|
592
|
+
.\}
|
593
|
+
.SS "Silent directives"
|
594
|
+
.sp
|
595
|
+
.if n \{\
|
596
|
+
.RS 4
|
597
|
+
.\}
|
598
|
+
.nf
|
599
|
+
<% a = "hello" %>
|
600
|
+
% b = "world"
|
601
|
+
|
602
|
+
<%= a %>
|
603
|
+
%= b
|
604
|
+
.fi
|
605
|
+
.if n \{\
|
606
|
+
.RE
|
607
|
+
.\}
|
608
|
+
.sp
|
609
|
+
With {:shorthand=>true} options, the above template compiles into the following Ruby program:
|
610
|
+
.sp
|
611
|
+
.if n \{\
|
612
|
+
.RS 4
|
613
|
+
.\}
|
614
|
+
.nf
|
615
|
+
(e08afdfb_62c7_485f_87a0_80914e1b4703 = :_erbout; _erbout = []; a = "hello"
|
616
|
+
b = "world"
|
617
|
+
_erbout << "\en"
|
618
|
+
_erbout << (a) << "\en"
|
619
|
+
_erbout << (b) << "\en"
|
620
|
+
; _erbout\&.join)
|
621
|
+
.fi
|
622
|
+
.if n \{\
|
623
|
+
.RE
|
624
|
+
.\}
|
625
|
+
.sp
|
626
|
+
Which then produces the following output when rendered:
|
627
|
+
.sp
|
628
|
+
.if n \{\
|
629
|
+
.RS 4
|
630
|
+
.\}
|
631
|
+
.nf
|
632
|
+
hello
|
633
|
+
world
|
634
|
+
.fi
|
635
|
+
.if n \{\
|
636
|
+
.RE
|
637
|
+
.\}
|
638
|
+
.SS "Block directives"
|
639
|
+
.sp
|
640
|
+
.if n \{\
|
641
|
+
.RS 4
|
642
|
+
.\}
|
643
|
+
.nf
|
644
|
+
% words = %w[hello world]
|
645
|
+
|
646
|
+
<% words\&.each do |w| %>
|
647
|
+
<%= w %>
|
648
|
+
<% end %>
|
649
|
+
|
650
|
+
% words\&.each do |w|
|
651
|
+
%= w
|
652
|
+
% end
|
653
|
+
|
654
|
+
%|words\&.each |w|
|
655
|
+
%= w
|
656
|
+
% end
|
657
|
+
.fi
|
658
|
+
.if n \{\
|
659
|
+
.RE
|
660
|
+
.\}
|
661
|
+
.sp
|
662
|
+
With {:shorthand=>true} options, the above template compiles into the following Ruby program:
|
663
|
+
.sp
|
664
|
+
.if n \{\
|
665
|
+
.RS 4
|
666
|
+
.\}
|
667
|
+
.nf
|
668
|
+
(e08afdfb_62c7_485f_87a0_80914e1b4703 = :_erbout; _erbout = []; words = %w[hello world]
|
669
|
+
_erbout << "\en"
|
670
|
+
words\&.each do |w|
|
671
|
+
_erbout << " " << (w) << "\en"
|
672
|
+
end
|
673
|
+
_erbout << "\en"
|
674
|
+
words\&.each do |w|
|
675
|
+
_erbout << " " << (w) << "\en"
|
676
|
+
end
|
677
|
+
_erbout << "\en"
|
678
|
+
words\&.each do |w|
|
679
|
+
_erbout << " " << (w) << "\en"
|
680
|
+
end
|
681
|
+
; _erbout\&.join)
|
682
|
+
.fi
|
683
|
+
.if n \{\
|
684
|
+
.RE
|
685
|
+
.\}
|
686
|
+
.sp
|
687
|
+
Which then produces the following output when rendered:
|
688
|
+
.sp
|
689
|
+
.if n \{\
|
690
|
+
.RS 4
|
691
|
+
.\}
|
692
|
+
.nf
|
693
|
+
hello
|
694
|
+
world
|
695
|
+
|
696
|
+
hello
|
697
|
+
world
|
698
|
+
|
699
|
+
hello
|
700
|
+
world
|
701
|
+
.fi
|
702
|
+
.if n \{\
|
703
|
+
.RE
|
704
|
+
.\}
|
705
|
+
.SS "Unindent block content"
|
706
|
+
.sp
|
707
|
+
.if n \{\
|
708
|
+
.RS 4
|
709
|
+
.\}
|
710
|
+
.nf
|
711
|
+
<% [1]\&.each do |i| %>
|
712
|
+
<%= i %>
|
713
|
+
% [2]\&.each do |j|
|
714
|
+
%= j
|
715
|
+
%|[3]\&.each |k|
|
716
|
+
%= k
|
717
|
+
% end
|
718
|
+
% end
|
719
|
+
<% end %>
|
720
|
+
.fi
|
721
|
+
.if n \{\
|
722
|
+
.RE
|
723
|
+
.\}
|
724
|
+
.sp
|
725
|
+
With {:shorthand=>true, :unindent=>true} options, the above template compiles into the following Ruby program:
|
726
|
+
.sp
|
727
|
+
.if n \{\
|
728
|
+
.RS 4
|
729
|
+
.\}
|
730
|
+
.nf
|
731
|
+
(e08afdfb_62c7_485f_87a0_80914e1b4703 = :_erbout; _erbout = []; [1]\&.each do |i|
|
732
|
+
_erbout << (i) << "\en"
|
733
|
+
[2]\&.each do |j|
|
734
|
+
_erbout << (j) << "\en"
|
735
|
+
[3]\&.each do |k|
|
736
|
+
_erbout << (k) << "\en"
|
737
|
+
end
|
738
|
+
end
|
739
|
+
end
|
740
|
+
; _erbout\&.join)
|
741
|
+
.fi
|
742
|
+
.if n \{\
|
743
|
+
.RE
|
744
|
+
.\}
|
745
|
+
.sp
|
746
|
+
Which then produces the following output when rendered:
|
747
|
+
.sp
|
748
|
+
.if n \{\
|
749
|
+
.RS 4
|
750
|
+
.\}
|
751
|
+
.nf
|
752
|
+
1
|
753
|
+
2
|
754
|
+
3
|
755
|
+
.fi
|
756
|
+
.if n \{\
|
757
|
+
.RE
|
758
|
+
.\}
|
759
|
+
.SS "Wrap block content"
|
760
|
+
.sp
|
761
|
+
.if n \{\
|
762
|
+
.RS 4
|
763
|
+
.\}
|
764
|
+
.nf
|
765
|
+
<%
|
766
|
+
def introducing(subject, &block)
|
767
|
+
Ember::Template\&.wrap_content_block(block, rand(10)) do |content|
|
768
|
+
"And now I would like to introduce #{subject}:\en\en#{content\&.join}"
|
769
|
+
end
|
770
|
+
end
|
771
|
+
|
772
|
+
def coin_toss(pronoun, &block)
|
773
|
+
Ember::Template\&.wrap_content_block(block) do |content|
|
774
|
+
"#{pronoun} favorite side of a coin toss is #{content\&.join}\&."
|
775
|
+
end
|
776
|
+
end
|
777
|
+
%>
|
778
|
+
|
779
|
+
% introducing "Matz" do |number|
|
780
|
+
Father of the Ruby programming language,
|
781
|
+
and also a jolly and well mannered fellow\&.
|
782
|
+
|
783
|
+
% coin_toss("His") { number % 2 == 0 ? "heads" : "tails" }
|
784
|
+
% end
|
785
|
+
.fi
|
786
|
+
.if n \{\
|
787
|
+
.RE
|
788
|
+
.\}
|
789
|
+
.sp
|
790
|
+
With {:shorthand=>true, :unindent=>true} options, the above template compiles into the following Ruby program:
|
791
|
+
.sp
|
792
|
+
.if n \{\
|
793
|
+
.RS 4
|
794
|
+
.\}
|
795
|
+
.nf
|
796
|
+
(e08afdfb_62c7_485f_87a0_80914e1b4703 = :_erbout; _erbout = [];
|
797
|
+
def introducing(subject, &block)
|
798
|
+
Ember::Template\&.wrap_content_block(block, rand(10)) do |content|
|
799
|
+
"And now I would like to introduce #{subject}:\en\en#{content\&.join}"
|
800
|
+
end
|
801
|
+
end
|
802
|
+
|
803
|
+
def coin_toss(pronoun, &block)
|
804
|
+
Ember::Template\&.wrap_content_block(block) do |content|
|
805
|
+
"#{pronoun} favorite side of a coin toss is #{content\&.join}\&."
|
806
|
+
end
|
807
|
+
end
|
808
|
+
|
809
|
+
_erbout << "\en"
|
810
|
+
introducing "Matz" do |number|
|
811
|
+
_erbout << "Father of the Ruby programming language,\en"
|
812
|
+
_erbout << "and also a jolly and well mannered fellow\&.\en"
|
813
|
+
_erbout << "\en"
|
814
|
+
coin_toss("His") { number % 2 == 0 ? "heads" : "tails" }
|
815
|
+
end
|
816
|
+
; _erbout\&.join)
|
817
|
+
.fi
|
818
|
+
.if n \{\
|
819
|
+
.RE
|
820
|
+
.\}
|
821
|
+
.sp
|
822
|
+
Which then produces the following output when rendered:
|
823
|
+
.sp
|
824
|
+
.if n \{\
|
825
|
+
.RS 4
|
826
|
+
.\}
|
827
|
+
.nf
|
828
|
+
And now I would like to introduce Matz:
|
829
|
+
|
830
|
+
Father of the Ruby programming language,
|
831
|
+
and also a jolly and well mannered fellow\&.
|
832
|
+
|
833
|
+
His favorite side of a coin toss is heads\&.
|
834
|
+
.fi
|
835
|
+
.if n \{\
|
836
|
+
.RE
|
837
|
+
.\}
|
838
|
+
.SS "Capture block content"
|
839
|
+
.sp
|
840
|
+
.if n \{\
|
841
|
+
.RS 4
|
842
|
+
.\}
|
843
|
+
.nf
|
844
|
+
<%
|
845
|
+
def introducing(subject, &block)
|
846
|
+
content = Ember::Template\&.content_from_block(block, rand(2))
|
847
|
+
|
848
|
+
buffer = Ember::Template\&.buffer_from_block(block)
|
849
|
+
buffer << "introducing(#{subject\&.inspect}):\en\en#{content\&.join}"
|
850
|
+
end
|
851
|
+
|
852
|
+
def coin_toss(pronoun, &block)
|
853
|
+
content = Ember::Template\&.content_from_block(block)
|
854
|
+
|
855
|
+
buffer = Ember::Template\&.buffer_from_block(block)
|
856
|
+
buffer << "coin_toss(#{pronoun\&.inspect}): #{content\&.join}"
|
857
|
+
end
|
858
|
+
%>
|
859
|
+
|
860
|
+
% introducing "Matz" do |number|
|
861
|
+
Father of the Ruby programming language,
|
862
|
+
and also a jolly and well mannered fellow\&.
|
863
|
+
|
864
|
+
% coin_toss("His") { number % 2 == 0 ? "heads" : "tails" }
|
865
|
+
% end
|
866
|
+
.fi
|
867
|
+
.if n \{\
|
868
|
+
.RE
|
869
|
+
.\}
|
870
|
+
.sp
|
871
|
+
With {:shorthand=>true, :unindent=>true} options, the above template compiles into the following Ruby program:
|
872
|
+
.sp
|
873
|
+
.if n \{\
|
874
|
+
.RS 4
|
875
|
+
.\}
|
876
|
+
.nf
|
877
|
+
(e08afdfb_62c7_485f_87a0_80914e1b4703 = :_erbout; _erbout = [];
|
878
|
+
def introducing(subject, &block)
|
879
|
+
content = Ember::Template\&.content_from_block(block, rand(2))
|
880
|
+
|
881
|
+
buffer = Ember::Template\&.buffer_from_block(block)
|
882
|
+
buffer << "introducing(#{subject\&.inspect}):\en\en#{content\&.join}"
|
883
|
+
end
|
884
|
+
|
885
|
+
def coin_toss(pronoun, &block)
|
886
|
+
content = Ember::Template\&.content_from_block(block)
|
887
|
+
|
888
|
+
buffer = Ember::Template\&.buffer_from_block(block)
|
889
|
+
buffer << "coin_toss(#{pronoun\&.inspect}): #{content\&.join}"
|
890
|
+
end
|
891
|
+
|
892
|
+
_erbout << "\en"
|
893
|
+
introducing "Matz" do |number|
|
894
|
+
_erbout << "Father of the Ruby programming language,\en"
|
895
|
+
_erbout << "and also a jolly and well mannered fellow\&.\en"
|
896
|
+
_erbout << "\en"
|
897
|
+
coin_toss("His") { number % 2 == 0 ? "heads" : "tails" }
|
898
|
+
end
|
899
|
+
; _erbout\&.join)
|
900
|
+
.fi
|
901
|
+
.if n \{\
|
902
|
+
.RE
|
903
|
+
.\}
|
904
|
+
.sp
|
905
|
+
Which then produces the following output when rendered:
|
906
|
+
.sp
|
907
|
+
.if n \{\
|
908
|
+
.RS 4
|
909
|
+
.\}
|
910
|
+
.nf
|
911
|
+
introducing("Matz"):
|
912
|
+
|
913
|
+
Father of the Ruby programming language,
|
914
|
+
and also a jolly and well mannered fellow\&.
|
915
|
+
|
916
|
+
coin_toss("His"): heads
|
917
|
+
.fi
|
918
|
+
.if n \{\
|
919
|
+
.RE
|
920
|
+
.\}
|
921
|
+
.SS "Template evaluation result buffer"
|
922
|
+
.sp
|
923
|
+
.if n \{\
|
924
|
+
.RS 4
|
925
|
+
.\}
|
926
|
+
.nf
|
927
|
+
<%
|
928
|
+
def introducing(subject, &block)
|
929
|
+
buffer = Ember::Template\&.buffer_from_block(block)
|
930
|
+
#
|
931
|
+
# you can do whatever you want with buffer,
|
932
|
+
# now that you have a reference to it! >:\-)
|
933
|
+
#
|
934
|
+
buffer << "introducing(#{subject\&.inspect})"
|
935
|
+
end
|
936
|
+
%>
|
937
|
+
|
938
|
+
% introducing "Matz" do |number|
|
939
|
+
Father of the Ruby programming language,
|
940
|
+
and also a jolly and well mannered fellow\&.
|
941
|
+
% end
|
942
|
+
.fi
|
943
|
+
.if n \{\
|
944
|
+
.RE
|
945
|
+
.\}
|
946
|
+
.sp
|
947
|
+
With {:shorthand=>true, :unindent=>true} options, the above template compiles into the following Ruby program:
|
948
|
+
.sp
|
949
|
+
.if n \{\
|
950
|
+
.RS 4
|
951
|
+
.\}
|
952
|
+
.nf
|
953
|
+
(e08afdfb_62c7_485f_87a0_80914e1b4703 = :_erbout; _erbout = [];
|
954
|
+
def introducing(subject, &block)
|
955
|
+
buffer = Ember::Template\&.buffer_from_block(block)
|
956
|
+
#
|
957
|
+
# you can do whatever you want with buffer,
|
958
|
+
# now that you have a reference to it! >:\-)
|
959
|
+
#
|
960
|
+
buffer << "introducing(#{subject\&.inspect})"
|
961
|
+
end
|
962
|
+
|
963
|
+
_erbout << "\en"
|
964
|
+
introducing "Matz" do |number|
|
965
|
+
_erbout << "Father of the Ruby programming language,\en"
|
966
|
+
_erbout << "and also a jolly and well mannered fellow\&.\en"
|
967
|
+
end
|
968
|
+
; _erbout\&.join)
|
969
|
+
.fi
|
970
|
+
.if n \{\
|
971
|
+
.RE
|
972
|
+
.\}
|
973
|
+
.sp
|
974
|
+
Which then produces the following output when rendered:
|
975
|
+
.sp
|
976
|
+
.if n \{\
|
977
|
+
.RS 4
|
978
|
+
.\}
|
979
|
+
.nf
|
980
|
+
introducing("Matz")
|
981
|
+
.fi
|
982
|
+
.if n \{\
|
983
|
+
.RE
|
984
|
+
.\}
|
985
|
+
.SS "Infer block endings"
|
986
|
+
.sp
|
987
|
+
Omit <% end %> directives from the template:
|
988
|
+
.sp
|
989
|
+
.if n \{\
|
990
|
+
.RS 4
|
991
|
+
.\}
|
992
|
+
.nf
|
993
|
+
% words = %w[hello world]
|
994
|
+
|
995
|
+
<% words\&.each do |w| %>
|
996
|
+
<%= w %>
|
997
|
+
|
998
|
+
% words\&.each do |w|
|
999
|
+
%= w
|
1000
|
+
|
1001
|
+
%|words\&.each |w|
|
1002
|
+
%= w
|
1003
|
+
.fi
|
1004
|
+
.if n \{\
|
1005
|
+
.RE
|
1006
|
+
.\}
|
1007
|
+
.sp
|
1008
|
+
With {:shorthand=>true, :infer_end=>true} options, the above template compiles into the following Ruby program:
|
1009
|
+
.sp
|
1010
|
+
.if n \{\
|
1011
|
+
.RS 4
|
1012
|
+
.\}
|
1013
|
+
.nf
|
1014
|
+
(e08afdfb_62c7_485f_87a0_80914e1b4703 = :_erbout; _erbout = []; words = %w[hello world]
|
1015
|
+
_erbout << "\en"
|
1016
|
+
words\&.each do |w|
|
1017
|
+
_erbout << " " << (w) << "\en"
|
1018
|
+
end; _erbout << "\en"
|
1019
|
+
words\&.each do |w|
|
1020
|
+
_erbout << " " << (w) << "\en"
|
1021
|
+
end; _erbout << "\en"
|
1022
|
+
words\&.each do |w|
|
1023
|
+
_erbout << " " << (w) << "\en"
|
1024
|
+
end; _erbout\&.join)
|
1025
|
+
.fi
|
1026
|
+
.if n \{\
|
1027
|
+
.RE
|
1028
|
+
.\}
|
1029
|
+
.sp
|
1030
|
+
Which then produces the following output when rendered:
|
1031
|
+
.sp
|
1032
|
+
.if n \{\
|
1033
|
+
.RS 4
|
1034
|
+
.\}
|
1035
|
+
.nf
|
1036
|
+
hello
|
1037
|
+
world
|
1038
|
+
|
1039
|
+
hello
|
1040
|
+
world
|
1041
|
+
|
1042
|
+
hello
|
1043
|
+
world
|
1044
|
+
.fi
|
1045
|
+
.if n \{\
|
1046
|
+
.RE
|
1047
|
+
.\}
|
1048
|
+
.SS "Raw file inclusion"
|
1049
|
+
.sp
|
1050
|
+
When doc/example\&.txt contains:
|
1051
|
+
.sp
|
1052
|
+
.if n \{\
|
1053
|
+
.RS 4
|
1054
|
+
.\}
|
1055
|
+
.nf
|
1056
|
+
This is a plain\-text file\&. Notice that <%=
|
1057
|
+
"eRuby directives" %> have no effect here!
|
1058
|
+
.fi
|
1059
|
+
.if n \{\
|
1060
|
+
.RE
|
1061
|
+
.\}
|
1062
|
+
.sp
|
1063
|
+
And the eRuby template is:
|
1064
|
+
.sp
|
1065
|
+
.if n \{\
|
1066
|
+
.RS 4
|
1067
|
+
.\}
|
1068
|
+
.nf
|
1069
|
+
<%< "doc/example\&.txt" %>
|
1070
|
+
|
1071
|
+
%< "doc/example\&.txt"
|
1072
|
+
.fi
|
1073
|
+
.if n \{\
|
1074
|
+
.RE
|
1075
|
+
.\}
|
1076
|
+
.sp
|
1077
|
+
With {:shorthand=>true, :source_file=>"\&./USAGE"} options, the above template compiles into the following Ruby program:
|
1078
|
+
.sp
|
1079
|
+
.if n \{\
|
1080
|
+
.RS 4
|
1081
|
+
.\}
|
1082
|
+
.nf
|
1083
|
+
(e08afdfb_62c7_485f_87a0_80914e1b4703 = :_erbout; _erbout = []; _erbout << (::Ember::Template\&.read_file(("doc/example\&.txt"), {:shorthand=>true, :source_file=>"\&./USAGE"})) << "\en"
|
1084
|
+
_erbout << "\en"
|
1085
|
+
_erbout << (::Ember::Template\&.read_file(("doc/example\&.txt"), {:shorthand=>true, :source_file=>"\&./USAGE"})) << "\en"
|
1086
|
+
; _erbout\&.join)
|
1087
|
+
.fi
|
1088
|
+
.if n \{\
|
1089
|
+
.RE
|
1090
|
+
.\}
|
1091
|
+
.sp
|
1092
|
+
Which then produces the following output when rendered:
|
1093
|
+
.sp
|
1094
|
+
.if n \{\
|
1095
|
+
.RS 4
|
1096
|
+
.\}
|
1097
|
+
.nf
|
1098
|
+
This is a plain\-text file\&. Notice that <%=
|
1099
|
+
"eRuby directives" %> have no effect here!
|
1100
|
+
|
1101
|
+
This is a plain\-text file\&. Notice that <%=
|
1102
|
+
"eRuby directives" %> have no effect here!
|
1103
|
+
.fi
|
1104
|
+
.if n \{\
|
1105
|
+
.RE
|
1106
|
+
.\}
|
1107
|
+
.SS "Template file inclusion"
|
1108
|
+
.sp
|
1109
|
+
When doc/example\&.erb contains:
|
1110
|
+
.sp
|
1111
|
+
.if n \{\
|
1112
|
+
.RS 4
|
1113
|
+
.\}
|
1114
|
+
.nf
|
1115
|
+
This is an eRuby template\&. Notice that <%=
|
1116
|
+
"eRuby directives" %> do take effect here!
|
1117
|
+
.fi
|
1118
|
+
.if n \{\
|
1119
|
+
.RE
|
1120
|
+
.\}
|
1121
|
+
.sp
|
1122
|
+
And the eRuby template is:
|
1123
|
+
.sp
|
1124
|
+
.if n \{\
|
1125
|
+
.RS 4
|
1126
|
+
.\}
|
1127
|
+
.nf
|
1128
|
+
<%+ "doc/example\&.erb" %>
|
1129
|
+
|
1130
|
+
%+ "doc/example\&.erb"
|
1131
|
+
.fi
|
1132
|
+
.if n \{\
|
1133
|
+
.RE
|
1134
|
+
.\}
|
1135
|
+
.sp
|
1136
|
+
With {:shorthand=>true, :source_file=>"\&./USAGE"} options, the above template compiles into the following Ruby program:
|
1137
|
+
.sp
|
1138
|
+
.if n \{\
|
1139
|
+
.RS 4
|
1140
|
+
.\}
|
1141
|
+
.nf
|
1142
|
+
(e08afdfb_62c7_485f_87a0_80914e1b4703 = :_erbout; _erbout = []; ::Ember::Template\&.load_file(("doc/example\&.erb"), {:shorthand=>true, :source_file=>"\&./USAGE"}\&.merge!(:continue_result => true))\&.render(::Kernel\&.binding); _erbout << "\en"
|
1143
|
+
_erbout << "\en"
|
1144
|
+
::Ember::Template\&.load_file(("doc/example\&.erb"), {:shorthand=>true, :source_file=>"\&./USAGE"}\&.merge!(:continue_result => true))\&.render(::Kernel\&.binding); _erbout << "\en"
|
1145
|
+
; _erbout\&.join)
|
1146
|
+
.fi
|
1147
|
+
.if n \{\
|
1148
|
+
.RE
|
1149
|
+
.\}
|
1150
|
+
.sp
|
1151
|
+
Which then produces the following output when rendered:
|
1152
|
+
.sp
|
1153
|
+
.if n \{\
|
1154
|
+
.RS 4
|
1155
|
+
.\}
|
1156
|
+
.nf
|
1157
|
+
This is an eRuby template\&. Notice that eRuby directives do take effect here!
|
1158
|
+
|
1159
|
+
This is an eRuby template\&. Notice that eRuby directives do take effect here!
|
1160
|
+
.fi
|
1161
|
+
.if n \{\
|
1162
|
+
.RE
|
1163
|
+
.\}
|
1164
|
+
.SS "Dynamic template evaluation"
|
1165
|
+
.sp
|
1166
|
+
.if n \{\
|
1167
|
+
.RS 4
|
1168
|
+
.\}
|
1169
|
+
.nf
|
1170
|
+
<%~ "%= 2 + 2" %>
|
1171
|
+
|
1172
|
+
%~ "%= 2 + 2"
|
1173
|
+
.fi
|
1174
|
+
.if n \{\
|
1175
|
+
.RE
|
1176
|
+
.\}
|
1177
|
+
.sp
|
1178
|
+
With {:shorthand=>true} options, the above template compiles into the following Ruby program:
|
1179
|
+
.sp
|
1180
|
+
.if n \{\
|
1181
|
+
.RS 4
|
1182
|
+
.\}
|
1183
|
+
.nf
|
1184
|
+
(e08afdfb_62c7_485f_87a0_80914e1b4703 = :_erbout; _erbout = []; ::Ember::Template\&.new(("%= 2 + 2"), {:shorthand=>true}\&.merge!(:continue_result => true))\&.render(::Kernel\&.binding); _erbout << "\en"
|
1185
|
+
_erbout << "\en"
|
1186
|
+
::Ember::Template\&.new(("%= 2 + 2"), {:shorthand=>true}\&.merge!(:continue_result => true))\&.render(::Kernel\&.binding); _erbout << "\en"
|
1187
|
+
; _erbout\&.join)
|
1188
|
+
.fi
|
1189
|
+
.if n \{\
|
1190
|
+
.RE
|
1191
|
+
.\}
|
1192
|
+
.sp
|
1193
|
+
Which then produces the following output when rendered:
|
1194
|
+
.sp
|
1195
|
+
.if n \{\
|
1196
|
+
.RS 4
|
1197
|
+
.\}
|
1198
|
+
.nf
|
1199
|
+
4
|
1200
|
+
|
1201
|
+
4
|
1202
|
+
.fi
|
1203
|
+
.if n \{\
|
1204
|
+
.RE
|
1205
|
+
.\}
|
1206
|
+
.SH "HACKING"
|
1207
|
+
.SS "Prerequisites"
|
1208
|
+
.sp
|
1209
|
+
Install Ruby libraries necessary for development using [Bundler]:
|
1210
|
+
.sp
|
1211
|
+
.if n \{\
|
1212
|
+
.RS 4
|
1213
|
+
.\}
|
1214
|
+
.nf
|
1215
|
+
bundle install
|
1216
|
+
.fi
|
1217
|
+
.if n \{\
|
1218
|
+
.RE
|
1219
|
+
.\}
|
1220
|
+
.SS "Infrastructure"
|
1221
|
+
.sp
|
1222
|
+
[Inochi] serves as the project infrastructure for Ember\&. It handles tasks such as building this help manual and API documentation, and packaging, announcing, and publishing new releases\&. See its help manual and list of tasks to get started:
|
1223
|
+
.sp
|
1224
|
+
.if n \{\
|
1225
|
+
.RS 4
|
1226
|
+
.\}
|
1227
|
+
.nf
|
1228
|
+
inochi \-\-help # display help manual
|
1229
|
+
inochi \-\-tasks # list available tasks
|
1230
|
+
.fi
|
1231
|
+
.if n \{\
|
1232
|
+
.RE
|
1233
|
+
.\}
|
1234
|
+
.SS "$LOAD_PATH setup"
|
1235
|
+
.sp
|
1236
|
+
Ensure that the lib/ directory is listed in Ruby\(cqs $LOAD_PATH before you use any libraries therein or run any executables in the bin/ directory\&.
|
1237
|
+
.sp
|
1238
|
+
This can be achieved by passing an option to Ruby:
|
1239
|
+
.sp
|
1240
|
+
.if n \{\
|
1241
|
+
.RS 4
|
1242
|
+
.\}
|
1243
|
+
.nf
|
1244
|
+
ruby \-Ilib bin/ember
|
1245
|
+
irb \-Ilib \-r ember
|
1246
|
+
.fi
|
1247
|
+
.if n \{\
|
1248
|
+
.RE
|
1249
|
+
.\}
|
1250
|
+
.sp
|
1251
|
+
Or by setting the $RUBYLIB environment variable:
|
1252
|
+
.sp
|
1253
|
+
.if n \{\
|
1254
|
+
.RS 4
|
1255
|
+
.\}
|
1256
|
+
.nf
|
1257
|
+
export RUBYLIB=lib # bash, ksh, zsh
|
1258
|
+
setenv RUBYLIB lib # csh
|
1259
|
+
set \-x RUBYLIB lib # fish
|
1260
|
+
|
1261
|
+
ruby bin/ember
|
1262
|
+
irb \-r ember
|
1263
|
+
.fi
|
1264
|
+
.if n \{\
|
1265
|
+
.RE
|
1266
|
+
.\}
|
1267
|
+
.sp
|
1268
|
+
Or by running Ruby through the \m[blue]\fBruby\-wrapper\fR\m[]\&\s-2\u[1]\d\s+2 tool\&.
|
1269
|
+
.SS "RubyGems setup"
|
1270
|
+
.sp
|
1271
|
+
If you use Ruby 1\&.8 or older, then ensure that RubyGems is activated before you use any libraries in the lib/ directory or run any executables in the bin/ directory\&.
|
1272
|
+
.sp
|
1273
|
+
This can be achieved by passing an option to Ruby:
|
1274
|
+
.sp
|
1275
|
+
.if n \{\
|
1276
|
+
.RS 4
|
1277
|
+
.\}
|
1278
|
+
.nf
|
1279
|
+
ruby \-rubygems bin/ember
|
1280
|
+
irb \-rubygems \-r ember
|
1281
|
+
.fi
|
1282
|
+
.if n \{\
|
1283
|
+
.RE
|
1284
|
+
.\}
|
1285
|
+
.sp
|
1286
|
+
Or by setting the $RUBYOPT environment variable:
|
1287
|
+
.sp
|
1288
|
+
.if n \{\
|
1289
|
+
.RS 4
|
1290
|
+
.\}
|
1291
|
+
.nf
|
1292
|
+
export RUBYOPT=\-rubygems # bash, ksh, zsh
|
1293
|
+
setenv RUBYOPT \-rubygems # csh
|
1294
|
+
set \-x RUBYOPT \-rubygems # fish
|
1295
|
+
.fi
|
1296
|
+
.if n \{\
|
1297
|
+
.RE
|
1298
|
+
.\}
|
1299
|
+
.SS "Running tests"
|
1300
|
+
.sp
|
1301
|
+
Simply execute the included test runner, which sets up Ruby\(cqs $LOAD_PATH for testing, loads the included test/test_helper\&.rb file, and then evaluates all test/**/*_test\&.rb files:
|
1302
|
+
.sp
|
1303
|
+
.if n \{\
|
1304
|
+
.RS 4
|
1305
|
+
.\}
|
1306
|
+
.nf
|
1307
|
+
ruby test/runner
|
1308
|
+
.fi
|
1309
|
+
.if n \{\
|
1310
|
+
.RE
|
1311
|
+
.\}
|
1312
|
+
.sp
|
1313
|
+
Its exit status will indicate whether all tests have passed\&. It may also print additional pass/fail information depending on the testing library used in the test/test_helper\&.rb file\&.
|
1314
|
+
.SS "Contributing"
|
1315
|
+
.sp
|
1316
|
+
\m[blue]\fBFork this project on GitHub\fR\m[] and send a pull request\&.
|
1317
|
+
.SH "HISTORY"
|
1318
|
+
.SS "Version 0\&.3\&.1 (2011\-04\-22)"
|
1319
|
+
.sp
|
1320
|
+
This release fixes a compatibility issue with Ruby 1\&.9\&.2\-rc2\&.
|
1321
|
+
.PP
|
1322
|
+
\fBBug fixes\fR
|
1323
|
+
.sp
|
1324
|
+
.RS 4
|
1325
|
+
.ie n \{\
|
1326
|
+
\h'-04'\(bu\h'+03'\c
|
1327
|
+
.\}
|
1328
|
+
.el \{\
|
1329
|
+
.sp -1
|
1330
|
+
.IP \(bu 2.3
|
1331
|
+
.\}
|
1332
|
+
Compatibility fixes for Ruby 1\&.9\&.2\-rc2\&.
|
1333
|
+
.RE
|
1334
|
+
.PP
|
1335
|
+
\fBHousekeeping\fR
|
1336
|
+
.sp
|
1337
|
+
.RS 4
|
1338
|
+
.ie n \{\
|
1339
|
+
\h'-04'\(bu\h'+03'\c
|
1340
|
+
.\}
|
1341
|
+
.el \{\
|
1342
|
+
.sp -1
|
1343
|
+
.IP \(bu 2.3
|
1344
|
+
.\}
|
1345
|
+
Upgrade to Inochi 6\&.0\&.2\&.
|
1346
|
+
.RE
|
1347
|
+
.sp
|
1348
|
+
.RS 4
|
1349
|
+
.ie n \{\
|
1350
|
+
\h'-04'\(bu\h'+03'\c
|
1351
|
+
.\}
|
1352
|
+
.el \{\
|
1353
|
+
.sp -1
|
1354
|
+
.IP \(bu 2.3
|
1355
|
+
.\}
|
1356
|
+
Upgrade from Dfect 2 to Detest 3\&.1\&.0\&.
|
1357
|
+
.RE
|
1358
|
+
.sp
|
1359
|
+
.RS 4
|
1360
|
+
.ie n \{\
|
1361
|
+
\h'-04'\(bu\h'+03'\c
|
1362
|
+
.\}
|
1363
|
+
.el \{\
|
1364
|
+
.sp -1
|
1365
|
+
.IP \(bu 2.3
|
1366
|
+
.\}
|
1367
|
+
Move SYNTAX section into separate source file\&.
|
1368
|
+
.RE
|
1369
|
+
.SS "Version 0\&.3\&.0 (2010\-04\-26)"
|
1370
|
+
.sp
|
1371
|
+
This release adds class methods that let you (portably and more easily) create your own domain specific languages in eRuby; adds more usage examples in the help manual; and removes a binding inheritance hack\&.
|
1372
|
+
.PP
|
1373
|
+
\fBNew features\fR
|
1374
|
+
.sp
|
1375
|
+
.RS 4
|
1376
|
+
.ie n \{\
|
1377
|
+
\h'-04'\(bu\h'+03'\c
|
1378
|
+
.\}
|
1379
|
+
.el \{\
|
1380
|
+
.sp -1
|
1381
|
+
.IP \(bu 2.3
|
1382
|
+
.\}
|
1383
|
+
|
1384
|
+
Ember::Template::wrap_content_block()
|
1385
|
+
wraps eRuby block content appending\&.
|
1386
|
+
.RE
|
1387
|
+
.sp
|
1388
|
+
.RS 4
|
1389
|
+
.ie n \{\
|
1390
|
+
\h'-04'\(bu\h'+03'\c
|
1391
|
+
.\}
|
1392
|
+
.el \{\
|
1393
|
+
.sp -1
|
1394
|
+
.IP \(bu 2.3
|
1395
|
+
.\}
|
1396
|
+
|
1397
|
+
Ember::Template::content_from_block()
|
1398
|
+
extracts content from eRuby blocks\&.
|
1399
|
+
.RE
|
1400
|
+
.sp
|
1401
|
+
.RS 4
|
1402
|
+
.ie n \{\
|
1403
|
+
\h'-04'\(bu\h'+03'\c
|
1404
|
+
.\}
|
1405
|
+
.el \{\
|
1406
|
+
.sp -1
|
1407
|
+
.IP \(bu 2.3
|
1408
|
+
.\}
|
1409
|
+
|
1410
|
+
Ember::Template::buffer_from_block()
|
1411
|
+
gives access to template evalutaion result buffer\&.
|
1412
|
+
.RE
|
1413
|
+
.PP
|
1414
|
+
\fBBug fixes\fR
|
1415
|
+
.sp
|
1416
|
+
.RS 4
|
1417
|
+
.ie n \{\
|
1418
|
+
\h'-04'\(bu\h'+03'\c
|
1419
|
+
.\}
|
1420
|
+
.el \{\
|
1421
|
+
.sp -1
|
1422
|
+
.IP \(bu 2.3
|
1423
|
+
.\}
|
1424
|
+
Remove hack for inheriting parent template binding\&.
|
1425
|
+
.RE
|
1426
|
+
.PP
|
1427
|
+
\fBHousekeeping\fR
|
1428
|
+
.sp
|
1429
|
+
.RS 4
|
1430
|
+
.ie n \{\
|
1431
|
+
\h'-04'\(bu\h'+03'\c
|
1432
|
+
.\}
|
1433
|
+
.el \{\
|
1434
|
+
.sp -1
|
1435
|
+
.IP \(bu 2.3
|
1436
|
+
.\}
|
1437
|
+
Add example on unindenting node content and eRuby DSL examples that use the new content block methods\&.
|
1438
|
+
.RE
|
1439
|
+
.sp
|
1440
|
+
.RS 4
|
1441
|
+
.ie n \{\
|
1442
|
+
\h'-04'\(bu\h'+03'\c
|
1443
|
+
.\}
|
1444
|
+
.el \{\
|
1445
|
+
.sp -1
|
1446
|
+
.IP \(bu 2.3
|
1447
|
+
.\}
|
1448
|
+
Simplify code examples using the new wrap_content_block() method\&.
|
1449
|
+
.RE
|
1450
|
+
.SS "Version 0\&.2\&.0 (2010\-04\-25)"
|
1451
|
+
.sp
|
1452
|
+
This release adds Ruby on Rails integration\&.
|
1453
|
+
.PP
|
1454
|
+
\fBNew features\fR
|
1455
|
+
.sp
|
1456
|
+
.RS 4
|
1457
|
+
.ie n \{\
|
1458
|
+
\h'-04'\(bu\h'+03'\c
|
1459
|
+
.\}
|
1460
|
+
.el \{\
|
1461
|
+
.sp -1
|
1462
|
+
.IP \(bu 2.3
|
1463
|
+
.\}
|
1464
|
+
Ember can now be used directly as a Ruby on Rails (2\&.3 or newer) plugin\&. The plugin registers Ember as the default Rails template handler for "erb" and "rhtml" file types\&. Ember processing options can be set in the Rails environment file:
|
1465
|
+
.sp
|
1466
|
+
.if n \{\
|
1467
|
+
.RS 4
|
1468
|
+
.\}
|
1469
|
+
.nf
|
1470
|
+
ActionView::TemplateHandlers::Ember\&.options = {
|
1471
|
+
:unindent => true,
|
1472
|
+
:shorthand => true,
|
1473
|
+
:infer_end => true
|
1474
|
+
}
|
1475
|
+
.fi
|
1476
|
+
.if n \{\
|
1477
|
+
.RE
|
1478
|
+
.\}
|
1479
|
+
.sp
|
1480
|
+
Thanks to Kamil Kukura for contributing this feature\&.
|
1481
|
+
.RE
|
1482
|
+
.SS "Version 0\&.1\&.1 (2010\-04\-20)"
|
1483
|
+
.sp
|
1484
|
+
This release fixes a nested rendering bug, updates the manual, and further beautifies the Ruby code that results from eRuby template compilation\&.
|
1485
|
+
.PP
|
1486
|
+
\fBBug fixes\fR
|
1487
|
+
.sp
|
1488
|
+
.RS 4
|
1489
|
+
.ie n \{\
|
1490
|
+
\h'-04'\(bu\h'+03'\c
|
1491
|
+
.\}
|
1492
|
+
.el \{\
|
1493
|
+
.sp -1
|
1494
|
+
.IP \(bu 2.3
|
1495
|
+
.\}
|
1496
|
+
|
1497
|
+
Ember::Template#render()
|
1498
|
+
now creates isolated contexts by default to prevent nested calls from clobbering each other\(cqs output!
|
1499
|
+
.sp
|
1500
|
+
For example, if template A calls method X which renders template B (thinking that template B\(cqs rendering is isolated and will not affect the rendering of template A) then you\(cqre in for a wild bug chase! >8\-(
|
1501
|
+
.RE
|
1502
|
+
.PP
|
1503
|
+
\fBHousekeeping\fR
|
1504
|
+
.sp
|
1505
|
+
.RS 4
|
1506
|
+
.ie n \{\
|
1507
|
+
\h'-04'\(bu\h'+03'\c
|
1508
|
+
.\}
|
1509
|
+
.el \{\
|
1510
|
+
.sp -1
|
1511
|
+
.IP \(bu 2.3
|
1512
|
+
.\}
|
1513
|
+
Upgrade to Inochi 2\&.0\&.0rc5\&. Convert manual from ERBook to Ember + Ronn\&.
|
1514
|
+
.RE
|
1515
|
+
.sp
|
1516
|
+
.RS 4
|
1517
|
+
.ie n \{\
|
1518
|
+
\h'-04'\(bu\h'+03'\c
|
1519
|
+
.\}
|
1520
|
+
.el \{\
|
1521
|
+
.sp -1
|
1522
|
+
.IP \(bu 2.3
|
1523
|
+
.\}
|
1524
|
+
Remove spaces around value insertions in template compilation output\&.
|
1525
|
+
.RE
|
1526
|
+
.sp
|
1527
|
+
.RS 4
|
1528
|
+
.ie n \{\
|
1529
|
+
\h'-04'\(bu\h'+03'\c
|
1530
|
+
.\}
|
1531
|
+
.el \{\
|
1532
|
+
.sp -1
|
1533
|
+
.IP \(bu 2.3
|
1534
|
+
.\}
|
1535
|
+
Remove logo images from source repository because they\(cqre no longer used\&.
|
1536
|
+
.RE
|
1537
|
+
.SS "Version 0\&.1\&.0 (2010\-04\-03)"
|
1538
|
+
.sp
|
1539
|
+
This release improves the handling of eRuby comment directives, fixes a bug in the <% end %> inference logic, and performs some minor housekeeping\&.
|
1540
|
+
.PP
|
1541
|
+
\fBNew features\fR
|
1542
|
+
.sp
|
1543
|
+
.RS 4
|
1544
|
+
.ie n \{\
|
1545
|
+
\h'-04'\(bu\h'+03'\c
|
1546
|
+
.\}
|
1547
|
+
.el \{\
|
1548
|
+
.sp -1
|
1549
|
+
.IP \(bu 2.3
|
1550
|
+
.\}
|
1551
|
+
Single\-line comment directives are now ignored (treated like no\-ops) in input templates\&. This allows us to surround eRuby block directives with section separators made from single\-line comment directives:
|
1552
|
+
.sp
|
1553
|
+
.if n \{\
|
1554
|
+
.RS 4
|
1555
|
+
.\}
|
1556
|
+
.nf
|
1557
|
+
%|some_block_directive
|
1558
|
+
|
1559
|
+
Inside some_block_directive\&.
|
1560
|
+
|
1561
|
+
%#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
|
1562
|
+
|
1563
|
+
Still inside some_block_directive!
|
1564
|
+
|
1565
|
+
%#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
|
1566
|
+
%| nested_block_directive
|
1567
|
+
%#\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-
|
1568
|
+
|
1569
|
+
Inside nested_block_directive\&.
|
1570
|
+
.fi
|
1571
|
+
.if n \{\
|
1572
|
+
.RE
|
1573
|
+
.\}
|
1574
|
+
.RE
|
1575
|
+
.PP
|
1576
|
+
\fBBug fixes\fR
|
1577
|
+
.sp
|
1578
|
+
.RS 4
|
1579
|
+
.ie n \{\
|
1580
|
+
\h'-04'\(bu\h'+03'\c
|
1581
|
+
.\}
|
1582
|
+
.el \{\
|
1583
|
+
.sp -1
|
1584
|
+
.IP \(bu 2.3
|
1585
|
+
.\}
|
1586
|
+
|
1587
|
+
<% end %>
|
1588
|
+
inference did not work for blocks beginning with
|
1589
|
+
def,
|
1590
|
+
class, and
|
1591
|
+
module
|
1592
|
+
keywords\&.
|
1593
|
+
.RE
|
1594
|
+
.PP
|
1595
|
+
\fBHousekeeping\fR
|
1596
|
+
.sp
|
1597
|
+
.RS 4
|
1598
|
+
.ie n \{\
|
1599
|
+
\h'-04'\(bu\h'+03'\c
|
1600
|
+
.\}
|
1601
|
+
.el \{\
|
1602
|
+
.sp -1
|
1603
|
+
.IP \(bu 2.3
|
1604
|
+
.\}
|
1605
|
+
Upgrade to Inochi 2\&.0\&.0\-rc3\&. This project no longer depends on the "inochi" or "trollop" gems at runtime\&.
|
1606
|
+
.RE
|
1607
|
+
.SS "Version 0\&.0\&.1 (2009\-10\-03)"
|
1608
|
+
.sp
|
1609
|
+
This release improves Ruby 1\&.9 support and revises the user manual\&.
|
1610
|
+
.PP
|
1611
|
+
\fBBug fixes\fR
|
1612
|
+
.sp
|
1613
|
+
.RS 4
|
1614
|
+
.ie n \{\
|
1615
|
+
\h'-04'\(bu\h'+03'\c
|
1616
|
+
.\}
|
1617
|
+
.el \{\
|
1618
|
+
.sp -1
|
1619
|
+
.IP \(bu 2.3
|
1620
|
+
.\}
|
1621
|
+
Nested templates could not access parent\(cqs binding in Ruby 1\&.9
|
1622
|
+
.RE
|
1623
|
+
.PP
|
1624
|
+
\fBHousekeeping\fR
|
1625
|
+
.sp
|
1626
|
+
.RS 4
|
1627
|
+
.ie n \{\
|
1628
|
+
\h'-04'\(bu\h'+03'\c
|
1629
|
+
.\}
|
1630
|
+
.el \{\
|
1631
|
+
.sp -1
|
1632
|
+
.IP \(bu 2.3
|
1633
|
+
.\}
|
1634
|
+
Use simpler Copyright reminder at the top of every file\&.
|
1635
|
+
.RE
|
1636
|
+
.sp
|
1637
|
+
.RS 4
|
1638
|
+
.ie n \{\
|
1639
|
+
\h'-04'\(bu\h'+03'\c
|
1640
|
+
.\}
|
1641
|
+
.el \{\
|
1642
|
+
.sp -1
|
1643
|
+
.IP \(bu 2.3
|
1644
|
+
.\}
|
1645
|
+
Rename internal \(oqProgram` class\(cq methods to be self\-documenting\&.
|
1646
|
+
.RE
|
1647
|
+
.sp
|
1648
|
+
.RS 4
|
1649
|
+
.ie n \{\
|
1650
|
+
\h'-04'\(bu\h'+03'\c
|
1651
|
+
.\}
|
1652
|
+
.el \{\
|
1653
|
+
.sp -1
|
1654
|
+
.IP \(bu 2.3
|
1655
|
+
.\}
|
1656
|
+
Open source is for fun, so speak of "related works", not "competitors"\&.
|
1657
|
+
.RE
|
1658
|
+
.SS "Version 0\&.0\&.0 (2009\-02\-13)"
|
1659
|
+
.sp
|
1660
|
+
This is the first public release of Ember\&. Enjoy!
|
1661
|
+
.SH "AUTHORS"
|
1662
|
+
.sp
|
1663
|
+
Suraj N\&. Kurapati
|
1664
|
+
.SS "Credits"
|
1665
|
+
.sp
|
1666
|
+
Kamil Kukura
|
1667
|
+
.SS "License"
|
1668
|
+
.sp
|
1669
|
+
(the ISC license)
|
1670
|
+
.sp
|
1671
|
+
Copyright 2009 Suraj N\&. Kurapati <\m[blue]\fBsunaku@gmail\&.com\fR\m[]\&\s-2\u[2]\d\s+2>
|
1672
|
+
.sp
|
1673
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies\&.
|
1674
|
+
.sp
|
1675
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\&. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE\&.
|
1676
|
+
.SH "SEE ALSO"
|
1677
|
+
.sp
|
1678
|
+
erb(1)
|
1679
|
+
.SS "References"
|
1680
|
+
.TS
|
1681
|
+
tab(:);
|
1682
|
+
lt lt
|
1683
|
+
lt lt
|
1684
|
+
lt lt
|
1685
|
+
lt lt
|
1686
|
+
lt lt
|
1687
|
+
lt lt.
|
1688
|
+
T{
|
1689
|
+
.sp
|
1690
|
+
[Bundler]
|
1691
|
+
T}:T{
|
1692
|
+
.sp
|
1693
|
+
\m[blue]\fBhttp://gembundler\&.com\fR\m[]
|
1694
|
+
T}
|
1695
|
+
T{
|
1696
|
+
.sp
|
1697
|
+
[eRuby]
|
1698
|
+
T}:T{
|
1699
|
+
.sp
|
1700
|
+
\m[blue]\fBhttp://ruby\-doc\&.org/docs/ProgrammingRuby/html/web\&.html#S2\fR\m[]
|
1701
|
+
T}
|
1702
|
+
T{
|
1703
|
+
.sp
|
1704
|
+
[Inochi]
|
1705
|
+
T}:T{
|
1706
|
+
.sp
|
1707
|
+
\m[blue]\fBhttp://snk\&.tuxfamily\&.org/lib/inochi/\fR\m[]
|
1708
|
+
T}
|
1709
|
+
T{
|
1710
|
+
.sp
|
1711
|
+
[Rails]
|
1712
|
+
T}:T{
|
1713
|
+
.sp
|
1714
|
+
\m[blue]\fBhttp://rubyonrails\&.org\fR\m[]
|
1715
|
+
T}
|
1716
|
+
T{
|
1717
|
+
.sp
|
1718
|
+
[RubyGems]
|
1719
|
+
T}:T{
|
1720
|
+
.sp
|
1721
|
+
\m[blue]\fBhttp://rubygems\&.org\fR\m[]
|
1722
|
+
T}
|
1723
|
+
T{
|
1724
|
+
.sp
|
1725
|
+
[Ruby]
|
1726
|
+
T}:T{
|
1727
|
+
.sp
|
1728
|
+
\m[blue]\fBhttp://ruby\-lang\&.org\fR\m[]
|
1729
|
+
T}
|
1730
|
+
.TE
|
1731
|
+
.sp 1
|
1732
|
+
.SH "NOTES"
|
1733
|
+
.IP " 1." 4
|
1734
|
+
ruby-wrapper
|
1735
|
+
.RS 4
|
1736
|
+
\%http://github.com/chneukirchen/rup/blob/master/ruby-wrapper
|
1737
|
+
.RE
|
1738
|
+
.IP " 2." 4
|
1739
|
+
sunaku@gmail.com
|
1740
|
+
.RS 4
|
1741
|
+
\%mailto:sunaku@gmail.com
|
1742
|
+
.RE
|