Pistos-ramaze 2009.04.08 → 2009.06.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (227) hide show
  1. data/.gitignore +3 -0
  2. data/MANIFEST +37 -22
  3. data/{README.markdown → README.md} +5 -24
  4. data/Rakefile +33 -26
  5. data/benchmark/bench_templates/bench.rb +67 -0
  6. data/benchmark/bench_templates/view/large.erb +79 -0
  7. data/benchmark/bench_templates/view/large.haml +41 -0
  8. data/benchmark/bench_templates/view/large.xhtml +79 -0
  9. data/benchmark/bench_templates/view/small.erb +21 -0
  10. data/benchmark/bench_templates/view/small.haml +12 -0
  11. data/benchmark/bench_templates/view/small.xhtml +21 -0
  12. data/benchmark/run.rb +14 -21
  13. data/benchmark/suite/minimal.rb +3 -5
  14. data/benchmark/suite/no_informer.rb +0 -2
  15. data/benchmark/suite/no_sessions.rb +3 -4
  16. data/benchmark/suite/no_template.rb +1 -3
  17. data/benchmark/suite/simple.rb +1 -3
  18. data/benchmark/suite/template_erubis.rb +0 -2
  19. data/benchmark/suite/template_etanni.rb +8 -0
  20. data/benchmark/suite/template_ezamar.rb +1 -3
  21. data/benchmark/suite/template_haml.rb +0 -2
  22. data/benchmark/suite/template_liquid.rb +0 -2
  23. data/benchmark/suite/template_markaby.rb +0 -2
  24. data/benchmark/suite/template_nagoro.rb +1 -3
  25. data/benchmark/suite/template_redcloth.rb +0 -2
  26. data/benchmark/suite/template_tenjin.rb +0 -2
  27. data/bin/ramaze +11 -163
  28. data/doc/AUTHORS +15 -8
  29. data/doc/CHANGELOG +10094 -12262
  30. data/doc/meta/announcement.txt +93 -46
  31. data/doc/tutorial/todolist.html +22 -58
  32. data/doc/tutorial/todolist.txt +20 -39
  33. data/examples/app/auth/layout/{auth.nag → auth.xhtml} +0 -0
  34. data/examples/app/auth/view/{index.nag → index.xhtml} +0 -0
  35. data/examples/app/auth/view/{login.nag → login.xhtml} +0 -0
  36. data/examples/app/auth/view/{secret.nag → secret.xhtml} +0 -0
  37. data/examples/app/blog/app.rb +1 -1
  38. data/examples/app/blog/controller/comment.rb +1 -1
  39. data/examples/app/blog/controller/entry.rb +12 -3
  40. data/examples/app/blog/model/init.rb +5 -0
  41. data/examples/app/blog/model/tag.rb +2 -2
  42. data/examples/app/blog/view/entry/index.nag +3 -3
  43. data/examples/app/blog/view/feed.atom.nag +1 -1
  44. data/examples/app/blog/view/feed.rss.nag +1 -1
  45. data/examples/app/blog/view/index.nag +1 -1
  46. data/examples/app/blog/view/tag/index.nag +1 -1
  47. data/examples/app/chat/layout/{default.nag → default.xhtml} +0 -0
  48. data/examples/app/chat/view/{chat.nag → chat.xhtml} +0 -0
  49. data/examples/app/chat/view/{index.nag → index.xhtml} +0 -0
  50. data/examples/app/localization/locale/de.yaml +5 -0
  51. data/examples/app/localization/locale/en.yaml +5 -0
  52. data/examples/app/localization/locale/ja.yaml +5 -0
  53. data/examples/app/localization/start.rb +33 -20
  54. data/examples/app/wikore/spec/wikore.rb +4 -6
  55. data/examples/app/wikore/src/controller.rb +9 -11
  56. data/examples/app/wikore/src/model.rb +7 -10
  57. data/examples/app/wikore/start.rb +1 -1
  58. data/examples/app/wikore/{template → view}/index.xhtml +0 -0
  59. data/examples/helpers/cache.rb +6 -4
  60. data/examples/misc/css.rb +6 -12
  61. data/examples/misc/rapp.rb +28 -17
  62. data/lib/proto/app.rb +14 -0
  63. data/lib/proto/config.ru +8 -5
  64. data/lib/proto/controller/init.rb +3 -3
  65. data/lib/proto/spec/main.rb +9 -11
  66. data/lib/proto/start.rb +6 -10
  67. data/lib/ramaze.rb +8 -9
  68. data/lib/ramaze/app.rb +4 -3
  69. data/lib/ramaze/cache/localmemcache.rb +2 -2
  70. data/lib/ramaze/cache/memcache.rb +26 -1
  71. data/lib/ramaze/cache/sequel.rb +24 -9
  72. data/lib/ramaze/contrib/addressable_route.rb +56 -0
  73. data/lib/ramaze/contrib/email.rb +2 -0
  74. data/lib/ramaze/contrib/facebook/facebook.rb +4 -4
  75. data/lib/ramaze/contrib/sequel/create_join.rb +1 -0
  76. data/lib/ramaze/contrib/sequel/form_field.rb +4 -4
  77. data/lib/ramaze/contrib/sequel/image.rb +9 -11
  78. data/lib/ramaze/contrib/sequel/relation.rb +17 -3
  79. data/lib/ramaze/controller.rb +26 -18
  80. data/lib/ramaze/gestalt.rb +4 -1
  81. data/lib/ramaze/helper.rb +1 -0
  82. data/lib/ramaze/helper/auth.rb +0 -5
  83. data/lib/ramaze/helper/cache.rb +65 -25
  84. data/lib/ramaze/helper/form.rb +14 -2
  85. data/lib/ramaze/helper/formatting.rb +3 -1
  86. data/lib/ramaze/helper/gestalt.rb +32 -0
  87. data/lib/ramaze/helper/identity.rb +3 -3
  88. data/lib/ramaze/helper/layout.rb +97 -0
  89. data/lib/ramaze/helper/link.rb +6 -25
  90. data/lib/ramaze/helper/localize.rb +13 -3
  91. data/lib/ramaze/helper/paginate.rb +4 -2
  92. data/lib/ramaze/helper/ultraviolet.rb +2 -0
  93. data/lib/ramaze/helper/user.rb +3 -3
  94. data/lib/ramaze/log/rotatinginformer.rb +10 -10
  95. data/lib/ramaze/request.rb +3 -5
  96. data/lib/ramaze/setup.rb +22 -9
  97. data/lib/ramaze/spec.rb +8 -12
  98. data/lib/ramaze/spec/bacon.rb +34 -0
  99. data/lib/ramaze/spec/helper/template_examples.rb +15 -22
  100. data/lib/ramaze/tool/bin.rb +340 -0
  101. data/lib/ramaze/tool/project_creator.rb +1 -1
  102. data/lib/ramaze/version.rb +1 -1
  103. data/lib/ramaze/view.rb +6 -11
  104. data/lib/ramaze/view/erubis.rb +2 -2
  105. data/lib/ramaze/view/ezamar.rb +2 -2
  106. data/lib/ramaze/view/gestalt.rb +14 -0
  107. data/lib/ramaze/view/haml.rb +2 -1
  108. data/lib/ramaze/view/liquid.rb +45 -11
  109. data/lib/ramaze/view/maruku.rb +2 -1
  110. data/lib/ramaze/view/nagoro/render_partial.rb +9 -9
  111. data/lib/ramaze/view/sass.rb +1 -1
  112. data/lib/ramaze/view/tenjin.rb +7 -4
  113. data/lib/vendor/etag.rb +4 -2
  114. data/lib/vendor/route_exceptions.rb +9 -15
  115. data/ramaze.gemspec +56 -9
  116. data/spec/contrib/addressable_route.rb +30 -0
  117. data/spec/contrib/rest.rb +2 -2
  118. data/spec/examples/caching.rb +5 -7
  119. data/spec/examples/css.rb +3 -3
  120. data/spec/examples/element.rb +4 -3
  121. data/spec/examples/hello.rb +3 -3
  122. data/spec/examples/helpers/httpdigest.rb +44 -69
  123. data/spec/examples/linking.rb +3 -3
  124. data/spec/examples/simple.rb +3 -3
  125. data/spec/examples/templates/template_erubis.rb +8 -4
  126. data/spec/examples/templates/template_ezamar.rb +9 -4
  127. data/spec/examples/templates/template_haml.rb +8 -4
  128. data/spec/examples/templates/template_liquid.rb +8 -4
  129. data/spec/examples/templates/template_markaby.rb +9 -5
  130. data/spec/examples/templates/template_nagoro.rb +9 -5
  131. data/spec/examples/templates/template_redcloth.rb +8 -4
  132. data/spec/examples/templates/template_remarkably.rb +8 -4
  133. data/spec/examples/templates/template_tenjin.rb +8 -4
  134. data/spec/helper.rb +1 -2
  135. data/spec/ramaze/action/render.rb +4 -1
  136. data/spec/ramaze/app.rb +5 -2
  137. data/spec/ramaze/bin/ramaze.rb +96 -0
  138. data/spec/ramaze/cache/localmemcache.rb +1 -1
  139. data/spec/ramaze/cache/memcache.rb +7 -1
  140. data/spec/ramaze/cache/sequel.rb +1 -1
  141. data/spec/ramaze/controller/actionless_templates.rb +2 -2
  142. data/spec/ramaze/controller/lonely_mapping.rb +18 -0
  143. data/spec/ramaze/controller/mapping.rb +4 -15
  144. data/spec/ramaze/controller/provide_inheritance.rb +5 -2
  145. data/spec/ramaze/controller/resolve.rb +2 -2
  146. data/spec/ramaze/controller/subclass.rb +2 -2
  147. data/spec/ramaze/controller/template_resolving.rb +2 -2
  148. data/spec/ramaze/dispatcher/directory.rb +5 -2
  149. data/spec/ramaze/dispatcher/file.rb +28 -26
  150. data/spec/ramaze/error.rb +3 -3
  151. data/spec/ramaze/files.rb +5 -2
  152. data/spec/ramaze/gestalt.rb +26 -17
  153. data/spec/ramaze/helper/auth.rb +30 -41
  154. data/spec/ramaze/helper/bench.rb +6 -2
  155. data/spec/ramaze/helper/cache.rb +45 -5
  156. data/spec/ramaze/helper/flash.rb +11 -15
  157. data/spec/ramaze/helper/form.rb +6 -3
  158. data/spec/ramaze/helper/formatting.rb +4 -1
  159. data/spec/ramaze/helper/gestalt.rb +4 -1
  160. data/spec/ramaze/helper/gravatar.rb +4 -1
  161. data/spec/ramaze/helper/httpdigest.rb +51 -66
  162. data/spec/ramaze/helper/layout.rb +79 -0
  163. data/spec/ramaze/helper/layout/default.xhtml +5 -0
  164. data/spec/ramaze/helper/link.rb +33 -12
  165. data/spec/ramaze/helper/localize.rb +9 -4
  166. data/spec/ramaze/helper/maruku.rb +5 -2
  167. data/spec/ramaze/helper/pager.rb +2 -2
  168. data/spec/ramaze/helper/paginate.rb +5 -2
  169. data/spec/ramaze/helper/request_accessor.rb +5 -2
  170. data/spec/ramaze/helper/sequel_form.rb +7 -2
  171. data/spec/ramaze/helper/simple_captcha.rb +10 -14
  172. data/spec/ramaze/helper/stack.rb +32 -40
  173. data/spec/ramaze/helper/user.rb +19 -14
  174. data/spec/ramaze/helper/xhtml.rb +4 -1
  175. data/spec/ramaze/log/informer.rb +1 -1
  176. data/spec/ramaze/log/logging.rb +4 -1
  177. data/spec/ramaze/log/syslog.rb +6 -6
  178. data/spec/ramaze/params.rb +5 -6
  179. data/spec/ramaze/request.rb +16 -1
  180. data/spec/ramaze/session/memcache.rb +66 -0
  181. data/spec/ramaze/struct.rb +4 -1
  182. data/spec/ramaze/view.rb +2 -2
  183. data/spec/ramaze/view/erubis.rb +2 -2
  184. data/spec/ramaze/view/ezamar.rb +2 -2
  185. data/spec/ramaze/view/gestalt.rb +94 -0
  186. data/spec/ramaze/view/gestalt/external.ges +8 -0
  187. data/spec/ramaze/view/haml.rb +2 -2
  188. data/spec/ramaze/view/liquid.rb +2 -2
  189. data/spec/ramaze/view/nagoro.rb +2 -2
  190. data/spec/ramaze/view/redcloth.rb +2 -2
  191. data/spec/ramaze/view/remarkably.rb +2 -2
  192. data/spec/ramaze/view/sass.rb +2 -2
  193. data/spec/ramaze/view/tagz.rb +2 -2
  194. data/spec/ramaze/view/tenjin.rb +2 -2
  195. data/spec/snippets/array/put_within.rb +30 -25
  196. data/spec/snippets/binding/locals.rb +4 -1
  197. data/spec/snippets/numeric/filesize_format.rb +4 -1
  198. data/spec/snippets/numeric/time.rb +5 -2
  199. data/spec/snippets/object/__dir__.rb +4 -1
  200. data/spec/snippets/ordered_set.rb +4 -1
  201. data/spec/snippets/ramaze/acquire.rb +4 -1
  202. data/spec/snippets/ramaze/dictionary.rb +4 -1
  203. data/spec/snippets/ramaze/struct.rb +4 -1
  204. data/spec/snippets/string/camel_case.rb +4 -1
  205. data/spec/snippets/string/color.rb +4 -1
  206. data/spec/snippets/string/snake_case.rb +4 -1
  207. data/spec/snippets/string/unindent.rb +4 -1
  208. data/spec/snippets/thread/into.rb +4 -1
  209. data/tasks/bacon.rake +5 -3
  210. data/tasks/changelog.rake +3 -1
  211. data/tasks/{gem_installer.rake → gem_setup.rake} +45 -22
  212. data/tasks/release.rake +12 -27
  213. data/tasks/setup.rake +6 -0
  214. data/tasks/todo.rake +2 -4
  215. metadata +205 -31
  216. data/CHANGELOG +0 -16546
  217. data/benchmark/suite/template_builder.rb +0 -12
  218. data/doc/tutorial/todolist.mkd +0 -787
  219. data/examples/helpers/provide.rb +0 -23
  220. data/lib/proto/view/page.xhtml +0 -27
  221. data/lib/ramaze/snippets/divide.rb +0 -22
  222. data/lib/ramaze/snippets/kernel/constant.rb +0 -41
  223. data/lib/ramaze/snippets/object/acquire.rb +0 -37
  224. data/lib/ramaze/snippets/string/each.rb +0 -19
  225. data/spec/ramaze/helper/partial.rb +0 -40
  226. data/spec/snippets/kernel/constant.rb +0 -23
  227. data/tasks/install_dependencies.rake +0 -6
