ramaze 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. data/Rakefile +52 -19
  2. data/bin/ramaze +19 -6
  3. data/doc/CHANGELOG +33 -0
  4. data/doc/COPYING +1 -1
  5. data/doc/FAQ +92 -0
  6. data/doc/GPL +340 -0
  7. data/doc/INSTALL +34 -0
  8. data/doc/ProjectInfo +53 -0
  9. data/doc/README +187 -110
  10. data/doc/readme_chunks/appendix.txt +13 -0
  11. data/doc/readme_chunks/examples.txt +38 -0
  12. data/doc/readme_chunks/features.txt +82 -0
  13. data/doc/readme_chunks/getting_help.txt +5 -0
  14. data/doc/readme_chunks/getting_started.txt +18 -0
  15. data/doc/readme_chunks/installing.txt +41 -0
  16. data/doc/readme_chunks/introduction.txt +18 -0
  17. data/doc/readme_chunks/principles.txt +41 -0
  18. data/doc/readme_chunks/thanks.txt +59 -0
  19. data/doc/tutorial/todolist.txt +546 -0
  20. data/examples/blog/main.rb +1 -1
  21. data/examples/blog/src/controller.rb +13 -11
  22. data/examples/blog/src/element.rb +11 -6
  23. data/examples/blog/src/model.rb +8 -23
  24. data/examples/blog/template/edit.xhtml +3 -1
  25. data/examples/blog/template/index.xhtml +4 -4
  26. data/examples/caching.rb +4 -4
  27. data/examples/element.rb +10 -7
  28. data/examples/hello.rb +3 -4
  29. data/examples/simple.rb +5 -3
  30. data/examples/templates/template/external.amrita +19 -0
  31. data/examples/templates/template/{external.rmze → external.zmr} +2 -2
  32. data/examples/templates/template_amrita2.rb +48 -0
  33. data/examples/templates/template_erubis.rb +5 -2
  34. data/examples/templates/{template_ramaze.rb → template_ezamar.rb} +13 -7
  35. data/examples/templates/template_haml.rb +4 -1
  36. data/examples/templates/template_liquid.rb +2 -1
  37. data/examples/templates/template_markaby.rb +2 -1
  38. data/examples/todolist/conf/benchmark.yaml +35 -0
  39. data/examples/todolist/conf/debug.yaml +34 -0
  40. data/examples/todolist/conf/live.yaml +33 -0
  41. data/examples/todolist/conf/silent.yaml +31 -0
  42. data/examples/todolist/conf/stage.yaml +33 -0
  43. data/examples/todolist/main.rb +18 -0
  44. data/examples/todolist/public/404.jpg +0 -0
  45. data/examples/todolist/public/css/coderay.css +105 -0
  46. data/examples/todolist/public/css/ramaze_error.css +42 -0
  47. data/{lib/proto → examples/todolist}/public/error.xhtml +0 -0
  48. data/examples/todolist/public/favicon.ico +0 -0
  49. data/examples/todolist/public/js/jquery.js +1923 -0
  50. data/examples/todolist/public/ramaze.png +0 -0
  51. data/examples/todolist/src/controller/main.rb +56 -0
  52. data/examples/todolist/src/element/page.rb +26 -0
  53. data/examples/todolist/src/model.rb +14 -0
  54. data/examples/todolist/template/index.xhtml +17 -0
  55. data/examples/todolist/template/new.xhtml +7 -0
  56. data/examples/todolist/todolist.db +9 -0
  57. data/examples/whywiki/main.rb +3 -8
  58. data/examples/whywiki/template/show.xhtml +4 -0
  59. data/lib/proto/public/error.zmr +77 -0
  60. data/lib/proto/src/controller/main.rb +2 -1
  61. data/lib/proto/src/element/page.rb +2 -1
  62. data/lib/proto/src/model.rb +3 -2
  63. data/lib/ramaze.rb +7 -9
  64. data/lib/ramaze/adapter.rb +51 -0
  65. data/lib/ramaze/adapter/cgi.rb +23 -0
  66. data/lib/ramaze/adapter/fcgi.rb +22 -0
  67. data/lib/ramaze/adapter/mongrel.rb +7 -86
  68. data/lib/ramaze/adapter/webrick.rb +14 -133
  69. data/lib/ramaze/cache/memcached.rb +6 -0
  70. data/lib/ramaze/cache/yaml_store.rb +3 -1
  71. data/lib/ramaze/controller.rb +292 -2
  72. data/lib/ramaze/dispatcher.rb +85 -213
  73. data/lib/ramaze/error.rb +10 -0
  74. data/lib/ramaze/global.rb +8 -0
  75. data/lib/ramaze/helper/aspect.rb +30 -7
  76. data/lib/ramaze/helper/auth.rb +16 -9
  77. data/lib/ramaze/helper/cache.rb +40 -35
  78. data/lib/ramaze/helper/feed.rb +1 -1
  79. data/lib/ramaze/helper/flash.rb +34 -0
  80. data/lib/ramaze/helper/link.rb +8 -2
  81. data/lib/ramaze/helper/openid.rb +63 -0
  82. data/lib/ramaze/helper/redirect.rb +12 -11
  83. data/lib/ramaze/helper/stack.rb +5 -7
  84. data/lib/ramaze/inform.rb +12 -1
  85. data/lib/ramaze/snippets/kernel/aquire.rb +1 -1
  86. data/lib/ramaze/snippets/kernel/{self_method.rb → method.rb} +3 -18
  87. data/lib/ramaze/snippets/kernel/{rescue_require.rb → pretty_inspect.rb} +7 -6
  88. data/lib/ramaze/snippets/method/name.rb +22 -0
  89. data/lib/ramaze/snippets/{kernel → ramaze}/autoreload.rb +0 -0
  90. data/lib/ramaze/snippets/ramaze/caller_info.rb +14 -0
  91. data/lib/ramaze/snippets/{kernel → ramaze}/caller_lines.rb +3 -10
  92. data/lib/ramaze/snippets/rdoc/usage_no_exit.rb +49 -23
  93. data/lib/ramaze/snippets/string/DIVIDE.rb +0 -1
  94. data/lib/ramaze/store/default.rb +58 -2
  95. data/lib/ramaze/store/yaml.rb +161 -0
  96. data/lib/ramaze/template.rb +27 -86
  97. data/lib/ramaze/template/amrita2.rb +14 -19
  98. data/lib/ramaze/template/erubis.rb +15 -38
  99. data/lib/ramaze/template/ezamar.rb +100 -0
  100. data/lib/ramaze/template/ezamar/element.rb +166 -0
  101. data/lib/ramaze/template/ezamar/engine.rb +124 -0
  102. data/lib/ramaze/template/ezamar/morpher.rb +155 -0
  103. data/lib/ramaze/template/haml.rb +16 -43
  104. data/lib/ramaze/template/liquid.rb +11 -51
  105. data/lib/ramaze/template/markaby.rb +44 -42
  106. data/lib/ramaze/tool/mime.rb +18 -0
  107. data/lib/ramaze/tool/mime_types.yaml +615 -0
  108. data/lib/ramaze/trinity/request.rb +20 -196
  109. data/lib/ramaze/trinity/response.rb +4 -33
  110. data/lib/ramaze/trinity/session.rb +150 -72
  111. data/lib/ramaze/version.rb +1 -1
  112. data/spec/adapter_spec.rb +20 -0
  113. data/spec/public/favicon.ico +0 -0
  114. data/spec/public/ramaze.png +0 -0
  115. data/spec/public/test_download.css +141 -0
  116. data/spec/{tc_request.rb → request_tc_helper.rb} +45 -21
  117. data/spec/spec_all.rb +77 -34
  118. data/spec/spec_helper.rb +8 -157
  119. data/spec/spec_helper_context.rb +72 -0
  120. data/spec/spec_helper_requester.rb +52 -0
  121. data/spec/spec_helper_simple_http.rb +433 -0
  122. data/spec/tc_adapter_mongrel.rb +3 -15
  123. data/spec/tc_adapter_webrick.rb +4 -14
  124. data/spec/tc_cache.rb +3 -5
  125. data/spec/tc_controller.rb +22 -12
  126. data/spec/tc_dependencies.rb +13 -0
  127. data/spec/tc_element.rb +8 -7
  128. data/spec/tc_error.rb +13 -7
  129. data/spec/tc_global.rb +16 -18
  130. data/spec/tc_helper_aspect.rb +2 -4
  131. data/spec/tc_helper_auth.rb +15 -14
  132. data/spec/tc_helper_cache.rb +5 -7
  133. data/spec/tc_helper_feed.rb +0 -2
  134. data/spec/tc_helper_flash.rb +103 -0
  135. data/spec/tc_helper_form.rb +4 -6
  136. data/spec/tc_helper_link.rb +1 -3
  137. data/spec/tc_helper_redirect.rb +23 -8
  138. data/spec/tc_helper_stack.rb +31 -15
  139. data/spec/tc_morpher.rb +1 -3
  140. data/spec/tc_params.rb +48 -7
  141. data/spec/tc_request_mongrel.rb +9 -0
  142. data/spec/tc_request_webrick.rb +5 -0
  143. data/spec/tc_session.rb +41 -25
  144. data/spec/tc_store.rb +55 -6
  145. data/spec/tc_store_yaml.rb +71 -0
  146. data/spec/tc_template_amrita2.rb +3 -3
  147. data/spec/tc_template_erubis.rb +2 -3
  148. data/spec/{tc_template_ramaze.rb → tc_template_ezamar.rb} +15 -5
  149. data/spec/tc_template_haml.rb +4 -3
  150. data/spec/tc_template_liquid.rb +3 -4
  151. data/spec/tc_template_markaby.rb +4 -6
  152. data/spec/tc_tidy.rb +1 -3
  153. data/spec/template/amrita2/{data.html → data.amrita} +0 -0
  154. data/spec/template/amrita2/{index.html → index.amrita} +0 -0
  155. data/spec/template/amrita2/{sum.html → sum.amrita} +0 -0
  156. data/spec/template/ezamar/another/long/action.zmr +1 -0
  157. data/spec/template/ezamar/combined.zmr +1 -0
  158. data/spec/template/{ramaze/file_only.rmze → ezamar/file_only.zmr} +0 -0
  159. data/spec/template/{ramaze/index.rmze → ezamar/index.zmr} +0 -0
  160. data/spec/template/{ramaze/nested.rmze → ezamar/nested.zmr} +0 -0
  161. data/spec/template/ezamar/some__long__action.zmr +1 -0
  162. data/spec/template/{ramaze/sum.rmze → ezamar/sum.zmr} +0 -0
  163. metadata +181 -123
  164. data/doc/allison/LICENSE +0 -184
  165. data/doc/allison/README +0 -37
  166. data/doc/allison/allison.css +0 -300
  167. data/doc/allison/allison.gif +0 -0
  168. data/doc/allison/allison.js +0 -307
  169. data/doc/allison/allison.rb +0 -287
  170. data/doc/allison/cache/BODY +0 -588
  171. data/doc/allison/cache/CLASS_INDEX +0 -4
  172. data/doc/allison/cache/CLASS_PAGE +0 -1
  173. data/doc/allison/cache/FILE_INDEX +0 -4
  174. data/doc/allison/cache/FILE_PAGE +0 -1
  175. data/doc/allison/cache/FONTS +0 -1
  176. data/doc/allison/cache/FR_INDEX_BODY +0 -1
  177. data/doc/allison/cache/IMGPATH +0 -1
  178. data/doc/allison/cache/INDEX +0 -1
  179. data/doc/allison/cache/JAVASCRIPT +0 -307
  180. data/doc/allison/cache/METHOD_INDEX +0 -4
  181. data/doc/allison/cache/METHOD_LIST +0 -1
  182. data/doc/allison/cache/SRC_PAGE +0 -1
  183. data/doc/allison/cache/STYLE +0 -322
  184. data/doc/allison/cache/URL +0 -1
  185. data/doc/changes.txt +0 -2021
  186. data/doc/changes.xml +0 -2024
  187. data/lib/ramaze/snippets/kernel/silently.rb +0 -13
  188. data/lib/ramaze/snippets/thread/deadQUESTIONMARK.rb +0 -11
  189. data/lib/ramaze/template/haml/actionview_stub.rb +0 -20
  190. data/lib/ramaze/template/ramaze.rb +0 -177
  191. data/lib/ramaze/template/ramaze/element.rb +0 -166
  192. data/lib/ramaze/template/ramaze/morpher.rb +0 -156
  193. data/spec/tc_test.rb +0 -17
