erbside 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.ruby +28 -31
- data/HISTORY.rdoc +12 -0
- data/QED.rdoc +353 -0
- data/README.rdoc +8 -4
- data/lib/erbside.yml +28 -31
- data/lib/erbside/metadata.rb +2 -4
- data/qed/00_intro.rdoc +1 -0
- metadata +67 -105
- data/.gemspec +0 -152
- data/.gitignore +0 -8
- data/MANIFEST +0 -34
- data/PROFILE +0 -33
- data/VERSION +0 -1
- data/main.assembly +0 -57
- data/site/.htaccess +0 -2
- data/site/.rsync-filter +0 -7
- data/site/assets/css/highlight.css +0 -96
- data/site/assets/css/reset.css +0 -19
- data/site/assets/css/site.css +0 -52
- data/site/assets/img/curb.jpg +0 -0
- data/site/assets/img/emeraled.png +0 -0
- data/site/assets/img/fade.png +0 -0
- data/site/assets/img/fork-me.png +0 -0
- data/site/assets/img/icon.jpg +0 -0
- data/site/assets/js/highlight.js +0 -1
- data/site/assets/js/jquery.js +0 -19
- data/site/assets/js/jquery.tabs.js +0 -1
- data/site/index.html +0 -229
- data/work/defunct/css/color.css +0 -45
- data/work/defunct/css/font.css +0 -39
- data/work/defunct/css/struct.css +0 -51
- data/work/defunct/inline-old/bash.rb +0 -36
- data/work/defunct/inline-old/cpp.rb +0 -39
- data/work/defunct/inline-old/css.rb +0 -32
- data/work/defunct/inline-old/html.rb +0 -32
- data/work/defunct/inline-old/js.rb +0 -85
- data/work/defunct/inline-old/ruby.rb +0 -147
- data/work/defunct/inline-old/type.rb +0 -91
- data/work/defunct/inline.rb +0 -202
- data/work/defunct/plan.rb +0 -37
- data/work/defunct/tiller.rb +0 -200
- data/work/defunct/webme/options.yml +0 -4
- data/work/defunct/whole.rb +0 -221
- data/work/plugins/syckle/erbside.rb +0 -45
- data/work/radio_earth.jpg +0 -0
- data/yard.watchr +0 -12
data/.ruby
CHANGED
@@ -1,54 +1,51 @@
|
|
1
|
-
---
|
2
|
-
|
1
|
+
---
|
2
|
+
source:
|
3
|
+
- meta
|
4
|
+
authors:
|
3
5
|
- name: Thomas Sawyer
|
4
6
|
email: transfire@gmail.com
|
5
|
-
copyrights:
|
6
|
-
- holder: Thomas Sawyer
|
7
|
-
year:
|
8
|
-
license:
|
7
|
+
copyrights:
|
8
|
+
- holder: Rubyworks, Thomas Sawyer
|
9
|
+
year: '2010'
|
10
|
+
license: BSD-2-Clause
|
9
11
|
replacements: []
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
requirements:
|
12
|
+
alternatives: []
|
13
|
+
requirements:
|
14
14
|
- name: facets
|
15
15
|
- name: qed
|
16
|
-
groups:
|
16
|
+
groups:
|
17
17
|
- test
|
18
18
|
development: true
|
19
19
|
- name: citron
|
20
|
-
groups:
|
20
|
+
groups:
|
21
21
|
- test
|
22
22
|
development: true
|
23
23
|
- name: detroit
|
24
|
-
groups:
|
24
|
+
groups:
|
25
25
|
- build
|
26
26
|
development: true
|
27
27
|
dependencies: []
|
28
|
-
|
29
|
-
repositories:
|
30
|
-
- uri: git://github.com/
|
28
|
+
conflicts: []
|
29
|
+
repositories:
|
30
|
+
- uri: git://github.com/rubyworks/erbside.git
|
31
31
|
scm: git
|
32
|
-
name:
|
33
|
-
resources:
|
32
|
+
name: upstream
|
33
|
+
resources:
|
34
34
|
home: http://rubyworks.github.com/erbside
|
35
35
|
code: http://github.com/rubyworks/erbside
|
36
36
|
docs: http://rubydoc.info/gems/erbside/frames
|
37
37
|
mail: http://googlegroups.com/group/rubyworks-mailinglist
|
38
|
-
|
38
|
+
extra: {}
|
39
|
+
load_path:
|
39
40
|
- lib
|
40
|
-
extra:
|
41
|
-
manifest: MANIFEST
|
42
|
-
source: []
|
43
|
-
|
44
|
-
alternatives: []
|
45
|
-
|
46
41
|
revision: 0
|
47
|
-
|
42
|
+
created: '2009-07-15'
|
48
43
|
summary: ERB-based Inline Templating
|
49
|
-
|
50
|
-
|
51
|
-
description: Erbside is a simple project-oriented erb-based inline template system. Inline templates make it easy to do basic code generation without the need for duplicate files.
|
52
|
-
version: 0.2.1
|
44
|
+
title: Erbside
|
45
|
+
version: 0.3.0
|
53
46
|
name: erbside
|
54
|
-
|
47
|
+
description: ! "Erbside is a simple project-oriented erb-based inline template system.
|
48
|
+
\nInline templates make it easy to do basic code generation without the\nneed for
|
49
|
+
duplicate files."
|
50
|
+
organization: rubyworks
|
51
|
+
date: '2011-10-25'
|
data/HISTORY.rdoc
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
= HISTORY
|
2
2
|
|
3
|
+
== 0.3.0 / 2011-10-23
|
4
|
+
|
5
|
+
This release fixes two issues. First, it fixes the .gemspec file which
|
6
|
+
prevented a fully proper build of the last release. Secondly, it fixes
|
7
|
+
metadata access so it will work without `dotruby` gem.
|
8
|
+
|
9
|
+
Changes:
|
10
|
+
|
11
|
+
* Fix gemspec file typos.
|
12
|
+
* Fix require rescue for dotruby.
|
13
|
+
|
14
|
+
|
3
15
|
== 0.2.1 / 2011-08-23
|
4
16
|
|
5
17
|
Failed to fix dependencies in previous release.
|
data/QED.rdoc
ADDED
@@ -0,0 +1,353 @@
|
|
1
|
+
= Erbside Demonstrandum
|
2
|
+
|
3
|
+
== Ruby
|
4
|
+
|
5
|
+
=== Sideline Rendering
|
6
|
+
|
7
|
+
Given a file named 'example.rb' containing:
|
8
|
+
|
9
|
+
# ordinary comment
|
10
|
+
VERSION = "?" # :erb: VERSION = "<%= 1+1 %>"
|
11
|
+
|
12
|
+
The rendered result of 'example.rb' will be:
|
13
|
+
|
14
|
+
# ordinary comment
|
15
|
+
VERSION = "2" # :erb: VERSION = "<%= 1+1 %>"
|
16
|
+
|
17
|
+
=== Sideline Rendering with First Match Marker
|
18
|
+
|
19
|
+
Given a file named 'example.rb' containing:
|
20
|
+
|
21
|
+
# Script generated 200X #:erb: ^generated <%= 2009 %>
|
22
|
+
|
23
|
+
The rendered result of 'example.rb' will be:
|
24
|
+
|
25
|
+
# Script generated 2009 #:erb: ^generated <%= 2009 %>
|
26
|
+
|
27
|
+
Notice in this case we rendered a comment.
|
28
|
+
|
29
|
+
=== Multiline Rendering
|
30
|
+
|
31
|
+
Given a file named 'example.rb' containing:
|
32
|
+
|
33
|
+
#:erb+1: <%= %w{z y x}.sort.join("\n") %>
|
34
|
+
blah blah blah
|
35
|
+
|
36
|
+
The rendered result of 'example.rb' will be:
|
37
|
+
|
38
|
+
#:erb+3: <%= %w{z y x}.sort.join("\n") %>
|
39
|
+
x
|
40
|
+
y
|
41
|
+
z
|
42
|
+
|
43
|
+
=== Block Rendering
|
44
|
+
|
45
|
+
Given a file named 'example.rb' containing:
|
46
|
+
|
47
|
+
=begin :erb+0:
|
48
|
+
<%= %w{a b c}.map{ |x| "#{x}!" }.join("\n") %>
|
49
|
+
=end
|
50
|
+
|
51
|
+
The rendered result of 'example.rb' will be:
|
52
|
+
|
53
|
+
=begin :erb+3:
|
54
|
+
<%= %w{a b c}.map{ |x| "#{x}!" }.join("\n") %>
|
55
|
+
=end
|
56
|
+
a!
|
57
|
+
b!
|
58
|
+
c!
|
59
|
+
|
60
|
+
|
61
|
+
== Bash
|
62
|
+
|
63
|
+
=== Sideline Rendering
|
64
|
+
|
65
|
+
Given a file named 'example.sh' containing:
|
66
|
+
|
67
|
+
# ordinary comment
|
68
|
+
VERSION = "?" # :erb: VERSION = "<%= 1+1 %>"
|
69
|
+
|
70
|
+
The rendered result of 'example.sh' will be:
|
71
|
+
|
72
|
+
# ordinary comment
|
73
|
+
VERSION = "2" # :erb: VERSION = "<%= 1+1 %>"
|
74
|
+
|
75
|
+
=== Sideline Rendering with First Match Marker
|
76
|
+
|
77
|
+
Given a file named 'example.sh' containing:
|
78
|
+
|
79
|
+
# Script generated 200X #:erb: ^generated <%= 2009 %>
|
80
|
+
|
81
|
+
The rendered result of 'example.sh' will be:
|
82
|
+
|
83
|
+
# Script generated 2009 #:erb: ^generated <%= 2009 %>
|
84
|
+
|
85
|
+
Notice in this case we rendered a comment.
|
86
|
+
|
87
|
+
=== Multiline Rendering
|
88
|
+
|
89
|
+
Given a file named 'example.sh' containing:
|
90
|
+
|
91
|
+
#:erb+1: <%= %w{z y x}.sort.join("\n") %>
|
92
|
+
blah blah blah
|
93
|
+
|
94
|
+
The rendered result of 'example.sh' will be:
|
95
|
+
|
96
|
+
#:erb+3: <%= %w{z y x}.sort.join("\n") %>
|
97
|
+
x
|
98
|
+
y
|
99
|
+
z
|
100
|
+
|
101
|
+
=== Block Rendering
|
102
|
+
|
103
|
+
Given a file named 'example.sh' containing:
|
104
|
+
|
105
|
+
#=begin :erb+0:
|
106
|
+
<%= %w{a b c}.map{ |x| "#{x}!" }.join("\n") %>
|
107
|
+
#=end
|
108
|
+
|
109
|
+
The rendered result of 'example.sh' will be:
|
110
|
+
|
111
|
+
#=begin :erb+3:
|
112
|
+
<%= %w{a b c}.map{ |x| "#{x}!" }.join("\n") %>
|
113
|
+
#=end
|
114
|
+
a!
|
115
|
+
b!
|
116
|
+
c!
|
117
|
+
|
118
|
+
|
119
|
+
== C/C++
|
120
|
+
|
121
|
+
=== Sideline Example
|
122
|
+
|
123
|
+
Sideline example, where the erb comment is to the side of the
|
124
|
+
text it will replace. Given a file named 'example.c' containing:
|
125
|
+
|
126
|
+
version = "?"; // :erb: version = "<%= 1+1 %>";
|
127
|
+
|
128
|
+
The rendered result of 'example.c' will be:
|
129
|
+
|
130
|
+
version = "2"; // :erb: version = "<%= 1+1 %>";
|
131
|
+
|
132
|
+
=== Multiline Example
|
133
|
+
|
134
|
+
Multi-line example, where the erb comment replaces multiple lines but
|
135
|
+
is defined by a single line. Given a file named 'example.c' containing:
|
136
|
+
|
137
|
+
void main() {
|
138
|
+
//:erb+1: <%= %w{z(); y(); x();}.sort.join("\n").indent(2) %>
|
139
|
+
will be replaced
|
140
|
+
}
|
141
|
+
|
142
|
+
The rendered result of 'example.c' will be:
|
143
|
+
|
144
|
+
void main() {
|
145
|
+
//:erb+3: <%= %w{z(); y(); x();}.sort.join("\n").indent(2) %>
|
146
|
+
x();
|
147
|
+
y();
|
148
|
+
z();
|
149
|
+
}
|
150
|
+
|
151
|
+
=== Block Example
|
152
|
+
|
153
|
+
Block example, where the ERB comment replaces multiple lines and is
|
154
|
+
defined by a block comment. Given a file named 'example.c' containing:
|
155
|
+
|
156
|
+
/* :erb+0:
|
157
|
+
<%= %w{a b c}.map{ |e| "\#include <#{e}.h>" }.join("\n") %>
|
158
|
+
*/
|
159
|
+
|
160
|
+
The rendered result of 'example.c' will be:
|
161
|
+
|
162
|
+
/* :erb+3:
|
163
|
+
<%= %w{a b c}.map{ |e| "\#include <#{e}.h>" }.join("\n") %>
|
164
|
+
*/
|
165
|
+
#include <a.h>
|
166
|
+
#include <b.h>
|
167
|
+
#include <c.h>
|
168
|
+
|
169
|
+
|
170
|
+
== Javascript
|
171
|
+
|
172
|
+
=== Sideline Rendering
|
173
|
+
|
174
|
+
Given a file named 'example.js' containing:
|
175
|
+
|
176
|
+
var version = "?"; // :erb: var version = "<%= 1+1 %>";
|
177
|
+
|
178
|
+
The rendered result of 'example.js' will be:
|
179
|
+
|
180
|
+
var version = "2"; // :erb: var version = "<%= 1+1 %>";
|
181
|
+
|
182
|
+
Given a file named 'example.js' containing:
|
183
|
+
|
184
|
+
// Manifest generated 2009 #:erb: ^generated <%= 2009 %>
|
185
|
+
|
186
|
+
The rendered result of 'example.js' will be:
|
187
|
+
|
188
|
+
// Manifest generated 2009 #:erb: ^generated <%= 2009 %>
|
189
|
+
|
190
|
+
=== Multiline Rendering
|
191
|
+
|
192
|
+
Given a file named 'example.js' containing:
|
193
|
+
|
194
|
+
//:erb+1: <%= %w{z; y; x;}.sort.join("\n") %>
|
195
|
+
blah blah blah
|
196
|
+
|
197
|
+
The rendered result of 'example.js' will be:
|
198
|
+
|
199
|
+
//:erb+3: <%= %w{z; y; x;}.sort.join("\n") %>
|
200
|
+
x;
|
201
|
+
y;
|
202
|
+
z;
|
203
|
+
|
204
|
+
=== Block Rendering
|
205
|
+
|
206
|
+
Given a file named 'example.js' containing:
|
207
|
+
|
208
|
+
/* :erb+1:
|
209
|
+
<%= %w{z; y; x;}.sort.join("\n") %>
|
210
|
+
*/
|
211
|
+
blah blah blah
|
212
|
+
|
213
|
+
The rendered result of 'example.js' will be:
|
214
|
+
|
215
|
+
/* :erb+3:
|
216
|
+
<%= %w{z; y; x;}.sort.join("\n") %>
|
217
|
+
*/
|
218
|
+
x;
|
219
|
+
y;
|
220
|
+
z;
|
221
|
+
|
222
|
+
|
223
|
+
== CSS
|
224
|
+
|
225
|
+
=== Sideline Rendering
|
226
|
+
|
227
|
+
Given a file named 'example.css' containing:
|
228
|
+
|
229
|
+
{ color: #000; } // :erb: { color: #<%= 1+1 %>00; }
|
230
|
+
|
231
|
+
The rendered result of 'example.css' will be:
|
232
|
+
|
233
|
+
{ color: #200; } // :erb: { color: #<%= 1+1 %>00; }
|
234
|
+
|
235
|
+
Rather then spell out the entire line we can use the front match
|
236
|
+
marker. Given a file named 'example.css' containing:
|
237
|
+
|
238
|
+
{ color: #000; } // :erb: ^#<%= 2+2 %>00; }
|
239
|
+
|
240
|
+
The rendered result of 'example.css' will be:
|
241
|
+
|
242
|
+
{ color: #400; } // :erb: ^#<%= 2+2 %>00; }
|
243
|
+
|
244
|
+
=== Multiline Rendering
|
245
|
+
|
246
|
+
Given a file named 'example.css' containing:
|
247
|
+
|
248
|
+
//:erb+1: <%= %w{z; y; x;}.sort.join("\n") %>
|
249
|
+
blah blah blah
|
250
|
+
|
251
|
+
The rendered result of 'example.css' will be:
|
252
|
+
|
253
|
+
//:erb+3: <%= %w{z; y; x;}.sort.join("\n") %>
|
254
|
+
x;
|
255
|
+
y;
|
256
|
+
z;
|
257
|
+
|
258
|
+
=== Block Rendering
|
259
|
+
|
260
|
+
Given a file named 'example.css' containing:
|
261
|
+
|
262
|
+
/* :erb+1:
|
263
|
+
<%= %w{z; y; x;}.sort.join("\n") %>
|
264
|
+
*/
|
265
|
+
blah blah blah
|
266
|
+
|
267
|
+
The rendered result of 'example.css' will be:
|
268
|
+
|
269
|
+
/* :erb+3:
|
270
|
+
<%= %w{z; y; x;}.sort.join("\n") %>
|
271
|
+
*/
|
272
|
+
x;
|
273
|
+
y;
|
274
|
+
z;
|
275
|
+
|
276
|
+
|
277
|
+
== XML/HTML
|
278
|
+
|
279
|
+
=== Sideline Example
|
280
|
+
|
281
|
+
Given a file named 'example.xml' containing:
|
282
|
+
|
283
|
+
<!-- ordianry comment -->
|
284
|
+
<root>
|
285
|
+
<version number="?"/> <!-- :erb: <version number="<%= 1+1 %>"/> -->
|
286
|
+
</root>
|
287
|
+
|
288
|
+
The rendered result of 'example.xml' will be:
|
289
|
+
|
290
|
+
<!-- ordianry comment -->
|
291
|
+
<root>
|
292
|
+
<version number="2"/> <!-- :erb: <version number="<%= 1+1 %>"/> -->
|
293
|
+
</root>
|
294
|
+
|
295
|
+
=== Multiline Rendering
|
296
|
+
|
297
|
+
Given a file named 'example.xml' containing:
|
298
|
+
|
299
|
+
<root>
|
300
|
+
<letters>
|
301
|
+
<!-- :erb+1: <%= %w{z y x}.sort.join("\n").indent(4) %> -->
|
302
|
+
blah blah blah
|
303
|
+
</letters>
|
304
|
+
</root>
|
305
|
+
|
306
|
+
The rendered result of 'example.xml' will be:
|
307
|
+
|
308
|
+
<root>
|
309
|
+
<letters>
|
310
|
+
<!-- :erb+3: <%= %w{z y x}.sort.join("\n").indent(4) %> -->
|
311
|
+
x
|
312
|
+
y
|
313
|
+
z
|
314
|
+
</letters>
|
315
|
+
</root>
|
316
|
+
|
317
|
+
=== Block Rendering
|
318
|
+
|
319
|
+
Given a file named 'example.xml' containing:
|
320
|
+
|
321
|
+
<root>
|
322
|
+
<!-- :erb+0:
|
323
|
+
<%= %w{a b c}.map{ |x| "<#{x}/>" }.join("\n") %>
|
324
|
+
-->
|
325
|
+
</root>
|
326
|
+
|
327
|
+
The rendered result of 'example.xml' will be:
|
328
|
+
|
329
|
+
<root>
|
330
|
+
<!-- :erb+3:
|
331
|
+
<%= %w{a b c}.map{ |x| "<#{x}/>" }.join("\n") %>
|
332
|
+
-->
|
333
|
+
<a/>
|
334
|
+
<b/>
|
335
|
+
<c/>
|
336
|
+
</root>
|
337
|
+
|
338
|
+
|
339
|
+
== Commandline Interface
|
340
|
+
|
341
|
+
Given a file named 'example.rb' containing:
|
342
|
+
|
343
|
+
example # :erb: change <%= 1+1 %>
|
344
|
+
|
345
|
+
Rendering via the commandline:
|
346
|
+
|
347
|
+
$ erbside -o example.rb
|
348
|
+
|
349
|
+
The result will be:
|
350
|
+
|
351
|
+
change 2 # :erb: change <%= 1+1 %>
|
352
|
+
|
353
|
+
|