@@ -1,5 +1,5 @@
1
- This time we are proud to announce Version 2008.07 of Ramaze, the light and
2
- modular open source web framework.
1
+ The Ramaze development team is happy to announce version 2009.06 of Ramaze, the
2
+ light and modular open source web framework that tries to stay out of your way.
3
3
 
4
4
  This release features a lot of work directly from our community and we are
5
5
  really greatful for everybody who helped in testing, patching and contributing
@@ -9,14 +9,17 @@ Our extensive set of specs and docs now covers almost every detail of
9
9
  implementation and usage. Ramaze is under development by a growing community
10
10
  and in production use at companies.
11
11
 
12
+ There have been too many changes since the last official announcement in
13
+ 2008.07, so I will only list changes since the last release.
14
+
15
+
16
+ == Metadata
12
17
 
13
18
  Home page: http://ramaze.net
14
- Screencasts: http://ramaze.net/screencasts
19
+ Wiki: http://wiki.ramaze.net
15
20
 
16
- Source browser: http://source.ramaze.net
17
21
  Repository: http://github.com/manveru/ramaze
18
22
 
19
- Nightly gems: http://gems.ramaze.net
20
23
  Git clone: git://github.com/manveru/ramaze
21
24
  Current tarball: http://github.com/manveru/ramaze/tarball/master