@@ -11,6 +11,6 @@ include Ramaze
11
11
  require 'src/controller'
12
12
  require 'src/element'
13
13
 
14
- Global.setup(YAML.load_file('conf/global.yaml'))
14
+ Global.setup
15
15
 
16
16
  start
@@ -1,16 +1,18 @@
1
1
  # Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
2
2
  # All files in this distribution are subject to the terms of the Ruby license.
3
3
 
4
- class MainController < Template::Ramaze
4
+ class MainController < Controller
5
5
  helper :form, :auth, :aspect
6
6
 
7
+ trait :auth_table => {'manveru' => Digest::SHA1.hexdigest('password')}
8
+
7
9
  def index
8
10
  @title = 'Ramaze Blog'
9
- @entries = Entry.all.reverse
11
+ @entries = Entry.keys.reverse.map{|k| Entry[k]}
10
12
  end
11
13
 
12
- def view oid
13
- @entry = Entry[oid.to_i]
14
+ def view eid
15
+ @entry = Entry[eid]
14
16
  end
15
17
 
16
18
  def new
@@ -18,25 +20,25 @@ class MainController < Template::Ramaze
18
20
  end
19
21
 
20
22
  def add
21
- entry = Entry.new.assign(request.params)
23
+ entry = Entry.new.merge!(request.params)
22
24
  entry.time = Time.now
