ramaze 2010.01 → 2010.03
Sign up to get free protection for your applications and to get access to all the features.
- data/MANIFEST +4 -4
- data/Rakefile +18 -17
- data/doc/AUTHORS +4 -1
- data/doc/CHANGELOG +94 -0
- data/doc/tutorial/todolist.html +233 -100
- data/doc/tutorial/todolist.txt +5 -5
- data/examples/app/upload/start.rb +7 -3
- data/examples/app/wiktacular/{template/html_layout.xhtml → layout/application.xhtml} +0 -0
- data/examples/app/wiktacular/spec/wiktacular.rb +30 -30
- data/examples/app/wiktacular/src/controller.rb +18 -18
- data/examples/app/wiktacular/src/model.rb +29 -13
- data/examples/app/wiktacular/start.rb +1 -1
- data/examples/app/wiktacular/{template → view}/edit.xhtml +2 -2
- data/examples/app/wiktacular/{template → view}/index.xhtml +0 -0
- data/examples/app/wiktacular/{template → view}/new.xhtml +1 -1
- data/lib/proto/public/js/jquery.js +4398 -2534
- data/lib/ramaze/helper/formatting.rb +20 -20
- data/lib/ramaze/version.rb +1 -1
- data/lib/ramaze/view/haml.rb +3 -6
- data/ramaze.gemspec +50 -47
- data/spec/ramaze/view/haml.rb +28 -0
- data/tasks/changelog.rake +1 -1
- metadata +338 -179
data/MANIFEST
CHANGED
@@ -126,6 +126,7 @@ examples/app/wikore/src/model.rb
|
|
126
126
|
examples/app/wikore/start.rb
|
127
127
|
examples/app/wikore/view/index.xhtml
|
128
128
|
examples/app/wiktacular/README
|
129
|
+
examples/app/wiktacular/layout/application.xhtml
|
129
130
|
examples/app/wiktacular/mkd/link/2007-07-20_19-45-51.mkd
|
130
131
|
examples/app/wiktacular/mkd/link/current.mkd
|
131
132
|
examples/app/wiktacular/mkd/main/2007-07-20_16-31-33.mkd
|
@@ -147,10 +148,9 @@ examples/app/wiktacular/spec/wiktacular.rb
|
|
147
148
|
examples/app/wiktacular/src/controller.rb
|
148
149
|
examples/app/wiktacular/src/model.rb
|
149
150
|
examples/app/wiktacular/start.rb
|
150
|
-
examples/app/wiktacular/
|
151
|
-
examples/app/wiktacular/
|
152
|
-
examples/app/wiktacular/
|
153
|
-
examples/app/wiktacular/template/new.xhtml
|
151
|
+
examples/app/wiktacular/view/edit.xhtml
|
152
|
+
examples/app/wiktacular/view/index.xhtml
|
153
|
+
examples/app/wiktacular/view/new.xhtml
|
154
154
|
examples/basic/element.rb
|
155
155
|
examples/basic/gestalt.rb
|
156
156
|
examples/basic/hello.rb
|
data/Rakefile
CHANGED
@@ -14,29 +14,26 @@ PROJECT_SPECS = FileList[
|
|
14
14
|
PROJECT_MODULE = 'Ramaze'
|
15
15
|
PROJECT_JQUERY_FILE = 'lib/proto/public/js/jquery.js'
|
16
16
|
PROJECT_README = 'README.md'
|
17
|
-
PROJECT_VERSION = ENV['VERSION'] || Date.today.strftime('%Y.%m.%d')
|
17
|
+
PROJECT_VERSION = ENV['VERSION'].dup || Date.today.strftime('%Y.%m.%d')
|
18
18
|
PROJECT_COPYRIGHT = [
|
19
19
|
"# Copyright (c) #{Time.now.year} Michael Fellinger m.fellinger@gmail.com",
|
20
20
|
"# All files in this distribution are subject to the terms of the Ruby license."
|
21
21
|
]
|
22
22
|
|
23
23
|
DEPENDENCIES = {
|
24
|
-
'innate' => {:version => '= 2010.
|
24
|
+
'innate' => {:version => '= 2010.03'},
|
25
25
|
}
|
26
26
|
|
27
27
|
DEVELOPMENT_DEPENDENCIES = {
|
28
|
-
"
|
29
|
-
"Remarkably" => {:version => "0.5.2", :lib => 'remarkably'},
|
30
|
-
"abstract" => {:version => "1.0.0"},
|
31
|
-
"activesupport" => {:version => "2.3.5"},
|
28
|
+
"abstract" => {:version => "1.0.0"},
|
32
29
|
"addressable" => {:version => "2.1.1"},
|
33
30
|
"bacon" => {:version => "1.1.0"},
|
34
31
|
"builder" => {:version => "2.1.2"},
|
35
32
|
"erector" => {:version => "0.7.2"},
|
36
33
|
"erubis" => {:version => "2.6.5"},
|
37
34
|
"ezamar" => {:version => "2009.06"},
|
38
|
-
"gemcutter" => {:version => "0.
|
39
|
-
"haml" => {:version => "2.2.
|
35
|
+
"gemcutter" => {:version => "0.5.0"},
|
36
|
+
"haml" => {:version => "2.2.20"},
|
40
37
|
"hpricot" => {:version => "0.8.2"},
|
41
38
|
"json" => {:version => "1.2.0"},
|
42
39
|
"less" => {:version => "1.1.13"},
|
@@ -45,20 +42,24 @@ DEVELOPMENT_DEPENDENCIES = {
|
|
45
42
|
"localmemcache" => {:version => "0.4.4"},
|
46
43
|
"lokar" => {:version => "0.1.0"},
|
47
44
|
"maruku" => {:version => "0.6.0"},
|
48
|
-
"memcache-client" => {:version => "1.
|
49
|
-
"mustache" => {:version => "0.
|
50
|
-
"mutter" => {:version => "0.5.
|
45
|
+
"memcache-client" => {:version => "1.8.0", :lib => 'memcache'},
|
46
|
+
"mustache" => {:version => "0.6.0"},
|
47
|
+
"mutter" => {:version => "0.5.3"},
|
51
48
|
"nagoro" => {:version => "2009.05"},
|
52
|
-
"polyglot" => {:version => "0.
|
53
|
-
"rack" => {:version => "1.1.0"},
|
49
|
+
"polyglot" => {:version => "0.3.0"},
|
54
50
|
"rack-contrib" => {:version => "0.9.2", :lib => 'rack/contrib'},
|
55
51
|
"rack-test" => {:version => "0.5.3", :lib => 'rack/test'},
|
56
|
-
"
|
57
|
-
"
|
52
|
+
"ramaze" => {:version => "2010.03.02"},
|
53
|
+
"RedCloth" => {:version => "4.2.3"},
|
54
|
+
"Remarkably" => {:version => "0.5.2", :lib => 'remarkably'},
|
55
|
+
"RubyInline" => {:version => "3.8.4"},
|
56
|
+
"sequel" => {:version => "3.9.0"},
|
57
|
+
"slippers" => {:version => "0.0.14"},
|
58
58
|
"sqlite3-ruby" => {:version => "1.2.5", :lib => 'sqlite3'},
|
59
59
|
"tagz" => {:version => "7.2.3"},
|
60
60
|
"tenjin" => {:version => "0.6.1"},
|
61
|
-
"treetop" => {:version => "1.4.
|
61
|
+
"treetop" => {:version => "1.4.4"},
|
62
|
+
"ZenTest" => {:version => "4.2.1"},
|
62
63
|
}
|
63
64
|
|
64
65
|
GEMSPEC = Gem::Specification.new{|s|
|
@@ -76,7 +77,7 @@ GEMSPEC = Gem::Specification.new{|s|
|
|
76
77
|
s.bindir = "bin"
|
77
78
|
s.executables = ["ramaze"]
|
78
79
|
s.rubyforge_project = "ramaze"
|
79
|
-
s.required_rubygems_version = '>= 1.3.
|
80
|
+
s.required_rubygems_version = '>= 1.3.5'
|
80
81
|
|
81
82
|
s.post_install_message = <<MESSAGE.strip
|
82
83
|
============================================================
|
data/doc/AUTHORS
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Following persons have contributed to ramaze.
|
2
2
|
(Sorted by number of submitted patches, then alphabetically)
|
3
3
|
|
4
|
-
|
4
|
+
2682 Michael Fellinger <m.fellinger@gmail.com>
|
5
5
|
216 Aman Gupta <aman@ramaze.net>
|
6
6
|
89 Jonathan Buch <jonathan.buch@gmail.com>
|
7
7
|
77 Pistos <gitsomegrace.5.pistos@geoshell.com>
|
@@ -16,6 +16,7 @@ Following persons have contributed to ramaze.
|
|
16
16
|
6 Antti Tuomi <antti.tuomi@tkk.fi>
|
17
17
|
6 Sam Carr <samcarr@gmail.com>
|
18
18
|
5 Dmitry Gorbik <socket.h@gmail.com>
|
19
|
+
5 mwlang <mwlang@cybrains.net>
|
19
20
|
4 Andreas Karlsson <andreas@proxel.se>
|
20
21
|
4 James Tucker <jftucker@gmail.com>
|
21
22
|
4 mig <mig@mypeplum.com>
|
@@ -24,6 +25,7 @@ Following persons have contributed to ramaze.
|
|
24
25
|
3 Riku Raisaenen <riku@helloit.fi>
|
25
26
|
3 starapor <me@sarahtaraporewalla.com>
|
26
27
|
2 Andrew Farmer <xichekolas@gmail.com>
|
28
|
+
2 jShaf <joshua.shaffner@gmail.com>
|
27
29
|
2 Lars Olsson <lasso@lassoweb.se>
|
28
30
|
2 Masahiro Nakagawa <repeatedly@gmail.com>
|
29
31
|
2 Yutaka HARA <yutaka.hara+github@gmail.com>
|
@@ -38,6 +40,7 @@ Following persons have contributed to ramaze.
|
|
38
40
|
1 Gavin Kistner <gavin@phrogz.net>
|
39
41
|
1 Jean-Francois Chevrette <jfchevrette@iweb.ca>
|
40
42
|
1 Jeremy Evans <code@jeremyevans.net>
|
43
|
+
1 kez <kdobson@gmail.com>
|
41
44
|
1 Martin Hilbig <blueonyx@dev-area.net>
|
42
45
|
1 Matt Rubens <mrubens@goldencookie.localdomain>
|
43
46
|
1 Rob Lievaart <rob@rebeltechnologies.nl>
|
data/doc/CHANGELOG
CHANGED
@@ -1,3 +1,97 @@
|
|
1
|
+
[43a38b8 | Mon Mar 08 13:55:07 UTC 2010] Michael Fellinger <m.fellinger@gmail.com>
|
2
|
+
|
3
|
+
* Version 2010.03
|
4
|
+
|
5
|
+
[8629332 | Tue Mar 02 05:36:52 UTC 2010] Michael Fellinger <m.fellinger@gmail.com>
|
6
|
+
|
7
|
+
* Gracefully handle empty commit title
|
8
|
+
|
9
|
+
[04e7ac5 | Tue Mar 02 05:31:21 UTC 2010] Michael Fellinger <m.fellinger@gmail.com>
|
10
|
+
|
11
|
+
* Remove polyglot dependency, it's indirect
|
12
|
+
|
13
|
+
[cc60569 | Thu Feb 25 18:31:39 UTC 2010] Michael Fellinger <m.fellinger@gmail.com>
|
14
|
+
|
15
|
+
* Fix upload example
|
16
|
+
|
17
|
+
[957bbee | Sun Feb 14 14:01:33 UTC 2010] Michael Fellinger <m.fellinger@gmail.com>
|
18
|
+
|
19
|
+
* Update todolist.html
|
20
|
+
|
21
|
+
[9c39d64 | Sat Feb 13 21:55:29 UTC 2010] jShaf <joshua.shaffner@gmail.com>
|
22
|
+
|
23
|
+
*
|
24
|
+
|
25
|
+
[2b917ff | Sat Feb 13 21:48:10 UTC 2010] jShaf <joshua.shaffner@gmail.com>
|
26
|
+
|
27
|
+
*
|
28
|
+
|
29
|
+
[5c93ded | Tue Feb 02 08:26:17 UTC 2010] Michael Fellinger <m.fellinger@gmail.com>
|
30
|
+
|
31
|
+
* Revert "Made Haml cache more efficient"
|
32
|
+
|
33
|
+
This reverts commit 45db6fe0696dfac7deeebba42c62c6bcca8bab10.
|
34
|
+
|
35
|
+
[87a2562 | Tue Feb 02 08:26:02 UTC 2010] Michael Fellinger <m.fellinger@gmail.com>
|
36
|
+
|
37
|
+
* Revert "Fixed small bug in haml view"
|
38
|
+
|
39
|
+
This reverts commit a226b402518e17d1715b1632981732a5d43b56f9.
|
40
|
+
|
41
|
+
[a85a6b5 | Tue Feb 02 08:25:41 UTC 2010] Michael Fellinger <m.fellinger@gmail.com>
|
42
|
+
|
43
|
+
* Revert "Little refactoring"
|
44
|
+
|
45
|
+
This reverts commit 4e6d6a17e46d8d26c012781ef7b5140fba50237c.
|
46
|
+
|
47
|
+
[ba832e9 | Tue Feb 02 08:23:30 UTC 2010] Michael Fellinger <m.fellinger@gmail.com>
|
48
|
+
|
49
|
+
* Document the failure around Haml caching as a spec
|
50
|
+
|
51
|
+
[d931221 | Wed Jan 20 11:52:08 UTC 2010] Michael Fellinger <m.fellinger@gmail.com>
|
52
|
+
|
53
|
+
* Fix old reference to BASEDIR
|
54
|
+
|
55
|
+
[0b4d33d | Wed Jan 20 11:34:46 UTC 2010] Michael Fellinger <m.fellinger@gmail.com>
|
56
|
+
|
57
|
+
* Update the HTML todolist tutorial to match TXT version
|
58
|
+
|
59
|
+
[a1ca6a1 | Wed Jan 13 04:32:00 UTC 2010] Michael Fellinger <m.fellinger@gmail.com>
|
60
|
+
|
61
|
+
* Fix wiktacular
|
62
|
+
|
63
|
+
[d23dd7b | Wed Jan 13 01:34:58 UTC 2010] mwlang <mwlang@cybrains.net>
|
64
|
+
|
65
|
+
* minor tweaks
|
66
|
+
|
67
|
+
[645e221 | Wed Jan 13 00:22:01 UTC 2010] mwlang <mwlang@cybrains.net>
|
68
|
+
|
69
|
+
* fixed anchor in new.xhtml
|
70
|
+
|
71
|
+
[1b3192d | Wed Jan 13 00:11:03 UTC 2010] mwlang <mwlang@cybrains.net>
|
72
|
+
|
73
|
+
* fixed the specs for wiktacular
|
74
|
+
|
75
|
+
[037dfd9 | Tue Jan 12 23:10:41 UTC 2010] mwlang <mwlang@cybrains.net>
|
76
|
+
|
77
|
+
* updated to work with Ramaze 2010.01
|
78
|
+
|
79
|
+
[4ea45ca | Tue Jan 12 23:05:23 UTC 2010] mwlang <mwlang@cybrains.net>
|
80
|
+
|
81
|
+
* changing directory names to current conventions
|
82
|
+
|
83
|
+
[519e76f | Tue Jan 12 00:56:30 UTC 2010] kez <kdobson@gmail.com>
|
84
|
+
|
85
|
+
* Fixed a bug with the auto_link regexp
|
86
|
+
|
87
|
+
[fb08f7c | Thu Jan 07 04:48:32 UTC 2010] Michael Fellinger <m.fellinger@gmail.com>
|
88
|
+
|
89
|
+
* Next release is going to need rubygems 1.3.5
|
90
|
+
|
91
|
+
[017a759 | Thu Jan 07 04:48:19 UTC 2010] Michael Fellinger <m.fellinger@gmail.com>
|
92
|
+
|
93
|
+
* Remove some dev dependencies we don't need
|
94
|
+
|
1
95
|
[1e88bb6 | Wed Jan 06 15:58:30 UTC 2010] Michael Fellinger <m.fellinger@gmail.com>
|
2
96
|
|
3
97
|
* Version 2010.01
|
data/doc/tutorial/todolist.html
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
|
4
4
|
<head>
|
5
5
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
6
|
-
<meta name="generator" content="AsciiDoc 8.
|
6
|
+
<meta name="generator" content="AsciiDoc 8.5.3" />
|
7
7
|
<title>The official Ramaze Todo-list tutorial</title>
|
8
8
|
<style type="text/css">
|
9
9
|
/* Debug borders */
|
@@ -91,7 +91,7 @@ span#author {
|
|
91
91
|
}
|
92
92
|
span#email {
|
93
93
|
}
|
94
|
-
span#
|
94
|
+
span#revnumber, span#revdate, span#revremark {
|
95
95
|
font-family: sans-serif;
|
96
96
|
}
|
97
97
|
|
@@ -118,12 +118,14 @@ div#preamble {
|
|
118
118
|
div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
|
119
119
|
div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
|
120
120
|
div.admonitionblock {
|
121
|
-
margin-top: 1.
|
121
|
+
margin-top: 1.0em;
|
122
122
|
margin-bottom: 1.5em;
|
123
123
|
}
|
124
124
|
div.admonitionblock {
|
125
|
-
margin-top: 2.
|
126
|
-
margin-bottom: 2.
|
125
|
+
margin-top: 2.0em;
|
126
|
+
margin-bottom: 2.0em;
|
127
|
+
margin-right: 10%;
|
128
|
+
color: #606060;
|
127
129
|
}
|
128
130
|
|
129
131
|
div.content { /* Block element content. */
|
@@ -165,21 +167,21 @@ div.listingblock > div.content {
|
|
165
167
|
padding: 0.5em;
|
166
168
|
}
|
167
169
|
|
168
|
-
div.quoteblock {
|
169
|
-
padding-left:
|
170
|
+
div.quoteblock, div.verseblock {
|
171
|
+
padding-left: 1.0em;
|
172
|
+
margin-left: 1.0em;
|
170
173
|
margin-right: 10%;
|
174
|
+
border-left: 5px solid #dddddd;
|
175
|
+
color: #777777;
|
171
176
|
}
|
177
|
+
|
172
178
|
div.quoteblock > div.attribution {
|
173
179
|
padding-top: 0.5em;
|
174
180
|
text-align: right;
|
175
181
|
}
|
176
182
|
|
177
|
-
div.verseblock {
|
178
|
-
|
179
|
-
margin-right: 10%;
|
180
|
-
}
|
181
|
-
div.verseblock > div.content {
|
182
|
-
white-space: pre;
|
183
|
+
div.verseblock > pre.content {
|
184
|
+
font-family: inherit;
|
183
185
|
}
|
184
186
|
div.verseblock > div.attribution {
|
185
187
|
padding-top: 0.75em;
|
@@ -200,17 +202,17 @@ div.admonitionblock .icon {
|
|
200
202
|
}
|
201
203
|
div.admonitionblock td.content {
|
202
204
|
padding-left: 0.5em;
|
203
|
-
border-left:
|
205
|
+
border-left: 3px solid #dddddd;
|
204
206
|
}
|
205
207
|
|
206
208
|
div.exampleblock > div.content {
|
207
|
-
border-left:
|
208
|
-
padding: 0.5em;
|
209
|
+
border-left: 3px solid #dddddd;
|
210
|
+
padding-left: 0.5em;
|
209
211
|
}
|
210
212
|
|
211
213
|
div.imageblock div.content { padding-left: 0; }
|
212
|
-
div.imageblock img { border: 1px solid silver; }
|
213
214
|
span.image img { border-style: none; }
|
215
|
+
a.image:visited { color: white; }
|
214
216
|
|
215
217
|
dl {
|
216
218
|
margin-top: 0.8em;
|
@@ -255,7 +257,7 @@ div.compact div, div.compact div {
|
|
255
257
|
div.tableblock > table {
|
256
258
|
border: 3px solid #527bbd;
|
257
259
|
}
|
258
|
-
thead {
|
260
|
+
thead, p.table.header {
|
259
261
|
font-family: sans-serif;
|
260
262
|
font-weight: bold;
|
261
263
|
}
|
@@ -310,10 +312,42 @@ div.hdlist.compact tr {
|
|
310
312
|
background: yellow;
|
311
313
|
}
|
312
314
|
|
315
|
+
.footnote, .footnoteref {
|
316
|
+
font-size: 0.8em;
|
317
|
+
}
|
318
|
+
|
319
|
+
span.footnote, span.footnoteref {
|
320
|
+
vertical-align: super;
|
321
|
+
}
|
322
|
+
|
323
|
+
#footnotes {
|
324
|
+
margin: 20px 0 20px 0;
|
325
|
+
padding: 7px 0 0 0;
|
326
|
+
}
|
327
|
+
|
328
|
+
#footnotes div.footnote {
|
329
|
+
margin: 0 0 5px 0;
|
330
|
+
}
|
331
|
+
|
332
|
+
#footnotes hr {
|
333
|
+
border: none;
|
334
|
+
border-top: 1px solid silver;
|
335
|
+
height: 1px;
|
336
|
+
text-align: left;
|
337
|
+
margin-left: 0;
|
338
|
+
width: 20%;
|
339
|
+
min-width: 100px;
|
340
|
+
}
|
341
|
+
|
342
|
+
|
313
343
|
@media print {
|
314
344
|
div#footer-badges { display: none; }
|
315
345
|
}
|
316
346
|
|
347
|
+
div#toc {
|
348
|
+
margin-bottom: 2.5em;
|
349
|
+
}
|
350
|
+
|
317
351
|
div#toctitle {
|
318
352
|
color: #527bbd;
|
319
353
|
font-family: sans-serif;
|
@@ -339,10 +373,57 @@ div.toclevel4 {
|
|
339
373
|
margin-left: 6em;
|
340
374
|
font-size: 0.9em;
|
341
375
|
}
|
376
|
+
/* Workarounds for IE6's broken and incomplete CSS2. */
|
377
|
+
|
378
|
+
div.sidebar-content {
|
379
|
+
background: #ffffee;
|
380
|
+
border: 1px solid silver;
|
381
|
+
padding: 0.5em;
|
382
|
+
}
|
383
|
+
div.sidebar-title, div.image-title {
|
384
|
+
color: #527bbd;
|
385
|
+
font-family: sans-serif;
|
386
|
+
font-weight: bold;
|
387
|
+
margin-top: 0.0em;
|
388
|
+
margin-bottom: 0.5em;
|
389
|
+
}
|
390
|
+
|
391
|
+
div.listingblock div.content {
|
392
|
+
border: 1px solid silver;
|
393
|
+
background: #f4f4f4;
|
394
|
+
padding: 0.5em;
|
395
|
+
}
|
396
|
+
|
397
|
+
div.quoteblock-attribution {
|
398
|
+
padding-top: 0.5em;
|
399
|
+
text-align: right;
|
400
|
+
}
|
401
|
+
|
402
|
+
pre.verseblock-content {
|
403
|
+
font-family: inherit;
|
404
|
+
}
|
405
|
+
div.verseblock-attribution {
|
406
|
+
padding-top: 0.75em;
|
407
|
+
text-align: left;
|
408
|
+
}
|
409
|
+
|
410
|
+
div.exampleblock-content {
|
411
|
+
border-left: 3px solid #dddddd;
|
412
|
+
padding-left: 0.5em;
|
413
|
+
}
|
414
|
+
|
415
|
+
/* IE6 sets dynamically generated links as visited. */
|
416
|
+
div#toc a:visited { color: blue; }
|
342
417
|
</style>
|
343
418
|
<script type="text/javascript">
|
344
419
|
/*<![CDATA[*/
|
345
|
-
window.onload = function(){
|
420
|
+
window.onload = function(){asciidoc.footnotes();}
|
421
|
+
var asciidoc = { // Namespace.
|
422
|
+
|
423
|
+
/////////////////////////////////////////////////////////////////////
|
424
|
+
// Table Of Contents generator
|
425
|
+
/////////////////////////////////////////////////////////////////////
|
426
|
+
|
346
427
|
/* Author: Mihai Bazon, September 2002
|
347
428
|
* http://students.infoiasi.ro/~mishoo
|
348
429
|
*
|
@@ -354,53 +435,55 @@ window.onload = function(){generateToc(2)}
|
|
354
435
|
*/
|
355
436
|
|
356
437
|
/* modified by Troy D. Hanson, September 2006. License: GPL */
|
357
|
-
/* modified by Stuart Rackham,
|
358
|
-
|
359
|
-
function getText(el) {
|
360
|
-
var text = "";
|
361
|
-
for (var i = el.firstChild; i != null; i = i.nextSibling) {
|
362
|
-
if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
|
363
|
-
text += i.data;
|
364
|
-
else if (i.firstChild != null)
|
365
|
-
text += getText(i);
|
366
|
-
}
|
367
|
-
return text;
|
368
|
-
}
|
438
|
+
/* modified by Stuart Rackham, 2006, 2009. License: GPL */
|
369
439
|
|
370
|
-
|
371
|
-
|
372
|
-
this.text = text;
|
373
|
-
this.toclevel = toclevel;
|
374
|
-
}
|
440
|
+
// toclevels = 1..4.
|
441
|
+
toc: function (toclevels) {
|
375
442
|
|
376
|
-
function
|
377
|
-
|
378
|
-
var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
|
379
|
-
// Function that scans the DOM tree for header elements (the DOM2
|
380
|
-
// nodeIterator API would be a better technique but not supported by all
|
381
|
-
// browsers).
|
382
|
-
var iterate = function (el) {
|
443
|
+
function getText(el) {
|
444
|
+
var text = "";
|
383
445
|
for (var i = el.firstChild; i != null; i = i.nextSibling) {
|
384
|
-
if (i.nodeType ==
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
446
|
+
if (i.nodeType == 3 /* Node.TEXT_NODE */) // IE doesn't speak constants.
|
447
|
+
text += i.data;
|
448
|
+
else if (i.firstChild != null)
|
449
|
+
text += getText(i);
|
450
|
+
}
|
451
|
+
return text;
|
452
|
+
}
|
453
|
+
|
454
|
+
function TocEntry(el, text, toclevel) {
|
455
|
+
this.element = el;
|
456
|
+
this.text = text;
|
457
|
+
this.toclevel = toclevel;
|
458
|
+
}
|
459
|
+
|
460
|
+
function tocEntries(el, toclevels) {
|
461
|
+
var result = new Array;
|
462
|
+
var re = new RegExp('[hH]([2-'+(toclevels+1)+'])');
|
463
|
+
// Function that scans the DOM tree for header elements (the DOM2
|
464
|
+
// nodeIterator API would be a better technique but not supported by all
|
465
|
+
// browsers).
|
466
|
+
var iterate = function (el) {
|
467
|
+
for (var i = el.firstChild; i != null; i = i.nextSibling) {
|
468
|
+
if (i.nodeType == 1 /* Node.ELEMENT_NODE */) {
|
469
|
+
var mo = re.exec(i.tagName);
|
470
|
+
if (mo && (i.getAttribute("class") || i.getAttribute("className")) != "float") {
|
471
|
+
result[result.length] = new TocEntry(i, getText(i), mo[1]-1);
|
472
|
+
}
|
473
|
+
iterate(i);
|
474
|
+
}
|
389
475
|
}
|
390
476
|
}
|
477
|
+
iterate(el);
|
478
|
+
return result;
|
391
479
|
}
|
392
|
-
iterate(el);
|
393
|
-
return result;
|
394
|
-
}
|
395
480
|
|
396
|
-
// This function does the work. toclevels = 1..4.
|
397
|
-
function generateToc(toclevels) {
|
398
481
|
var toc = document.getElementById("toc");
|
399
|
-
var entries = tocEntries(document.
|
482
|
+
var entries = tocEntries(document.getElementById("content"), toclevels);
|
400
483
|
for (var i = 0; i < entries.length; ++i) {
|
401
484
|
var entry = entries[i];
|
402
485
|
if (entry.element.id == "")
|
403
|
-
entry.element.id = "
|
486
|
+
entry.element.id = "_toc_" + i;
|
404
487
|
var a = document.createElement("a");
|
405
488
|
a.href = "#" + entry.element.id;
|
406
489
|
a.appendChild(document.createTextNode(entry.text));
|
@@ -410,7 +493,58 @@ function generateToc(toclevels) {
|
|
410
493
|
toc.appendChild(div);
|
411
494
|
}
|
412
495
|
if (entries.length == 0)
|
413
|
-
|
496
|
+
toc.parentNode.removeChild(toc);
|
497
|
+
},
|
498
|
+
|
499
|
+
|
500
|
+
/////////////////////////////////////////////////////////////////////
|
501
|
+
// Footnotes generator
|
502
|
+
/////////////////////////////////////////////////////////////////////
|
503
|
+
|
504
|
+
/* Based on footnote generation code from:
|
505
|
+
* http://www.brandspankingnew.net/archive/2005/07/format_footnote.html
|
506
|
+
*/
|
507
|
+
|
508
|
+
footnotes: function () {
|
509
|
+
var cont = document.getElementById("content");
|
510
|
+
var noteholder = document.getElementById("footnotes");
|
511
|
+
var spans = cont.getElementsByTagName("span");
|
512
|
+
var refs = {};
|
513
|
+
var n = 0;
|
514
|
+
for (i=0; i<spans.length; i++) {
|
515
|
+
if (spans[i].className == "footnote") {
|
516
|
+
n++;
|
517
|
+
// Use [\s\S] in place of . so multi-line matches work.
|
518
|
+
// Because JavaScript has no s (dotall) regex flag.
|
519
|
+
note = spans[i].innerHTML.match(/\s*\[([\s\S]*)]\s*/)[1];
|
520
|
+
noteholder.innerHTML +=
|
521
|
+
"<div class='footnote' id='_footnote_" + n + "'>" +
|
522
|
+
"<a href='#_footnoteref_" + n + "' title='Return to text'>" +
|
523
|
+
n + "</a>. " + note + "</div>";
|
524
|
+
spans[i].innerHTML =
|
525
|
+
"[<a id='_footnoteref_" + n + "' href='#_footnote_" + n +
|
526
|
+
"' title='View footnote' class='footnote'>" + n + "</a>]";
|
527
|
+
var id =spans[i].getAttribute("id");
|
528
|
+
if (id != null) refs["#"+id] = n;
|
529
|
+
}
|
530
|
+
}
|
531
|
+
if (n == 0)
|
532
|
+
noteholder.parentNode.removeChild(noteholder);
|
533
|
+
else {
|
534
|
+
// Process footnoterefs.
|
535
|
+
for (i=0; i<spans.length; i++) {
|
536
|
+
if (spans[i].className == "footnoteref") {
|
537
|
+
var href = spans[i].getElementsByTagName("a")[0].getAttribute("href");
|
538
|
+
href = href.match(/#.*/)[0]; // Because IE return full URL.
|
539
|
+
n = refs[href];
|
540
|
+
spans[i].innerHTML =
|
541
|
+
"[<a href='#_footnote_" + n +
|
542
|
+
"' title='View footnote' class='footnote'>" + n + "</a>]";
|
543
|
+
}
|
544
|
+
}
|
545
|
+
}
|
546
|
+
}
|
547
|
+
|
414
548
|
}
|
415
549
|
/*]]>*/
|
416
550
|
</script>
|
@@ -420,13 +554,10 @@ function generateToc(toclevels) {
|
|
420
554
|
<h1>The official Ramaze Todo-list tutorial</h1>
|
421
555
|
<span id="author">Michael 'manveru' Fellinger</span><br />
|
422
556
|
<span id="email"><tt><<a href="mailto:m.fellinger@gmail.com">m.fellinger@gmail.com</a>></tt></span><br />
|
423
|
-
<span id="
|
424
|
-
March 2009
|
425
|
-
<div id="toc">
|
426
|
-
<div id="toctitle">Table of Contents</div>
|
427
|
-
<noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
|
428
|
-
</div>
|
557
|
+
<span id="revnumber">version 2.0,</span>
|
558
|
+
<span id="revdate">March 2009</span>
|
429
559
|
</div>
|
560
|
+
<div id="content">
|
430
561
|
<h2 id="_abstract">Abstract</h2>
|
431
562
|
<div class="sectionbody">
|
432
563
|
<div class="paragraph"><p>Welcome to the official tutorial for <a href="http://ramaze.net">Ramaze</a>, the mandatory
|
@@ -477,7 +608,7 @@ Ramaze distribution.
|
|
477
608
|
To find out where that is located (as this differs widely between systems), you
|
478
609
|
can follow these steps in <tt>irb</tt>:</p></div>
|
479
610
|
<div class="listingblock">
|
480
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
611
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
481
612
|
by Lorenzo Bettini
|
482
613
|
http://www.lorenzobettini.it
|
483
614
|
http://www.gnu.org/software/src-highlite -->
|
@@ -485,7 +616,7 @@ http://www.gnu.org/software/src-highlite -->
|
|
485
616
|
<span style="font-style: italic"><span style="color: #9A1900"># => true</span></span>
|
486
617
|
<span style="font-weight: bold"><span style="color: #000080">require</span></span> <span style="color: #FF0000">'ramaze'</span>
|
487
618
|
<span style="font-style: italic"><span style="color: #9A1900"># => true</span></span>
|
488
|
-
File<span style="color: #990000">.</span>expand_path<span style="color: #990000">(</span>Ramaze<span style="color: #990000">::</span>
|
619
|
+
File<span style="color: #990000">.</span>expand_path<span style="color: #990000">(</span>Ramaze<span style="color: #990000">::</span>ROOT <span style="color: #990000">+</span> <span style="color: #FF0000">'/../examples/app/todolist'</span><span style="color: #990000">)</span>
|
489
620
|
<span style="font-style: italic"><span style="color: #9A1900"># => "/home/manveru/c/ramaze/examples/app/todolist"</span></span></tt></pre></div></div>
|
490
621
|
<div class="paragraph"><p>To start things off, we will create a basic directory structure looking like this:</p></div>
|
491
622
|
<div class="listingblock">
|
@@ -507,7 +638,7 @@ File<span style="color: #990000">.</span>expand_path<span style="color: #990000"
|
|
507
638
|
tradition, we create a file at the root of your application directory called
|
508
639
|
<em>start.rb</em> with following content:</p></div>
|
509
640
|
<div class="listingblock">
|
510
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
641
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
511
642
|
by Lorenzo Bettini
|
512
643
|
http://www.lorenzobettini.it
|
513
644
|
http://www.gnu.org/software/src-highlite -->
|
@@ -562,7 +693,7 @@ provide bindings, in which case I have to refer you to <a href="http://sqlite.or
|
|
562
693
|
<div class="paragraph"><p>In order to use Sequel we also need a database connection.</p></div>
|
563
694
|
<div class="paragraph"><p>So we create a new file at <em>model/init.rb</em> with following content:</p></div>
|
564
695
|
<div class="listingblock">
|
565
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
696
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
566
697
|
by Lorenzo Bettini
|
567
698
|
http://www.lorenzobettini.it
|
568
699
|
http://www.gnu.org/software/src-highlite -->
|
@@ -576,7 +707,7 @@ to 2.12 you may remove this line if it gives you any problems.</p></div>
|
|
576
707
|
<div class="paragraph"><p>Next we edit <em>start.rb</em>, remove the <tt>Hello</tt> class, and add a require for the
|
577
708
|
file, <em>start.rb</em> should look like this now:</p></div>
|
578
709
|
<div class="listingblock">
|
579
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
710
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
580
711
|
by Lorenzo Bettini
|
581
712
|
http://www.lorenzobettini.it
|
582
713
|
http://www.gnu.org/software/src-highlite -->
|
@@ -590,7 +721,7 @@ Ramaze<span style="color: #990000">.</span>start</tt></pre></div></div>
|
|
590
721
|
ask how we are going to create our schema.</p></div>
|
591
722
|
<div class="paragraph"><p>So our next step is to create the actual model for our data, for this we create another file at <em>model/task.rb</em>:</p></div>
|
592
723
|
<div class="listingblock">
|
593
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
724
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
594
725
|
by Lorenzo Bettini
|
595
726
|
http://www.lorenzobettini.it
|
596
727
|
http://www.gnu.org/software/src-highlite -->
|
@@ -614,7 +745,7 @@ very good support for them as well, but seriously, this is a really simple
|
|
614
745
|
schema that probably won’t change much over the next few years.</p></div>
|
615
746
|
<div class="paragraph"><p>Finally, add a line to your <em>model/init.rb</em> that requires <em>model/task.rb</em>:</p></div>
|
616
747
|
<div class="listingblock">
|
617
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
748
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
618
749
|
by Lorenzo Bettini
|
619
750
|
http://www.lorenzobettini.it
|
620
751
|
http://www.gnu.org/software/src-highlite -->
|
@@ -638,7 +769,7 @@ explain that in more detail later when we come to layouts.</p></div>
|
|
638
769
|
<div class="paragraph"><p>To start we put some contents into <em>view/index.xhtml</em> (xhtml is the default
|
639
770
|
filename-extension for Etanni templates)</p></div>
|
640
771
|
<div class="listingblock">
|
641
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
772
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
642
773
|
by Lorenzo Bettini
|
643
774
|
http://www.lorenzobettini.it
|
644
775
|
http://www.gnu.org/software/src-highlite -->
|
@@ -668,7 +799,7 @@ yielding a list of task titles and the respective status of the task.</p></div>
|
|
668
799
|
work, let’s see how this looks like in a browser, start your application like above with <tt>ruby start.rb</tt> and open <a href="http://localhost:7000/">http://localhost:7000/</a>.</p></div>
|
669
800
|
<div class="paragraph"><p>The template expanded to something like (only showing the interesting part):</p></div>
|
670
801
|
<div class="listingblock">
|
671
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
802
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
672
803
|
by Lorenzo Bettini
|
673
804
|
http://www.lorenzobettini.it
|
674
805
|
http://www.gnu.org/software/src-highlite -->
|
@@ -695,7 +826,7 @@ Structure of the Model or View independent from each other.</p></div>
|
|
695
826
|
we will implement marking a task as done.</p></div>
|
696
827
|
<div class="paragraph"><p>Go on and create the file <em>controller/task.rb</em> with following contents:</p></div>
|
697
828
|
<div class="listingblock">
|
698
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
829
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
699
830
|
by Lorenzo Bettini
|
700
831
|
http://www.lorenzobettini.it
|
701
832
|
http://www.gnu.org/software/src-highlite -->
|
@@ -745,7 +876,7 @@ Redirect the client to where it came from.
|
|
745
876
|
</ul></div>
|
746
877
|
<div class="paragraph"><p>And we add a require to <em>controller/task.rb</em> to our <em>start.rb</em>:</p></div>
|
747
878
|
<div class="listingblock">
|
748
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
879
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
749
880
|
by Lorenzo Bettini
|
750
881
|
http://www.lorenzobettini.it
|
751
882
|
http://www.gnu.org/software/src-highlite -->
|
@@ -759,7 +890,7 @@ Ramaze<span style="color: #990000">.</span>start</tt></pre></div></div>
|
|
759
890
|
<div class="paragraph"><p>Next we will have to modify the <em>view/index.xhtml</em> to contain a link that will
|
760
891
|
change the status of a task:</p></div>
|
761
892
|
<div class="listingblock">
|
762
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
893
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
763
894
|
by Lorenzo Bettini
|
764
895
|
http://www.lorenzobettini.it
|
765
896
|
http://www.gnu.org/software/src-highlite -->
|
@@ -776,7 +907,7 @@ done.</p></div>
|
|
776
907
|
<div class="paragraph"><p>An even shorter way of writing that line using default aliases, that you will
|
777
908
|
encounter in other applications, is:</p></div>
|
778
909
|
<div class="listingblock">
|
779
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
910
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
780
911
|
by Lorenzo Bettini
|
781
912
|
http://www.lorenzobettini.it
|
782
913
|
http://www.gnu.org/software/src-highlite -->
|
@@ -793,7 +924,7 @@ do your laundry and come back for the next episode.</p></div>
|
|
793
924
|
open them again, so you won’t be without work tomorrow.</p></div>
|
794
925
|
<div class="paragraph"><p>Let’s add a method to our Controller that will let us open a closed task:</p></div>
|
795
926
|
<div class="listingblock">
|
796
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
927
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
797
928
|
by Lorenzo Bettini
|
798
929
|
http://www.lorenzobettini.it
|
799
930
|
http://www.gnu.org/software/src-highlite -->
|
@@ -818,7 +949,7 @@ http://www.gnu.org/software/src-highlite -->
|
|
818
949
|
<span style="font-weight: bold"><span style="color: #0000FF">end</span></span></tt></pre></div></div>
|
819
950
|
<div class="paragraph"><p>And add a link to that action:</p></div>
|
820
951
|
<div class="listingblock">
|
821
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
952
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
822
953
|
by Lorenzo Bettini
|
823
954
|
http://www.lorenzobettini.it
|
824
955
|
http://www.gnu.org/software/src-highlite -->
|
@@ -839,7 +970,7 @@ that will take care of that for you.</p></div>
|
|
839
970
|
<div class="paragraph"><p>Time to get rid of that task once and for all. No more dish washing yay!</p></div>
|
840
971
|
<div class="paragraph"><p>A little modification to Controller, using destructive force.</p></div>
|
841
972
|
<div class="listingblock">
|
842
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
973
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
843
974
|
by Lorenzo Bettini
|
844
975
|
http://www.lorenzobettini.it
|
845
976
|
http://www.gnu.org/software/src-highlite -->
|
@@ -871,7 +1002,7 @@ http://www.gnu.org/software/src-highlite -->
|
|
871
1002
|
<span style="font-weight: bold"><span style="color: #0000FF">end</span></span></tt></pre></div></div>
|
872
1003
|
<div class="paragraph"><p>And a link to the <tt>delete</tt> action.</p></div>
|
873
1004
|
<div class="listingblock">
|
874
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
1005
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
875
1006
|
by Lorenzo Bettini
|
876
1007
|
http://www.lorenzobettini.it
|
877
1008
|
http://www.gnu.org/software/src-highlite -->
|
@@ -900,7 +1031,7 @@ forgetting about it.</p></div>
|
|
900
1031
|
a nice little form that we can fill out in the few seconds between proving
|
901
1032
|
people on the internet wrong.</p></div>
|
902
1033
|
<div class="listingblock">
|
903
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
1034
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
904
1035
|
by Lorenzo Bettini
|
905
1036
|
http://www.lorenzobettini.it
|
906
1037
|
http://www.gnu.org/software/src-highlite -->
|
@@ -917,7 +1048,7 @@ yet. Trying to create a task will result in an error.</p></div>
|
|
917
1048
|
<div class="paragraph"><p>So what we have to do is adding one more method to our Controller that will
|
918
1049
|
take care of actually creating the Task.</p></div>
|
919
1050
|
<div class="listingblock">
|
920
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
1051
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
921
1052
|
by Lorenzo Bettini
|
922
1053
|
http://www.lorenzobettini.it
|
923
1054
|
http://www.gnu.org/software/src-highlite -->
|
@@ -971,7 +1102,7 @@ one with the same title, you will get a nice error:</p></div>
|
|
971
1102
|
<div class="paragraph"><p>OK, programmers ignore warnings and hide errors, let’s rescue the exception and
|
972
1103
|
just act as if nothing has happened.</p></div>
|
973
1104
|
<div class="listingblock">
|
974
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
1105
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
975
1106
|
by Lorenzo Bettini
|
976
1107
|
http://www.lorenzobettini.it
|
977
1108
|
http://www.gnu.org/software/src-highlite -->
|
@@ -1004,7 +1135,7 @@ What a waste of our honest effort to create a duplicate task, we all know if we
|
|
1004
1135
|
try often enough it will eventually have to work, so let’s save us some typing.</p></div>
|
1005
1136
|
<div class="paragraph"><p>In our <em>view/index.xhtml</em> we modify the form input to have a default value:</p></div>
|
1006
1137
|
<div class="listingblock">
|
1007
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
1138
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
1008
1139
|
by Lorenzo Bettini
|
1009
1140
|
http://www.lorenzobettini.it
|
1010
1141
|
http://www.gnu.org/software/src-highlite -->
|
@@ -1020,7 +1151,7 @@ http://www.gnu.org/software/src-highlite -->
|
|
1020
1151
|
and View.
|
1021
1152
|
We didn’t set any such variable in the Controller yet, so do it now:</p></div>
|
1022
1153
|
<div class="listingblock">
|
1023
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
1154
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
1024
1155
|
by Lorenzo Bettini
|
1025
1156
|
http://www.lorenzobettini.it
|
1026
1157
|
http://www.gnu.org/software/src-highlite -->
|
@@ -1038,7 +1169,7 @@ http://www.gnu.org/software/src-highlite -->
|
|
1038
1169
|
<div class="paragraph"><p>Turns out we have to revisit the <tt>create</tt> method to give us a hint in form of a
|
1039
1170
|
GET parameter and change <tt>index</tt> to pick it up.</p></div>
|
1040
1171
|
<div class="listingblock">
|
1041
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
1172
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
1042
1173
|
by Lorenzo Bettini
|
1043
1174
|
http://www.lorenzobettini.it
|
1044
1175
|
http://www.gnu.org/software/src-highlite -->
|
@@ -1072,7 +1203,7 @@ Not forever, but at least it will not show up anymore on the <tt>index</tt> acti
|
|
1072
1203
|
<div class="paragraph"><p>So we filter out all tasks that haven’t been done yet in the
|
1073
1204
|
<em>view/index.xhtml</em>:</p></div>
|
1074
1205
|
<div class="listingblock">
|
1075
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
1206
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
1076
1207
|
by Lorenzo Bettini
|
1077
1208
|
http://www.lorenzobettini.it
|
1078
1209
|
http://www.gnu.org/software/src-highlite -->
|
@@ -1082,7 +1213,7 @@ http://www.gnu.org/software/src-highlite -->
|
|
1082
1213
|
# ...</tt></pre></div></div>
|
1083
1214
|
<div class="paragraph"><p>So off we go and add a new template at <em>view/done.xhtml</em>.</p></div>
|
1084
1215
|
<div class="listingblock">
|
1085
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
1216
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
1086
1217
|
by Lorenzo Bettini
|
1087
1218
|
http://www.lorenzobettini.it
|
1088
1219
|
http://www.gnu.org/software/src-highlite -->
|
@@ -1126,7 +1257,7 @@ of tasks, that’s what we call <em>layout</em>.</p></div>
|
|
1126
1257
|
<div class="paragraph"><p>Every action can have a layout associated with it, remember that empty <em>layout</em>
|
1127
1258
|
directory in your application? That’s exactly where we will put it.</p></div>
|
1128
1259
|
<div class="listingblock">
|
1129
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
1260
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
1130
1261
|
by Lorenzo Bettini
|
1131
1262
|
http://www.lorenzobettini.it
|
1132
1263
|
http://www.gnu.org/software/src-highlite -->
|
@@ -1152,7 +1283,7 @@ http://www.gnu.org/software/src-highlite -->
|
|
1152
1283
|
<div class="paragraph"><p>And to tell Ramaze which layout to use for our <tt>Tasks</tt> we’ll have to add a line
|
1153
1284
|
to the Controller.</p></div>
|
1154
1285
|
<div class="listingblock">
|
1155
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
1286
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
1156
1287
|
by Lorenzo Bettini
|
1157
1288
|
http://www.lorenzobettini.it
|
1158
1289
|
http://www.gnu.org/software/src-highlite -->
|
@@ -1164,13 +1295,13 @@ http://www.gnu.org/software/src-highlite -->
|
|
1164
1295
|
boilerplate we can delete the slack from our templates.</p></div>
|
1165
1296
|
<div class="paragraph"><p><em>view/index.xhtml</em> becomes:</p></div>
|
1166
1297
|
<div class="listingblock">
|
1167
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
1298
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
1168
1299
|
by Lorenzo Bettini
|
1169
1300
|
http://www.lorenzobettini.it
|
1170
1301
|
http://www.gnu.org/software/src-highlite -->
|
1171
|
-
<pre><tt><span style="font-weight: bold"><span style="color: #0000FF"><h2></span></span>
|
1302
|
+
<pre><tt><span style="font-weight: bold"><span style="color: #0000FF"><h2></span></span>Pending Tasks<span style="font-weight: bold"><span style="color: #0000FF"></h2></span></span>
|
1172
1303
|
|
1173
|
-
#{ anchor('
|
1304
|
+
#{ anchor('Done tasks', 'done') }
|
1174
1305
|
|
1175
1306
|
<span style="font-weight: bold"><span style="color: #0000FF"><ul></span></span>
|
1176
1307
|
<?r Task.filter(:done => false).each do |task| ?>
|
@@ -1183,13 +1314,13 @@ http://www.gnu.org/software/src-highlite -->
|
|
1183
1314
|
<span style="font-weight: bold"><span style="color: #0000FF"></ul></span></span></tt></pre></div></div>
|
1184
1315
|
<div class="paragraph"><p><em>view/done.xhtml</em> becomes:</p></div>
|
1185
1316
|
<div class="listingblock">
|
1186
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
1317
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
1187
1318
|
by Lorenzo Bettini
|
1188
1319
|
http://www.lorenzobettini.it
|
1189
1320
|
http://www.gnu.org/software/src-highlite -->
|
1190
|
-
<pre><tt><span style="font-weight: bold"><span style="color: #0000FF"><h2></span></span>
|
1321
|
+
<pre><tt><span style="font-weight: bold"><span style="color: #0000FF"><h2></span></span>Done Tasks<span style="font-weight: bold"><span style="color: #0000FF"></h2></span></span>
|
1191
1322
|
|
1192
|
-
#{ anchor('
|
1323
|
+
#{ anchor('Pending tasks', '') }
|
1193
1324
|
|
1194
1325
|
<span style="font-weight: bold"><span style="color: #0000FF"><ul></span></span>
|
1195
1326
|
<?r Task.filter(:done => true).each do |task| ?>
|
@@ -1216,7 +1347,7 @@ in the example todo-list.</p></div>
|
|
1216
1347
|
<div class="paragraph"><p>What we do cover is adding it to your application, or the <tt><head></tt> in
|
1217
1348
|
<em>layout/default.xhtml</em> to be exact:</p></div>
|
1218
1349
|
<div class="listingblock">
|
1219
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
1350
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
1220
1351
|
by Lorenzo Bettini
|
1221
1352
|
http://www.lorenzobettini.it
|
1222
1353
|
http://www.gnu.org/software/src-highlite -->
|
@@ -1240,7 +1371,7 @@ port, <tt>7000</tt>, which prevents you from starting more than one instance or
|
|
1240
1371
|
applications.</p></div>
|
1241
1372
|
<div class="paragraph"><p>To change the port, you can, for example:</p></div>
|
1242
1373
|
<div class="listingblock">
|
1243
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
1374
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
1244
1375
|
by Lorenzo Bettini
|
1245
1376
|
http://www.lorenzobettini.it
|
1246
1377
|
http://www.gnu.org/software/src-highlite -->
|
@@ -1269,7 +1400,7 @@ gem install mongrel</tt></pre>
|
|
1269
1400
|
</div></div>
|
1270
1401
|
<div class="paragraph"><p>Now to the configuration:</p></div>
|
1271
1402
|
<div class="listingblock">
|
1272
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
1403
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
1273
1404
|
by Lorenzo Bettini
|
1274
1405
|
http://www.lorenzobettini.it
|
1275
1406
|
http://www.gnu.org/software/src-highlite -->
|
@@ -1283,7 +1414,7 @@ Ramaze<span style="color: #990000">.</span>options<span style="color: #990000">.
|
|
1283
1414
|
Ramaze<span style="color: #990000">.</span>options<span style="color: #990000">.</span>adapter<span style="color: #990000">.</span>adapter <span style="color: #990000">=</span> <span style="color: #990000">:</span>thin</tt></pre></div></div>
|
1284
1415
|
<div class="paragraph"><p>For the full performance, switch Ramaze into <tt>:live</tt> mode:</p></div>
|
1285
1416
|
<div class="listingblock">
|
1286
|
-
<div class="content"><!-- Generator: GNU source-highlight
|
1417
|
+
<div class="content"><!-- Generator: GNU source-highlight 3.1.3
|
1287
1418
|
by Lorenzo Bettini
|
1288
1419
|
http://www.lorenzobettini.it
|
1289
1420
|
http://www.gnu.org/software/src-highlite -->
|
@@ -1369,10 +1500,12 @@ RSI
|
|
1369
1500
|
</dd>
|
1370
1501
|
</dl></div>
|
1371
1502
|
</div>
|
1503
|
+
</div>
|
1504
|
+
<div id="footnotes"><hr /></div>
|
1372
1505
|
<div id="footer">
|
1373
1506
|
<div id="footer-text">
|
1374
1507
|
Version 2.0<br />
|
1375
|
-
Last updated
|
1508
|
+
Last updated 2010-02-14 23:00:52 JST
|
1376
1509
|
</div>
|
1377
1510
|
</div>
|
1378
1511
|
</body>
|