22
25
 
@@ -36,61 +39,105 @@ Simple example:
36
39
  Ramaze.start
37
40
 
38
41
 
39
- Some of 52 patches since 2008.06:
40
-
41
- - Loggers are now in Ramaze::Logger namespace
42
- - Global.prefix for nested deployment via webserver in front
43
- - Binding#locals fixed for Ruby 1.9
44
- - Redirects now use HTTP status 302 instead of 303
45
- - Logger::Syslog works again
46
-
47
- Special (alphabetic) thanks go to:
48
-
49
- Pistos - The usual Mathetes, patches and lots of friendly support
50
- Aman 'tmm1' Gupta - Time snippets for numeric
51
- Clinton R. Nixon - More REST and some fixes
52
- Jean-Francois Chevrette - Restore --console feature
53
- raggi - Various fixes
54
- Rob Lievaart - Fix Logger::Syslog
55
- Sam Carr - Cleanup of Cache
56
- Wang Jinjing - 1.9 compatibility
57
- Yasushi Abe - First patch!
42
+ == Around 80 commits since 2009.05
43
+
44
+ - Improved bin/ramaze with lots of specs, should work now even on windows.
45
+ - Middleware order has been inverted.
46
+ - Support for Webrat out of the box.
47
+ - Fixed MemCache caching and sessions.
48
+ - Removed a whole lot of methods that were marked deprecated.
49
+ - New default Layout helper
50
+
51
+
52
+ == Summarized changes with their respective commits
53
+
54
+ - Antti Tuomi
55
+ - Link helper did not set the prefix, added spec and fixed the behaviour
56
+ [ af753a0 | bae2b53 | eba4734 ]
57
+
58
+ - Michael Fellinger (manveru)
59
+ - Fix bug that made default port/handler break in bin/ramaze [ e6715e1 ]
60
+ - Remove deprecated methods on Ramaze::Controller, Helper::Cache,
61
+ Helper::Link, and Helper::Auth. Also remove the deprecated methods
62
+ Object#acquire, String#/, and Symbol#/
63
+ [ 272fced | 1e4ac92 | a0a9329 | 68242b3 | 57e7a85 | 31b809a | 3fc4622 ]
64
+ - The bacon scope :mock was renamed to :rack_test, added shared :webrat, so
65
+ you can run your specs with that as well. Also move the bacon-specific code
66
+ to ramaze/spec/bacon, prepare for test-framework-agnostic behaviour.
67
+ [ f1a2669 | c12a0a4 | fdde916 ]
68
+ - Fix ordering of middleware [ 508bffc ]
69
+ - Warn and fix the ttl if someone exceeds the maximum ttl allowed by MemCache
70
+ [ 3124879 | bc08091 ]
71
+ - Comaptibility with localmemcache 0.4.0 [ 096f051 ]
72
+ - Fixed Cache::Sequel to work with 3.1.0 [ d2c2b85 ]
73
+ - Fix bug with memcache on 1.9, make sure the Etag middleware works on it
74
+ [ 21763df | 1d0dff5 ]
75
+ - A little bit of example-usage for Helper::Form#form_select, improve by
76
+ allowing :multiple => 10 [ a634582 | de73014 ]
77
+ - Avoid useless iteration and fix ambigous linking in helper/paginate
78
+ [ 6fb74df | 9b73450 ]
79
+ - Respect preset options for port/adapter on ramaze start [ 6efaaaa ]
80
+ - Preserve file permissions during `ramaze create` [ 3e3bc0a ]
81
+ - Implement and spec the lonely controller rule [ fdfe5b9 | 4dd866b ]
82
+ - Fix "bug" pointed out by druby [ 796627a ]
83
+ - Output to logger in ramaze/setup if Log is available, don't output the
84
+ require exception twice. Avoid infinite recursion when a
85
+ gem name does not match it's lib name [ b9fa0c4 | 7bc9d65 | e6b4996 ]
86
+ - Put a notice into config.ru making clear that the handler cannot be set
87
+ inside [ b4bad57 ]
88
+ - Some mods to contrib, fix facebook.rb syntax for ruby 1.9 and adding
89
+ Ramaze::AddressableRoute for great profit! [ c7fbf0c | cafe657 ]
90
+ - Don't write a file to /tmp during the bin/ramaze spec [ eb5e4ef ]
91
+
92
+ - Pistos
93
+ - Explicitly state top-level namespace for ::File in config.ru, since
94
+ otherwise it is confused for Rack::File.
95
+ [ 5509950 ]
96
+ - Added Layout helper with specs and documentation
97
+ [ a84f675 | 41ad023 | 4f23d16 ]
98
+
99
+ - TJ Vanderpoel (bougyman)
100
+ - Added some specs for ramaze/bin, correcting a require bug already in
101
+ bin/ramaze. [ 8bbb8e8 | 9a3edf3 | 33fa3aa ]
58
102
 