23
25
  session[:result] = "#{entry.title} added successfully" if entry.save
24
26
  redirect :/
25
27
  end
26
28
 
27
- def edit oid
28
- @entry = Entry[oid.to_i]
29
+ def edit eid
30
+ @entry = Entry[eid]
29
31
  end
30
32
 
31
33
  def save
32
- redirect_referer unless oid = request.params.delete('oid').to_i
33
- entry = Entry[oid].assign(request.params)
34
+ redirect_referer unless eid = request.params.delete('eid')
35
+ entry = Entry[eid].merge!(request.params)
34
36
  session[:result] = "#{entry.title} saved successfully" if entry.save
35
37
  redirect :/
36
38
  end
37
39
 
38
- def delete oid
39
- if entry = Entry[oid.to_i]
40
+ def delete eid
41
+ if entry = Entry[eid]
40
42
  if entry.delete
41
43
  session[:result] = "#{entry.title} deleted successfully"
42
44
  else
@@ -1,8 +1,13 @@
1
- class Page < Element
2
- include Trinity
1
+ class Page < Controller
2
+ attr_accessor :content
3
3
  helper :auth
4
4
 
5
+ def initialize content
6
+ @content = content
7
+ end
8
+
5
9
  def render
10
+ p :render => content
6
11
  %{
7
12
  <html>
8
13
  <head>
@@ -24,7 +29,7 @@ class Page < Element
24
29
  <span id="title">
25
30
  <a href="#{R :/}">#{@title || 'Blogging Ramaze'}</a>
26
31
  </span>
27
- <?r if check_login ?>
32
+ <?r if logged_in? ?>
28
33
  <span id="login"> #{link R(:logout), :title => 'logout'} </span>
29
34
  <?r else ?>
30
35
  <span id="login"> #{link R(:login), :title => 'login'} </span>
@@ -35,13 +40,13 @@ class Page < Element
35
40
 
36
41
  def sidebar
37
42
  entries =
38
- Entry.all.map do |e|
43
+ Entry.all.map do |eid, e|
39
44
  %{
40
45
  <div>
41
- #{link R(:/, :view, e.oid), :title => e.title}
46
+ #{link R(:/, :view, eid), :title => e.title}
42
47
  </div>
43
48
  }
44
- end
49
+ end
45
50
 
46
51
  %{
47
52
  <div id="sidebar">
@@ -1,29 +1,14 @@
1
1
  # Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
2
2
  # All files in this distribution are subject to the terms of the Ruby license.
3
3
 
4
- begin
5
- require 'rubygems'
6
- gem 'facets', '=1.4.5'
7
- require '/home/manveru/prog/projects/nitroproject/glycerin'
8
- rescue LoadError
9
- end
10
-
11
- require 'og'
4
+ require 'ramaze/store/yaml'
12
5
 
13
- class Comment
14
- attr_accessor :text, String
15
- attr_accessor :time, Time
16
- attr_accessor :author_name, String
17
- attr_accessor :author_email, String
18
- end
19
-
20
- class Entry
21
- attr_accessor :title, String
22
- attr_accessor :text, String, :control => :textarea
23
- attr_accessor :time, Time
24
- has_many Comment
25
- end
6
+ Entry = Ramaze::Store::YAML.new :entry
26
7
 
27
- unless defined? Entry.ogmanager
28
- Og.setup
8
+ if Entry.empty?
9
+ entry = Entry.new
10
+ entry.time = Time.now
11
+ entry.title = 'Nothing special'
12
+ entry.text = 'even less special'
13
+ entry.save
29
14
  end
@@ -1,6 +1,8 @@
1
1
  <Page>
2
2
  <form method="POST" action="#{R self, :save}">
3
3
  <input type="hidden" name="oid" value="#{@entry.oid}" />
4
- #{form @entry, :deny => [/time/, /oid/]}
4
+ <input type="text" name="title" value="#{@entry.title}" />
5
+ <textarea name="text">#{@entry.text}</textarea>
6
+ <input type="submit" />
5
7
  </form>
6
8
  </Page>
@@ -12,13 +12,13 @@
12
12
  #{BlueCloth.new(entry.text.to_s).to_html}
13
13
  </div>
14
14
  <div class="menu">
15
- <?r if check_login ?>
16
- #{link self, :delete, entry.oid, :title => 'Delete'}
17
- #{link self, :edit, entry.oid, :title => 'Edit'}<br />
15
+ <?r if logged_in? ?>
16
+ #{link self, :delete, entry.eid, :title => 'Delete'}
17
+ #{link self, :edit, entry.eid, :title => 'Edit'}<br />
18
18
  <?r end ?>
19
19
  Entry #{@entries.size - i}/#{@entries.size}
20
20
  </div>
21
21
  </div>
22
22
  <?r end ?>
23
- #{link(self, :new, :title => 'New Entry') if check_login}
23
+ #{link(self, :new, :title => 'New Entry') if logged_in?}
24
24
  </Page>
@@ -2,9 +2,11 @@ require 'ramaze'
2
2
 
3
3
  include Ramaze
4
4
 
5
- class MainController < Template::Ramaze
5
+ class MainController < Controller
6
6
  helper :cache
7
7
 
8
+ trait :actions_cached => [:index]
9
+
8
10
  def index
9
11
  calc = "100_000 ** 100_00"
10
12
  %[
@@ -14,10 +16,8 @@ class MainController < Template::Ramaze
14
16
  end
15
17
 
16
18
  def invalidate
17
- uncache_all
19
+ action_cache.clear
18
20
  end
19
-
20
- cache :index
21
21
  end
22
22
 
23
23
  run
@@ -1,20 +1,23 @@
1
1
  require 'ramaze'
2
2
  include Ramaze
3
3
 
4
- class Page < Template::Ramaze::Element
4
+ class Page < Ezamar::Element
5
5
  def render
6
6
  %{
7
7
  <html>
8
- <h1>
9
- #{@hash['title']}
10
- </h1>
11
- #{content}
8
+ <head>
9
+ <title>examples/element</title>
10
+ </head>
11
+ <body>
12
+ <h1>#{@hash['title']}</h1>
13
+ #{content}
14
+ </body>
12
15
  </html>
13
16
  }
14
17
  end
15
18
  end
16
19
 
17
- class SideBar < Template::Ramaze::Element
20
+ class SideBar < Ezamar::Element
18
21
  def render
19
22
  %{
20
23
  <div class="sidebar">
@@ -24,7 +27,7 @@ class SideBar < Template::Ramaze::Element
24
27
  end
25
28
  end
26
29
 
27
- class MainController < Template::Ramaze
30
+ class MainController < Controller
28
31
  def index
29
32
  %{
30
33
  <Page title="Test">
@@ -6,18 +6,17 @@ require 'ramaze'
6
6
  include Ramaze
7
7
 
8
8
  # This is named MainController to automagically map it to '/'
9
- # Global.mapping['/'] => MainController
9
+ # Global.mapping['/'] = MainController
10
10
  # would do the same thing.
11
11
  # you can access it now with http://localhost:7000/
12
12
  # This should output
13
13
  # Hello, World!
14
14
  # in your browser
15
15
 
16
- class MainController < Template::Ramaze
16
+ class MainController < Controller
17
17
  def index
18
18
  "Hello, World!"
19
19
  end
20
20
  end
21
21
 
22
- # use this to start your app if you don't want to use the `ramaze` bin
23
- # start
22
+ start
@@ -22,7 +22,7 @@ require 'ramaze'
22
22
 
23
23
  include Ramaze
24
24
 
25
- class SimpleController < Template::Ramaze
25
+ class SimpleController < Controller
26
26
  def index
27
27
  "simple"
28
28
  end
@@ -48,13 +48,15 @@ class SimpleController < Template::Ramaze
48
48
  end
49
49
  end
50
50
 
51
- class OtherController < Template::Ramaze
51
+ class OtherController < Controller
52
52
  def index
53
53
  "Hello, World from #{self.class.name}"
54
54
  end
55
55
  end
56
56
 
57
- Global.mapping = {
57
+ Global.mapping = {
58
58
  '/' => SimpleController,
59
59
  '/other' => OtherController
60
60
  }
61
+
62
+ start
@@ -0,0 +1,19 @@
1
+ <html>
2
+ <head>
3
+ <title>Template::Amrita2 external</title>
4
+ </head>
5
+ <body>
6
+ <h1 id="title">Title</h1>
7
+ <a id="link_home">Home</a>
8
+ <p>
9
+ Here you can pass some stuff if you like, parameters are just passed like this:<br />
10
+ <a id="link_one"></a><br />
11
+ <a id="link_two"></a><br />
12
+ <a id="link_three"></a>
13
+ </p>
14
+ <div id="args">
15
+ *args
16
+ </div>
17
+ <div id="inspect_parameters"></div>
18
+ </body>
19
+ </html>
@@ -1,9 +1,9 @@
1
1
  <html>
2
2
  <head>
3
- <title>Template::Ramaze external</title>
3
+ <title>Template::Ezamar external</title>
4
4
  </head>
5
5
  <body>
6
- <h1>The #{@action} Template for Ramaze</h1>
6
+ <h1>The #{@action} Template for Ezamar</h1>
7
7
  #{link :/, :title => 'Home'}
8
8
  <p>
9
9
  Here you can pass some stuff if you like, parameters are just passed like this:<br />
@@ -0,0 +1,48 @@
1
+ # Copyright (c) 2006 Michael Fellinger m.fellinger@gmail.com
2
+ # All files in this distribution are subject to the terms of the Ruby license.
3
+
4
+ require 'ramaze'
5
+
6
+ include Ramaze
7
+
8
+ # TODO:
9
+ # implement the amrita2 example, man, this engine is awkward :P
10
+
11
+ class MainController < Controller
12
+
13
+ trait :engine => Template::Amrita2
14
+
15
+ def index
16
+ %{ #{link self.class} | #{link self.class, :internal} | #{link self.class, :external} }
17
+ end
18
+
19
+ def title
20
+ "The #{@action} Template for Ramaze"
21
+ end
22
+
23
+ def link_home
24
+ link :/, :title => 'Home'
25
+ end
26
+
27
+ def link_one
28
+ link self, @action, :one, :title => "#@action/one"
29
+ end
30
+
31
+ def link_two
32
+ link self, @action, :one, :two, :three, :title => "#@action/one/two/three"
33
+ end
34
+
35
+ def link_three
36
+ link self, @action, :one, :foo => :bar, :title => "#@action?foo=bar"
37
+ end
38
+
39
+ def inspect_parameters
40
+ request.params.inspect
41
+ end
42
+
43
+ def args
44
+ @params.map{|arg| "<span>#{arg}</span>"}.join(' ')
45
+ end
46
+ end
47
+
48
+ start
@@ -5,7 +5,10 @@ require 'ramaze'
5
5
 
6
6
  include Ramaze
7
7
 
8
- class MainController < Template::Erubis
8
+ class MainController < Controller
9
+
10
+ trait :engine => Template::Erubis
11
+
9
12
  def index
10
13
  %{ #{link self.class} | #{link self.class, :internal} | #{link self.class, :external} }
11
14
  end
@@ -15,7 +18,7 @@ class MainController < Template::Erubis
15
18
  transform %q{
16
19
  <html>
17
20
  <head>
18
- <title>Template::Ramaze internal</title>
21
+ <title>Template::Erubis internal</title>
19
22
  </head>
20
23
  <body>
21
24
  <h1>The <%= @action %> Template</h1>
@@ -5,25 +5,29 @@ require 'ramaze'
5
5
 
6
6
  include Ramaze
7
7
 
8
- class MainController < Template::Ramaze
8
+ class MainController < Controller
9
+
10
+ helper :link
11
+
9
12
  def index
10
13
  %{ #{link self.class} | #{link self.class, :internal} | #{link self.class, :external} }
11
14
  end
12
15
 
13
16
  def internal *args
14
17
  @args = args
15
- transform %q{
18
+ %q{
16
19
  <html>
17
20
  <head>
18
- <title>Template::Ramaze internal</title>
21
+ <title>Template::Ezamar internal</title>
19
22
  </head>
20
23
  <body>
21
- <h1>The #{@action} Template</h1>
24
+ <h1>The #{@action} Template for Ezamar</h1>
25
+ #{link :/, :title => 'Home'}
22
26
  <p>
23
27
  Here you can pass some stuff if you like, parameters are just passed like this:<br />
24
- #{link self, @action, :one, :title => 'external/one'}<br />
25
- #{link self, @action, :one, :two, :three, :title => 'external/one/two/three'}<br />
26
- #{link self, @action, :one, :foo => :bar, :title => 'external?foo=bar'}<br />
28
+ #{link self, @action, :one, :title => "#@action/one"}<br />
29
+ #{link self, @action, :one, :two, :three, :title => "#@action/one/two/three"}<br />
30
+ #{link self, @action, :one, :foo => :bar, :title => "#@action?foo=bar"}<br />
27
31
  </p>
28
32
  <div>
29
33
  The arguments you have passed to this action are:
@@ -47,3 +51,5 @@ class MainController < Template::Ramaze
47
51
  @args = args
48
52
  end
49
53
  end
54
+
55
+ run
@@ -5,7 +5,10 @@ require 'ramaze'
5
5
 
6
6
  include Ramaze
7
7
 
8
- class MainController < Template::Haml
8
+ class MainController < Controller
9
+
10
+ trait :engine => Template::Haml
11
+
9
12
  def index
10
13
  %{ #{link self.class} | #{link self.class, :internal} | #{link self.class, :external} }
11
14
  end