ramaze 2009.05 → 2009.06

Sign up to get free protection for your applications and to get access to all the features.
Files changed (117) hide show
  1. data/.gitignore +3 -0
  2. data/MANIFEST +11 -7
  3. data/README.md +3 -3
  4. data/Rakefile +17 -15
  5. data/bin/ramaze +7 -2
  6. data/doc/AUTHORS +6 -5
  7. data/doc/CHANGELOG +10057 -12259
  8. data/doc/meta/announcement.txt +93 -46
  9. data/doc/tutorial/todolist.html +22 -58
  10. data/doc/tutorial/todolist.txt +20 -39
  11. data/examples/app/wikore/src/model.rb +7 -1
  12. data/examples/app/wiktacular/template/html_layout.xhtml +1 -1
  13. data/lib/proto/config.ru +5 -1
  14. data/lib/ramaze/cache/localmemcache.rb +1 -1
  15. data/lib/ramaze/cache/memcache.rb +26 -1
  16. data/lib/ramaze/cache/sequel.rb +9 -6
  17. data/lib/ramaze/contrib/addressable_route.rb +55 -0
  18. data/lib/ramaze/contrib/facebook/facebook.rb +4 -4
  19. data/lib/ramaze/controller.rb +28 -18
  20. data/lib/ramaze/gestalt.rb +1 -1
  21. data/lib/ramaze/helper/auth.rb +0 -5
  22. data/lib/ramaze/helper/cache.rb +0 -9
  23. data/lib/ramaze/helper/form.rb +14 -2
  24. data/lib/ramaze/helper/formatting.rb +1 -1
  25. data/lib/ramaze/helper/layout.rb +97 -0
  26. data/lib/ramaze/helper/link.rb +6 -25
  27. data/lib/ramaze/helper/paginate.rb +2 -2
  28. data/lib/ramaze/helper/user.rb +3 -3
  29. data/lib/ramaze/helper.rb +1 -0
  30. data/lib/ramaze/setup.rb +22 -9
  31. data/lib/ramaze/spec/bacon.rb +34 -0
  32. data/lib/ramaze/spec/helper/template_examples.rb +13 -23
  33. data/lib/ramaze/spec.rb +8 -9
  34. data/lib/ramaze/tool/bin.rb +16 -6
  35. data/lib/ramaze/tool/project_creator.rb +1 -1
  36. data/lib/ramaze/version.rb +1 -1
  37. data/lib/ramaze.rb +8 -8
  38. data/lib/vendor/etag.rb +4 -2
  39. data/lib/vendor/route_exceptions.rb +6 -11
  40. data/ramaze.gemspec +52 -8
  41. data/spec/contrib/addressable_route.rb +32 -0
  42. data/spec/contrib/rest.rb +1 -1
  43. data/spec/examples/caching.rb +1 -1
  44. data/spec/examples/css.rb +1 -1
  45. data/spec/examples/element.rb +1 -1
  46. data/spec/examples/hello.rb +1 -1
  47. data/spec/examples/helpers/httpdigest.rb +1 -1
  48. data/spec/examples/linking.rb +1 -1
  49. data/spec/examples/simple.rb +1 -1
  50. data/spec/examples/templates/template_erubis.rb +3 -2
  51. data/spec/examples/templates/template_ezamar.rb +3 -2
  52. data/spec/examples/templates/template_haml.rb +3 -2
  53. data/spec/examples/templates/template_liquid.rb +3 -2
  54. data/spec/examples/templates/template_markaby.rb +5 -4
  55. data/spec/examples/templates/template_nagoro.rb +3 -3
  56. data/spec/examples/templates/template_redcloth.rb +3 -2
  57. data/spec/examples/templates/template_remarkably.rb +3 -2
  58. data/spec/examples/templates/template_tenjin.rb +3 -2
  59. data/spec/helper.rb +1 -2
  60. data/spec/ramaze/app.rb +1 -1
  61. data/spec/ramaze/bin/ramaze.rb +91 -0
  62. data/spec/ramaze/cache/memcache.rb +6 -0
  63. data/spec/ramaze/controller/actionless_templates.rb +1 -1
  64. data/spec/ramaze/controller/lonely_mapping.rb +16 -0
  65. data/spec/ramaze/controller/mapping.rb +0 -14
  66. data/spec/ramaze/controller/provide_inheritance.rb +1 -1
  67. data/spec/ramaze/controller/resolve.rb +1 -1
  68. data/spec/ramaze/controller/subclass.rb +1 -1
  69. data/spec/ramaze/controller/template_resolving.rb +1 -1
  70. data/spec/ramaze/dispatcher/directory.rb +1 -1
  71. data/spec/ramaze/dispatcher/file.rb +7 -7
  72. data/spec/ramaze/error.rb +2 -2
  73. data/spec/ramaze/files.rb +1 -1
  74. data/spec/ramaze/helper/auth.rb +1 -1
  75. data/spec/ramaze/helper/bench.rb +2 -1
  76. data/spec/ramaze/helper/cache.rb +1 -1
  77. data/spec/ramaze/helper/flash.rb +1 -1
  78. data/spec/ramaze/helper/form.rb +2 -2
  79. data/spec/ramaze/helper/httpdigest.rb +3 -3
  80. data/spec/ramaze/helper/layout/default.xhtml +5 -0
  81. data/spec/ramaze/helper/layout.rb +79 -0
  82. data/spec/ramaze/helper/link.rb +32 -11
  83. data/spec/ramaze/helper/localize.rb +1 -1
  84. data/spec/ramaze/helper/maruku.rb +1 -1
  85. data/spec/ramaze/helper/pager.rb +1 -1
  86. data/spec/ramaze/helper/paginate.rb +1 -1
  87. data/spec/ramaze/helper/request_accessor.rb +1 -1
  88. data/spec/ramaze/helper/sequel_form.rb +1 -1
  89. data/spec/ramaze/helper/simple_captcha.rb +1 -1
  90. data/spec/ramaze/helper/stack.rb +1 -1
  91. data/spec/ramaze/helper/user.rb +1 -1
  92. data/spec/ramaze/params.rb +4 -5
  93. data/spec/ramaze/session/memcache.rb +66 -0
  94. data/spec/ramaze/view/erubis.rb +1 -1
  95. data/spec/ramaze/view/ezamar.rb +1 -1
  96. data/spec/ramaze/view/gestalt.rb +1 -1
  97. data/spec/ramaze/view/haml.rb +1 -1
  98. data/spec/ramaze/view/liquid.rb +1 -1
  99. data/spec/ramaze/view/nagoro.rb +1 -1
  100. data/spec/ramaze/view/redcloth.rb +1 -1
  101. data/spec/ramaze/view/remarkably.rb +1 -1
  102. data/spec/ramaze/view/sass.rb +1 -1
  103. data/spec/ramaze/view/tagz.rb +1 -1
  104. data/spec/ramaze/view/tenjin.rb +1 -1
  105. data/spec/ramaze/view.rb +1 -1
  106. data/tasks/changelog.rake +3 -1
  107. data/tasks/{gem_installer.rake → gem_setup.rake} +45 -22
  108. data/tasks/release.rake +6 -4
  109. data/tasks/setup.rake +3 -21
  110. data/tasks/todo.rake +2 -4
  111. metadata +164 -10
  112. data/CHANGELOG +0 -16918
  113. data/doc/tutorial/todolist.mkd +0 -787
  114. data/lib/ramaze/snippets/divide.rb +0 -22
  115. data/lib/ramaze/snippets/object/acquire.rb +0 -37
  116. data/spec/snippets/kernel/constant.rb +0 -23
  117. 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>