59
103
  A complete Changelog is available at
60
104
  http://github.com/manveru/ramaze/tree/master/doc/CHANGELOG?raw=true
61
105
 
62
106
 
63
- Known issues:
107
+ == Known issues
108
+
109
+ - Some problems may show up when running the specs, these are mostly caused
110
+ by the gem-versions of Rack::Test and Rack, they only affect the specs and
111
+ should have no influence on the actual runtime.
64
112
 
65
- - none yet, waiting for your reports :)
66
113
 
114
+ == Ramaze Features
67
115
 
68
- Ramaze Features:
69
- - Builds on top of the Rack library, which provides easy use of adapters like
70
- Mongrel, WEBrick, LiteSpeed, Thin, CGI or FCGI.
116
+ - Builds on top of the Rack library, which provides easy use of adapters like
117
+ Mongrel, WEBrick, LiteSpeed, Thin, CGI or FCGI.
71
118
 
72
- - Supports a wide range of templating-engines like: Amrita2, Erubis, Haml,
73
- Liquid, Markaby, Remarkably and its own engine called Ezamar and (still
74
- unofficial) Nagoro.
119
+ - Supports a wide range of templating-engines like: ERB, Erubis, Haml, Liquid,
120
+ Maruku, Redcloth, Remarkably, Sass, Tagz, Tenjin. And its own engines called
121
+ Etanni, Ezamar, Gestalt, and Nagoro.
75
122
 
76
- - Highly modular structure: you can just use the parts you like. This also
77
- means that it's very simple to add your own customizations.
123
+ - Highly modular structure: you can just use the parts you like. This also
124
+ means that it's very simple to add your own customizations.
78
125
 
79
- - A variety of helpers is already available, giving you things like advanced
80
- caching, OpenID-authentication or aspect-oriented programming for your
81
- controllers.
126
+ - A variety of helpers is already available, giving you things like advanced
127
+ caching, OpenID-authentication or aspect-oriented programming for your
128
+ controllers.
82
129
 
83
- - It is possible to use the ORM you like, be it Sequel, DataMapper,
84
- ActiveRecord, Og, Kansas or something more simplistic like DBI, or a
85
- wrapper around YAML::Store.
130
+ - It is possible to use the ORM you like, be it Sequel, DataMapper,
131
+ ActiveRecord, Og, Kansas or something more simplistic like DBI, or a wrapper
132
+ around YAML::Store.
86
133
 
87
- - Good documentation: although we don't have 100% documentation right now
88
- (dcov says around 75%), just about every part of Ramaze is covered with
89
- basic and advanced docs. There are a variety of examples, screencasts and a
90
- tutorial available.
134
+ - Good documentation: although we don't have 100% documentation right now (dcov
135
+ says around 75%), just about every part of Ramaze is covered with basic and
136
+ advanced docs. There are a variety of examples, screencasts and a tutorial
137
+ available.
91
138
 
92
- - Friendly community: there are people from all over the world using Ramaze,
93
- so you can get almost instant help and info.
139
+ - Friendly community: there are people from all over the world using Ramaze, so
140
+ you can get almost instant help and info.
94
141
 
95
142
 
96
143
  For more information please come to http://ramaze.net or ask directly on IRC
@@ -444,16 +444,16 @@ be because Ramaze changed (which happens very often while it is still young)
444
444
  or I actually made some mistake while writing it.</p></div>
445
445
  <div class="paragraph"><p>In either case it would make me (and all other poor fellows who happen to try
446
446
  this tutorial) very happy if you could spare some time and report the issue
447
- either on the <a href="http://ramazetrac.purepistos.org/">Bug tracker</a>, or just
447
+ either on the <a href="http://github.com/manveru/ramaze/issues">Bug tracker</a> , or just
448
448
  drop by on IRC on <tt>irc.freenode.org</tt> in the channel <tt>#ramaze</tt>.</p></div>
449
449
  <div class="paragraph"><p>If you have trouble with some of the terms used in this tutorial you can
450
450
  consult the <a href="#glossary">Glossary</a> at the end of this document.</p></div>
451
451
  <div class="paragraph"><p>We are also working on a book that describes Ramaze in more depth, called
452
452
  <em>Journey to Ramaze</em>, it is still very much work in progress, but some of the
453
453
  contents might interest you.</p></div>
454
- <div class="paragraph"><p>The repository for the book is at <a href="http://github.com/manveru/ramaze-book">http://github.com/manveru/ramaze-book</a>.
455
- Every once in a while, updates for the book will be available in HTML and PDF
456
- form at <a href="http://book.ramaze.net">http://book.ramaze.net</a>.</p></div>
454
+ <div class="paragraph"><p>The repository for the book is at <a href="http://github.com/manveru/ramaze-book">http://github.com/manveru/ramaze-book</a>. Every
455
+ once in a while, updates for the book will be put in HTML and PDF form at
456
+ <a href="http://book.ramaze.net">http://book.ramaze.net</a>.</p></div>
457
457
  </div>
458
458
  <h2 id="_first_step_create">First Step, Create</h2>
459
459
  <div class="sectionbody">
@@ -514,7 +514,7 @@ http://www.gnu.org/software/src-highlite -->
514
514
  <pre><tt><span style="font-weight: bold"><span style="color: #000080">require</span></span> <span style="color: #FF0000">'rubygems'</span>
515
515
  <span style="font-weight: bold"><span style="color: #000080">require</span></span> <span style="color: #FF0000">'ramaze'</span>
516
516
 
517
- <span style="font-weight: bold"><span style="color: #0000FF">class</span></span> Hello <span style="color: #990000">&lt;</span> Ramaze<span style="color: #990000">::</span>Controller
517
+ <span style="font-weight: bold"><span style="color: #0000FF">class</span></span> MainController <span style="color: #990000">&lt;</span> Ramaze<span style="color: #990000">::</span>Controller
518
518
  <span style="font-weight: bold"><span style="color: #0000FF">def</span></span> index
519
519
  <span style="color: #FF0000">"Hello, World!"</span>
520
520
  <span style="font-weight: bold"><span style="color: #0000FF">end</span></span>
@@ -767,56 +767,20 @@ http://www.gnu.org/software/src-highlite -->
767
767
  &lt;?r Task.each do |task| ?&gt;
768
768
  <span style="font-weight: bold"><span style="color: #0000FF">&lt;li&gt;</span></span>
769
769
  #{ h(task.title) }: #{ task.done },
770
- (#{ anchor('close', route('close', url_encode(task.title))) })
770
+ (#{ anchor('close', 'close', task.title) })
771
771
  <span style="font-weight: bold"><span style="color: #0000FF">&lt;/li&gt;</span></span>
772
772
  &lt;?r end ?&gt;
773
773
  <span style="font-weight: bold"><span style="color: #0000FF">&lt;/ul&gt;</span></span></tt></pre></div></div>
774
774
  <div class="paragraph"><p>Now we have an additional link next to each task that allows us to set it to
775
775
  done.</p></div>
776
- <div class="paragraph"><p>The line we added requires some closer examination, it consists of following
777
- parts (from inside out and with intermediate variables and annotation):</p></div>
778
- <div class="listingblock">
779
- <div class="content"><!-- Generator: GNU source-highlight 2.11.1
780
- by Lorenzo Bettini
781
- http://www.lorenzobettini.it
782
- http://www.gnu.org/software/src-highlite -->
783
- <pre><tt>title <span style="color: #990000">=</span> task<span style="color: #990000">.</span>title <span style="color: #FF0000"><b>&lt;1&gt;</b></span>
784
- url_title <span style="color: #990000">=</span> url_encode<span style="color: #990000">(</span>title<span style="color: #990000">)</span> <span style="color: #FF0000"><b>&lt;2&gt;</b></span>
785
- action <span style="color: #990000">=</span> route<span style="color: #990000">(</span><span style="color: #FF0000">'close'</span><span style="color: #990000">,</span> url_title<span style="color: #990000">)</span> <span style="color: #FF0000"><b>&lt;3&gt;</b></span>
786
- link <span style="color: #990000">=</span> anchor<span style="color: #990000">(</span><span style="color: #FF0000">'close'</span><span style="color: #990000">,</span> action<span style="color: #990000">)</span> <span style="color: #FF0000"><b>&lt;4&gt;</b></span></tt></pre></div></div>
787
- <div class="colist arabic"><ol>
788
- <li>
789
- <p>
790
- Obtain the title of the task from the Model object.
791
- </p>
792
- </li>
793
- <li>
794
- <p>
795
- Encode the title for use in an URL.
796
- </p>
797
- </li>
798
- <li>
799
- <p>
800
- Ask the Controller about it&#8217;s mapping for the <em>close</em> action and build a
801
- link from that, this means that if you ever change the mapping of the
802
- <tt>Tasks</tt> Controller, you will not have to change any links.
803
- </p>
804
- </li>
805
- <li>
806
- <p>
807
- Finally create the anchor tag that will look like:
808
- <tt>&lt;a href="/close/Wash+dishes"&gt;close&lt;/a&gt;</tt>
809
- </p>
810
- </li>
811
- </ol></div>
812
776
  <div class="paragraph"><p>An even shorter way of writing that line using default aliases, that you will
813
- encounter in other applications is:</p></div>
777
+ encounter in other applications, is:</p></div>
814
778
  <div class="listingblock">
815
779
  <div class="content"><!-- Generator: GNU source-highlight 2.11.1
816
780
  by Lorenzo Bettini
817
781
  http://www.lorenzobettini.it
818
782
  http://www.gnu.org/software/src-highlite -->
819
- <pre><tt> a<span style="color: #990000">(</span><span style="color: #FF0000">'close'</span><span style="color: #990000">,</span> r<span style="color: #990000">(</span><span style="color: #FF0000">'close'</span><span style="color: #990000">,</span> u<span style="color: #990000">(</span>task<span style="color: #990000">.</span>title<span style="color: #990000">)))</span></tt></pre></div></div>
783
+ <pre><tt>a<span style="color: #990000">(</span><span style="color: #FF0000">'close'</span><span style="color: #990000">,</span> <span style="color: #FF0000">'close'</span><span style="color: #990000">,</span> task<span style="color: #990000">.</span>title<span style="color: #990000">)</span></tt></pre></div></div>
820
784
  <div class="paragraph"><p>But for the purpose of this tutorial we&#8217;ll try to be as explicit as possible.</p></div>
821
785
  <div class="paragraph"><p>Now that&#8217;s a lot of things at once, but I&#8217;m sure you will be able to keep up,
822
786
  the hardest part is behind us.</p></div>
@@ -862,8 +826,8 @@ http://www.gnu.org/software/src-highlite -->
862
826
  &lt;?r Task.each do |task| ?&gt;
863
827
  <span style="font-weight: bold"><span style="color: #0000FF">&lt;li&gt;</span></span>
864
828
  #{ h(task.title) }: #{ task.done },
865
- (#{ anchor('close', route('close', url_encode(task.title))) })
866
- (#{ anchor('open', route('open', url_encode(task.title))) })
829
+ (#{ anchor('close', 'close', task.title) })
830
+ (#{ anchor('open', 'open', task.title) })
867
831
  <span style="font-weight: bold"><span style="color: #0000FF">&lt;/li&gt;</span></span>
868
832
  &lt;?r end ?&gt;
869
833
  <span style="font-weight: bold"><span style="color: #0000FF">&lt;/ul&gt;</span></span></tt></pre></div></div>
@@ -915,9 +879,9 @@ http://www.gnu.org/software/src-highlite -->
915
879
  &lt;?r Task.each do |task| ?&gt;
916
880
  <span style="font-weight: bold"><span style="color: #0000FF">&lt;li&gt;</span></span>
917
881
  #{ h(task.title) }: #{ task.done },
918
- (#{ anchor('close', route('close', url_encode(task.title))) })
919
- (#{ anchor('open', route('open', url_encode(task.title))) })
920
- (#{ anchor('delete', route('delete', url_encode(task.title))) })
882
+ (#{ anchor('close', 'close', task.title)})
883
+ (#{ anchor('open', 'open', task.title)})
884
+ (#{ anchor('delete', 'delete', task.title)})
921
885
  <span style="font-weight: bold"><span style="color: #0000FF">&lt;/li&gt;</span></span>
922
886
  &lt;?r end ?&gt;
923
887
  <span style="font-weight: bold"><span style="color: #0000FF">&lt;/ul&gt;</span></span></tt></pre></div></div>
@@ -1146,8 +1110,8 @@ http://www.gnu.org/software/src-highlite -->
1146
1110
  &lt;?r Task.filter(:done =&gt; true).each do |task| ?&gt;
1147
1111
  <span style="font-weight: bold"><span style="color: #0000FF">&lt;li&gt;</span></span>
1148
1112
  #{ h(task.title) }: #{ task.done },
1149
- (#{ anchor('open', route('open', url_encode(task.title))) })
1150
- (#{ anchor('delete', route('delete', url_encode(task.title))) })
1113
+ (#{ anchor('open', 'open', task.title) })
1114
+ (#{ anchor('delete', 'delete', task.title) })
1151
1115
  <span style="font-weight: bold"><span style="color: #0000FF">&lt;/li&gt;</span></span>
1152
1116
  &lt;?r end ?&gt;
1153
1117
  <span style="font-weight: bold"><span style="color: #0000FF">&lt;/ul&gt;</span></span>
@@ -1206,14 +1170,14 @@ http://www.lorenzobettini.it
1206
1170
  http://www.gnu.org/software/src-highlite -->
1207
1171
  <pre><tt><span style="font-weight: bold"><span style="color: #0000FF">&lt;h2&gt;</span></span>Done Tasks<span style="font-weight: bold"><span style="color: #0000FF">&lt;/h2&gt;</span></span>
1208
1172
 
1209
- #{ anchor('Pending tasks', route('done')) }
1173
+ #{ anchor('Pending tasks', 'done') }
1210
1174
 
1211
1175
  <span style="font-weight: bold"><span style="color: #0000FF">&lt;ul&gt;</span></span>
1212
1176
  &lt;?r Task.filter(:done =&gt; false).each do |task| ?&gt;
1213
1177
  <span style="font-weight: bold"><span style="color: #0000FF">&lt;li&gt;</span></span>
1214
1178
  #{ h(task.title) },
1215
- (#{ anchor('close', route('close', url_encode(task.title))) })
1216
- (#{ anchor('delete', route('delete', url_encode(task.title))) })
1179
+ (#{ anchor('close', 'close', task.title) })
1180
+ (#{ anchor('delete', 'delete', task.title) })
1217
1181
  <span style="font-weight: bold"><span style="color: #0000FF">&lt;/li&gt;</span></span>
1218
1182
  &lt;?r end ?&gt;
1219
1183
  <span style="font-weight: bold"><span style="color: #0000FF">&lt;/ul&gt;</span></span></tt></pre></div></div>
@@ -1225,14 +1189,14 @@ http://www.lorenzobettini.it
1225
1189
  http://www.gnu.org/software/src-highlite -->
1226
1190
  <pre><tt><span style="font-weight: bold"><span style="color: #0000FF">&lt;h2&gt;</span></span>Pending Tasks<span style="font-weight: bold"><span style="color: #0000FF">&lt;/h2&gt;</span></span>
1227
1191
 
1228
- #{ anchor('Done tasks', route('done')) }
1192
+ #{ anchor('Done tasks', 'done') }
1229
1193
 
1230
1194
  <span style="font-weight: bold"><span style="color: #0000FF">&lt;ul&gt;</span></span>
1231
1195
  &lt;?r Task.filter(:done =&gt; true).each do |task| ?&gt;
1232
1196
  <span style="font-weight: bold"><span style="color: #0000FF">&lt;li&gt;</span></span>
1233
1197
  #{ h(task.title) },
1234
- (#{ anchor('open', route('open', url_encode(task.title))) })
1235
- (#{ anchor('delete', route('delete', url_encode(task.title))) })
1198
+ (#{ anchor('open', 'open', task.title) })
1199
+ (#{ anchor('delete', 'delete', task.title) })
1236
1200
  <span style="font-weight: bold"><span style="color: #0000FF">&lt;/li&gt;</span></span>
1237
1201
  &lt;?r end ?&gt;
1238
1202
  <span style="font-weight: bold"><span style="color: #0000FF">&lt;/ul&gt;</span></span></tt></pre></div></div>
@@ -1408,7 +1372,7 @@ RSI
1408
1372
  <div id="footer">
1409
1373
  <div id="footer-text">
1410
1374
  Version 2.0<br />
1411
- Last updated 2009-04-07 19:08:12 JST
1375
+ Last updated 2009-05-10 10:37:49 JST
1412
1376
  </div>
1413
1377
  </div>
1414
1378
  </body>
@@ -26,7 +26,7 @@ or I actually made some mistake while writing it.
26
26
 
27
27
  In either case it would make me (and all other poor fellows who happen to try
28
28
  this tutorial) very happy if you could spare some time and report the issue
29
- either on the http://ramazetrac.purepistos.org/[Bug tracker], or just
29
+ either on the http://github.com/manveru/ramaze/issues[Bug tracker] , or just
30
30
  drop by on IRC on `irc.freenode.org` in the channel `#ramaze`.
31
31
 
32
32
  If you have trouble with some of the terms used in this tutorial you can
@@ -36,9 +36,9 @@ We are also working on a book that describes Ramaze in more depth, called
36
36
  'Journey to Ramaze', it is still very much work in progress, but some of the
37
37
  contents might interest you.
38
38
 
39
- The repository for the book is at http://github.com/manveru/ramaze-book.
40
- Every once in a while, updates for the book will be available in HTML and PDF
41
- form at http://book.ramaze.net.
39
+ The repository for the book is at http://github.com/manveru/ramaze-book. Every
40
+ once in a while, updates for the book will be put in HTML and PDF form at
41
+ http://book.ramaze.net.
42
42
 
43
43
 
44
44
  == First Step, Create
@@ -351,7 +351,7 @@ change the status of a task:
351
351
  <?r Task.each do |task| ?>
352
352
  <li>
353
353
  #{ h(task.title) }: #{ task.done },
354
- (#{ anchor('close', route('close', url_encode(task.title))) })
354
+ (#{ anchor('close', 'close', task.title) })
355
355
  </li>
356
356
  <?r end ?>
357
357
  </ul>
@@ -360,31 +360,12 @@ change the status of a task:
360
360
  Now we have an additional link next to each task that allows us to set it to
361
361
  done.
362
362
 
363
- The line we added requires some closer examination, it consists of following
364
- parts (from inside out and with intermediate variables and annotation):
365
-
366
- [source,ruby]
367
- ----
368
- title = task.title <1>
369
- url_title = url_encode(title) <2>
370
- action = route('close', url_title) <3>
371
- link = anchor('close', action) <4>
372
- ----
373
-
374
- <1> Obtain the title of the task from the Model object.
375
- <2> Encode the title for use in an URL.
376
- <3> Ask the Controller about it's mapping for the 'close' action and build a
377
- link from that, this means that if you ever change the mapping of the
378
- `Tasks` Controller, you will not have to change any links.
379
- <4> Finally create the anchor tag that will look like:
380
- `<a href="/close/Wash+dishes">close</a>`
381
-
382
363
  An even shorter way of writing that line using default aliases, that you will
383
- encounter in other applications is:
364
+ encounter in other applications, is:
384
365
 
385
366
  [source,ruby]
386
367
  --------------------------------------------------------------------------------
387
- a('close', r('close', u(task.title)))
368
+ a('close', 'close', task.title)
388
369
  --------------------------------------------------------------------------------
389
370
 
390
371
  But for the purpose of this tutorial we'll try to be as explicit as possible.
@@ -433,8 +414,8 @@ And add a link to that action:
433
414
  <?r Task.each do |task| ?>
434
415
  <li>
435
416
  #{ h(task.title) }: #{ task.done },
436
- (#{ anchor('close', route('close', url_encode(task.title))) })
437
- (#{ anchor('open', route('open', url_encode(task.title))) })
417
+ (#{ anchor('close', 'close', task.title) })
418
+ (#{ anchor('open', 'open', task.title) })
438
419
  </li>
439
420
  <?r end ?>
440
421
  </ul>
@@ -490,9 +471,9 @@ And a link to the `delete` action.
490
471
  <?r Task.each do |task| ?>
491
472
  <li>
492
473
  #{ h(task.title) }: #{ task.done },
493
- (#{ anchor('close', route('close', url_encode(task.title))) })
494
- (#{ anchor('open', route('open', url_encode(task.title))) })
495
- (#{ anchor('delete', route('delete', url_encode(task.title))) })
474
+ (#{ anchor('close', 'close', task.title)})
475
+ (#{ anchor('open', 'open', task.title)})
476
+ (#{ anchor('delete', 'delete', task.title)})
496
477
  </li>
497
478
  <?r end ?>
498
479
  </ul>
@@ -715,8 +696,8 @@ So off we go and add a new template at 'view/done.xhtml'.
715
696
  <?r Task.filter(:done => true).each do |task| ?>
716
697
  <li>
717
698
  #{ h(task.title) }: #{ task.done },
718
- (#{ anchor('open', route('open', url_encode(task.title))) })
719
- (#{ anchor('delete', route('delete', url_encode(task.title))) })
699
+ (#{ anchor('open', 'open', task.title) })
700
+ (#{ anchor('delete', 'delete', task.title) })
720
701
  </li>
721
702
  <?r end ?>
722
703
  </ul>
@@ -780,14 +761,14 @@ boilerplate we can delete the slack from our templates.
780
761
  --------------------------------------------------------------------------------
781
762
  <h2>Done Tasks</h2>
782
763
 
783
- #{ anchor('Pending tasks', route('done')) }
764
+ #{ anchor('Pending tasks', 'done') }
784
765
 
785
766
  <ul>
786
767
  <?r Task.filter(:done => false).each do |task| ?>
787
768
  <li>
788
769
  #{ h(task.title) },
789
- (#{ anchor('close', route('close', url_encode(task.title))) })
790
- (#{ anchor('delete', route('delete', url_encode(task.title))) })
770
+ (#{ anchor('close', 'close', task.title) })
771
+ (#{ anchor('delete', 'delete', task.title) })
791
772
  </li>
792
773
  <?r end ?>
793
774
  </ul>
@@ -799,14 +780,14 @@ boilerplate we can delete the slack from our templates.
799
780
  --------------------------------------------------------------------------------
800
781
  <h2>Pending Tasks</h2>
801
782
 
802
- #{ anchor('Done tasks', route('done')) }
783
+ #{ anchor('Done tasks', 'done') }
803
784
 
804
785
  <ul>
805
786
  <?r Task.filter(:done => true).each do |task| ?>
806
787
  <li>
807
788
  #{ h(task.title) },
808
- (#{ anchor('open', route('open', url_encode(task.title))) })
809
- (#{ anchor('delete', route('delete', url_encode(task.title))) })
789
+ (#{ anchor('open', 'open', task.title) })
790
+ (#{ anchor('delete', 'delete', task.title) })
810
791
  </li>
811
792
  <?r end ?>
812
793
  </ul>