ramaze 0.1.3 → 0.1.4

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 (149) hide show
  1. data/bin/ramaze +58 -26
  2. data/doc/AUTHORS +2 -0
  3. data/doc/CHANGELOG +401 -0
  4. data/doc/README +14 -9
  5. data/doc/README.html +737 -0
  6. data/doc/TODO +14 -14
  7. data/doc/changes.txt +401 -0
  8. data/doc/changes.xml +401 -0
  9. data/doc/meta/announcement.txt +28 -15
  10. data/doc/meta/configuration.txt +3 -3
  11. data/doc/meta/internals.txt +2 -2
  12. data/doc/meta/users.kml +62 -0
  13. data/doc/readme_chunks/examples.txt +1 -1
  14. data/doc/readme_chunks/features.txt +13 -8
  15. data/doc/tutorial/todolist.html +2 -2
  16. data/doc/tutorial/todolist.mkd +2 -2
  17. data/examples/blog/README +3 -0
  18. data/examples/blog/spec/blog.rb +101 -0
  19. data/examples/blog/{main.rb → start.rb} +0 -0
  20. data/examples/caching.rb +16 -5
  21. data/examples/layout.rb +41 -0
  22. data/examples/templates/template_amrita2.rb +1 -1
  23. data/examples/templates/template_erubis.rb +1 -1
  24. data/examples/templates/template_ezamar.rb +1 -1
  25. data/examples/templates/template_haml.rb +1 -1
  26. data/examples/templates/template_liquid.rb +1 -1
  27. data/examples/templates/template_markaby.rb +1 -1
  28. data/examples/templates/template_remarkably.rb +1 -1
  29. data/examples/todolist/README +1 -0
  30. data/{spec/examples → examples/todolist/spec}/todolist.rb +3 -3
  31. data/examples/todolist/{main.rb → start.rb} +0 -0
  32. data/examples/whywiki/{main.rb → start.rb} +0 -0
  33. data/examples/wiktacular/README +2 -0
  34. data/examples/wiktacular/spec/wiktacular.rb +146 -0
  35. data/examples/wiktacular/src/controller.rb +11 -0
  36. data/examples/wiktacular/src/model.rb +5 -1
  37. data/examples/wiktacular/{main.rb → start.rb} +0 -1
  38. data/examples/wiktacular/template/edit.xhtml +1 -2
  39. data/examples/wiktacular/template/html_layout.xhtml +27 -0
  40. data/examples/wiktacular/template/index.xhtml +8 -10
  41. data/examples/wiktacular/template/new.xhtml +1 -2
  42. data/lib/proto/{main.rb → start.rb} +0 -0
  43. data/lib/proto/template/index.xhtml +1 -1
  44. data/lib/ramaze/action/render.rb +58 -4
  45. data/lib/ramaze/action.rb +20 -0
  46. data/lib/ramaze/adapter/cgi.rb +7 -4
  47. data/lib/ramaze/adapter/fcgi.rb +6 -4
  48. data/lib/ramaze/adapter/mongrel.rb +4 -0
  49. data/lib/ramaze/adapter/webrick.rb +20 -9
  50. data/lib/ramaze/adapter.rb +3 -1
  51. data/lib/ramaze/cache/memcached.rb +2 -26
  52. data/lib/ramaze/cache.rb +8 -4
  53. data/lib/ramaze/controller/resolve.rb +26 -8
  54. data/lib/ramaze/controller.rb +44 -7
  55. data/lib/ramaze/dispatcher/action.rb +5 -1
  56. data/lib/ramaze/dispatcher/directory.rb +115 -0
  57. data/lib/ramaze/dispatcher/error.rb +19 -5
  58. data/lib/ramaze/dispatcher/file.rb +2 -2
  59. data/lib/ramaze/dispatcher.rb +52 -39
  60. data/lib/ramaze/global/dsl.rb +3 -2
  61. data/lib/ramaze/global/globalstruct.rb +26 -4
  62. data/lib/ramaze/global.rb +20 -11
  63. data/lib/ramaze/helper/aspect.rb +29 -11
  64. data/lib/ramaze/helper/auth.rb +2 -2
  65. data/lib/ramaze/helper/cache.rb +2 -0
  66. data/lib/ramaze/helper/identity.rb +21 -6
  67. data/lib/ramaze/helper/link.rb +1 -1
  68. data/lib/ramaze/helper/pager.rb +158 -100
  69. data/lib/ramaze/helper/partial.rb +22 -0
  70. data/lib/ramaze/helper/redirect.rb +1 -2
  71. data/lib/ramaze/helper/stack.rb +1 -1
  72. data/lib/ramaze/inform/informer.rb +20 -0
  73. data/lib/ramaze/inform/syslog.rb +5 -0
  74. data/lib/ramaze/snippets/kernel/__dir__.rb +21 -0
  75. data/lib/ramaze/snippets/kernel/aquire.rb +22 -12
  76. data/lib/ramaze/snippets/numeric/human_readable_filesize_format.rb +33 -0
  77. data/lib/ramaze/snippets/ramaze/caller_lines.rb +1 -1
  78. data/lib/ramaze/snippets/struct/values_at.rb +11 -4
  79. data/lib/ramaze/sourcereload.rb +29 -1
  80. data/{spec → lib/ramaze/spec}/helper/context.rb +0 -0
  81. data/{spec → lib/ramaze/spec}/helper/layout.rb +1 -1
  82. data/{spec → lib/ramaze/spec}/helper/minimal.rb +0 -0
  83. data/{spec → lib/ramaze/spec}/helper/mock_http.rb +0 -0
  84. data/{spec → lib/ramaze/spec}/helper/requester.rb +0 -0
  85. data/{spec → lib/ramaze/spec}/helper/simple_http.rb +0 -0
  86. data/{spec → lib/ramaze/spec}/helper/wrap.rb +0 -0
  87. data/lib/ramaze/spec/helper.rb +60 -0
  88. data/lib/ramaze/store/default.rb +3 -0
  89. data/lib/ramaze/template/ezamar/render_partial.rb +3 -0
  90. data/lib/ramaze/template/sass.rb +45 -0
  91. data/lib/ramaze/template.rb +1 -1
  92. data/lib/ramaze/tool/create.rb +5 -5
  93. data/lib/ramaze/tool/localize.rb +26 -5
  94. data/lib/ramaze/tool/mime.rb +7 -0
  95. data/lib/ramaze/trinity/response.rb +15 -0
  96. data/lib/ramaze/trinity/session.rb +1 -1
  97. data/lib/ramaze/version.rb +1 -1
  98. data/lib/ramaze.rb +5 -0
  99. data/rake_tasks/conf.rake +4 -4
  100. data/rake_tasks/maintaince.rake +12 -7
  101. data/rake_tasks/spec.rake +7 -4
  102. data/spec/examples/caching.rb +6 -8
  103. data/spec/helper.rb +3 -60
  104. data/spec/ramaze/action/basics.rb +17 -0
  105. data/spec/ramaze/action/cache.rb +28 -0
  106. data/spec/ramaze/action/layout.rb +110 -0
  107. data/spec/ramaze/action/render.rb +14 -0
  108. data/spec/ramaze/action/template/bar.xhtml +1 -0
  109. data/spec/ramaze/action/template/other_wrapper.xhtml +1 -0
  110. data/spec/ramaze/action/template/single_wrapper.xhtml +1 -0
  111. data/spec/ramaze/controller/template/edit/content.xhtml +1 -0
  112. data/spec/ramaze/controller/template/edit.xhtml +1 -0
  113. data/spec/ramaze/controller/template_resolving.rb +2 -2
  114. data/spec/ramaze/dispatcher/directory.rb +53 -0
  115. data/spec/ramaze/dispatcher/file.rb +0 -3
  116. data/spec/ramaze/error.rb +17 -2
  117. data/spec/ramaze/helper/aspect.rb +14 -20
  118. data/spec/ramaze/helper/pager.rb +83 -1
  119. data/spec/ramaze/helper/partial.rb +1 -1
  120. data/spec/ramaze/helper/template/test_template.xhtml +1 -0
  121. data/spec/ramaze/inform/informer.rb +37 -5
  122. data/spec/ramaze/localize.rb +1 -1
  123. data/spec/ramaze/template/haml.rb +5 -5
  124. data/spec/ramaze/template/sass/file.css.sass +5 -0
  125. data/spec/ramaze/template/sass.rb +46 -0
  126. data/spec/ramaze/template.rb +1 -1
  127. data/spec/ramaze/trinity/session.rb +27 -0
  128. data/spec/snippets/kernel/__dir__.rb +8 -0
  129. data/spec/snippets/kernel/aquire.rb +71 -0
  130. data/spec/snippets/kernel/constant.rb +27 -0
  131. data/spec/snippets/numeric/human_readable_filesize_format.rb +11 -0
  132. data/spec/snippets/ramaze/caller_info.rb +39 -0
  133. data/spec/snippets/ramaze/caller_lines.rb +27 -0
  134. data/spec/snippets/string/DIVIDE.rb +18 -0
  135. data/spec/snippets/string/camel_case.rb +25 -0
  136. data/spec/snippets/string/color.rb +11 -0
  137. data/spec/snippets/string/snake_case.rb +17 -0
  138. data/spec/snippets/struct/fill.rb +27 -0
  139. data/spec/snippets/struct/values_at.rb +39 -0
  140. metadata +71 -31
  141. data/examples/todolist/todolist.db +0 -5
  142. data/examples/wiktacular/src/page.rb +0 -66
  143. data/lib/ramaze/helper/feed.rb +0 -135
  144. data/lib/ramaze/helper/form.rb +0 -204
  145. data/lib/ramaze/snippets/openstruct/temp.rb +0 -13
  146. data/lib/ramaze/store/yaml.rb +0 -170
  147. data/spec/ramaze/helper/feed.rb +0 -127
  148. data/spec/ramaze/helper/form.rb +0 -146
  149. data/spec/ramaze/store/yaml.rb +0 -76
@@ -9,7 +9,7 @@ include Ramaze
9
9
  # - implement the amrita2 example, man, this engine is awkward :P
10
10
 
11
11
  class MainController < Controller
12
- template_root File.expand_path((File.dirname(__FILE__)/'template'))
12
+ template_root __DIR__/:template
13
13
  trait :engine => Template::Amrita2
14
14
 
15
15
  def index
@@ -4,7 +4,7 @@
4
4
  require 'ramaze'
5
5
 
6
6
  class MainController < Ramaze::Controller
7
- template_root File.expand_path((File.dirname(__FILE__)/'template'))
7
+ template_root __DIR__/:template
8
8
  trait :engine => Ramaze::Template::Erubis
9
9
 
10
10
  def index
@@ -4,7 +4,7 @@
4
4
  require 'ramaze'
5
5
 
6
6
  class MainController < Ramaze::Controller
7
- template_root File.expand_path((File.dirname(__FILE__)/'template'))
7
+ template_root __DIR__/:template
8
8
 
9
9
  def index
10
10
  %{ #{A 'Home', :href => :/} | #{A(:internal)} | #{A(:external)} }
@@ -4,7 +4,7 @@
4
4
  require 'ramaze'
5
5
 
6
6
  class MainController < Ramaze::Controller
7
- template_root File.expand_path((File.dirname(__FILE__)/'template'))
7
+ template_root __DIR__/:template
8
8
  trait :engine => Ramaze::Template::Haml
9
9
 
10
10
  def index
@@ -6,7 +6,7 @@ require 'ramaze'
6
6
  include Ramaze
7
7
 
8
8
  class MainController < Controller
9
- template_root File.expand_path((File.dirname(__FILE__)/'template'))
9
+ template_root __DIR__/:template
10
10
  trait :engine => Template::Liquid
11
11
 
12
12
  def index
@@ -6,7 +6,7 @@ require 'ramaze'
6
6
  include Ramaze
7
7
 
8
8
  class MainController < Controller
9
- template_root File.expand_path((File.dirname(__FILE__)/'template'))
9
+ template_root __DIR__/'template'
10
10
  trait :engine => Template::Markaby
11
11
 
12
12
  helper :markaby
@@ -6,7 +6,7 @@ require 'ramaze'
6
6
  include Ramaze
7
7
 
8
8
  class MainController < Controller
9
- template_root File.expand_path((File.dirname(__FILE__)/'template'))
9
+ template_root __DIR__/:template
10
10
  trait :engine => Template::Remarkably
11
11
 
12
12
  include Remarkably::Common
@@ -0,0 +1 @@
1
+ A simple ToDo list example that uses Ramaze::Store as the persistence layer.
@@ -1,13 +1,13 @@
1
- require 'spec/helper'
1
+ require 'ramaze/spec/helper'
2
2
 
3
3
  testcase_requires 'hpricot'
4
4
 
5
5
  $:.unshift 'examples/todolist'
6
- require 'main'
6
+ require 'start'
7
7
 
8
8
  # fix the paths to template and public for the spec
9
9
  class MainController
10
- template_root 'examples/todolist/template'
10
+ template_root __DIR__ / '../template'
11
11
  end
12
12
 
13
13
  describe 'todolist' do
File without changes
File without changes
@@ -0,0 +1,2 @@
1
+ A wiki with page versioning.
2
+ The persistence layer is file-based and shows how to build non-RDBMS-based apps.
@@ -0,0 +1,146 @@
1
+ require 'ramaze/spec/helper'
2
+
3
+ # if these libraries are missing there is no sense in running the tests,
4
+ # cause they won't work at all.
5
+ testcase_requires 'bluecloth'
6
+ testcase_requires 'hpricot'
7
+
8
+ $:.unshift 'examples/wiktacular'
9
+ require 'start'
10
+
11
+ # fix the paths to template and public for the spec
12
+ # this is not needed usually, but this tests are also part of ramaze's suite
13
+ class MainController
14
+ template_root __DIR__ / '../template'
15
+ end
16
+
17
+ describe 'wiktacular' do
18
+ NEWPAGE = "newpagename"
19
+
20
+ def check_page(name)
21
+ page = get('/'+name)
22
+ page.status.should == 200
23
+ page.body.should_not be_nil
24
+
25
+ doc = Hpricot(page.body)
26
+ doc.at('title').inner_html.should == 'Wiktacular'
27
+
28
+ menu = doc.search('div#menu>a')
29
+ menu[0].inner_html.should == 'Home'
30
+ menu[1].inner_html.should == 'New Entry'
31
+
32
+ navigation = doc.search('div#navigation>div>a')
33
+ %w[link main markdown testing].each do |link|
34
+ navigation.map{|n| n.inner_html }.sort.should include(link)
35
+ end
36
+
37
+ manipulate = doc.search('div#manipulate>a')
38
+ manipulate.map{|m| m.inner_html }.should ==
39
+ %w[Edit Delete Revert Unrevert]
40
+
41
+ doc
42
+ end
43
+
44
+ it 'should start' do
45
+ ramaze :public_root => 'examples/wiktacular/public', :port => 7001
46
+ get('/').status.should == 200
47
+ end
48
+
49
+ it 'should have main page' do
50
+ check_page('/main')
51
+ end
52
+
53
+ it 'should have link page' do
54
+ check_page('/link')
55
+ end
56
+
57
+ it 'should have markdown page' do
58
+ check_page('/markdown')
59
+ end
60
+
61
+ it 'should have testing page' do
62
+ check_page('/testing')
63
+ end
64
+
65
+
66
+ it 'should not have foobar page' do
67
+ doc = check_page('/foobar')
68
+ doc.at('div#text').inner_html.strip.should == 'No Entry'
69
+ end
70
+
71
+ it 'should allow page editing' do
72
+ doc = check_page('/edit/main')
73
+ form = doc.at('div#content>form')
74
+ form.at('input[@type=text]')['value'].should == 'main'
75
+ form.at('textarea').inner_html.should match(/# Hello, World/)
76
+ form.at('a').inner_html.should == 'cancel'
77
+ form.at('a')['href'].should == '/main'
78
+ end
79
+
80
+ def edit_page(name, text='new text')
81
+ page = post('/save','handle'=>name,'text'=>text)
82
+ page.status.should == 303
83
+ page.location.should == '/index/'+name
84
+ end
85
+
86
+ def delete_page(name)
87
+ page = get('/delete/'+name)
88
+ page.status.should == 303
89
+ page.location.should == '/'
90
+ end
91
+
92
+ def revert_page(name)
93
+ page = get('/revert/'+name)
94
+ page.status.should == 303
95
+ page.location.should == '/'+name
96
+ end
97
+
98
+ def unrevert_page(name)
99
+ page = get('/revert/'+name)
100
+ page.status.should == 303
101
+ page.location.should == '/'+name
102
+ end
103
+
104
+ it 'editing should create page' do
105
+ edit_page(NEWPAGE, 'new text')
106
+ doc = check_page(NEWPAGE)
107
+ doc.at('div#text').inner_html.strip.should == '<p>new text</p>'
108
+ delete_page(NEWPAGE)
109
+ end
110
+
111
+ it 'editing should modify page' do
112
+ edit_page(NEWPAGE, 'text text')
113
+ doc = check_page(NEWPAGE)
114
+ doc.at('div#text').inner_html.strip.should == '<p>text text</p>'
115
+ edit_page(NEWPAGE,'some other text')
116
+ doc = check_page(NEWPAGE)
117
+ doc.at('div#text').inner_html.strip.should == '<p>some other text</p>'
118
+ delete_page(NEWPAGE)
119
+ end
120
+
121
+ it "should be possible to revert changes" do
122
+ edit_page(NEWPAGE, 'first text')
123
+ edit_page(NEWPAGE, 'second text')
124
+ doc = check_page(NEWPAGE)
125
+ doc.at('div#text').inner_html.strip.should == '<p>second text</p>'
126
+ revert_page(NEWPAGE)
127
+ doc = check_page(NEWPAGE)
128
+ doc.at('div#text').inner_html.strip.should == '<p>first text</p>'
129
+ end
130
+
131
+ it "should be possible to unrevert changes" do
132
+ edit_page(NEWPAGE, 'first text')
133
+ edit_page(NEWPAGE, 'second text')
134
+ revert_page(NEWPAGE)
135
+ doc = check_page(NEWPAGE)
136
+ doc.at('div#text').inner_html.strip.should == '<p>first text</p>'
137
+ unrevert_page(NEWPAGE)
138
+ doc = check_page(NEWPAGE)
139
+ doc.at('div#text').inner_html.strip.should == '<p>first text</p>'
140
+ end
141
+
142
+ after do
143
+ WikiEntry.new(NEWPAGE).delete
144
+ end
145
+
146
+ end
@@ -1,4 +1,6 @@
1
1
  class MainController < Ramaze::Controller
2
+
3
+
2
4
  def index handle = "main"
3
5
  @handle = handle
4
6
  @entry = WikiEntry.new(handle)
@@ -41,4 +43,13 @@ class MainController < Ramaze::Controller
41
43
  entry.save(request['text'])
42
44
  redirect Rs(:index, handle)
43
45
  end
46
+
47
+ def html_layout
48
+ @nodes = WikiEntry.titles.map{|f|
49
+ name = File.basename(f)
50
+ %[<a href="/#{name}">#{name}</a>]
51
+ }.join("\n")
52
+ end
53
+
54
+ layout :html_layout
44
55
  end
@@ -2,10 +2,14 @@ require 'fileutils'
2
2
  require 'cgi'
3
3
 
4
4
  class WikiEntry
5
+ ENTRIES_DIR = __DIR__/'../mkd'
5
6
  class << self
6
7
  def [](name)
7
8
  new(name)
8
9
  end
10
+ def titles
11
+ Dir[ENTRIES_DIR/'*'].entries
12
+ end
9
13
  end
10
14
 
11
15
  attr_reader :history, :current, :name
@@ -58,7 +62,7 @@ class WikiEntry
58
62
  end
59
63
 
60
64
  def base
61
- "mkd/#@name"
65
+ ENTRIES_DIR/@name
62
66
  end
63
67
 
64
68
  def content
@@ -1,7 +1,6 @@
1
1
  require 'ramaze'
2
2
  require 'bluecloth'
3
3
 
4
- require 'src/page'
5
4
  require 'src/model'
6
5
  require 'src/controller'
7
6
 
@@ -1,7 +1,6 @@
1
- <Page>
2
1
  <form method="POST" action="/save" id="edit_entry">
3
2
  <input type="text" name="handle" value="#@handle" />
4
3
  <textarea name="text">#@text</textarea>
5
4
  <input type="submit" />
5
+ or #{A('cancel', :href=>Rs(@handle))}
6
6
  </form>
7
- </Page>
@@ -0,0 +1,27 @@
1
+ <html>
2
+ <head>
3
+ <title>Wiktacular</title>
4
+ <link rel="stylesheet" type="text/css" media="screen" href="/screen.css" />
5
+ </head>
6
+ <body>
7
+ <div id="menu">
8
+ <a href="/main">Home</a>
9
+ <a href="/new">New Entry</a>
10
+ </div>
11
+ <div id="navigation">
12
+ <div id="nodes">
13
+ #@nodes
14
+ </div>
15
+ </div>
16
+ <div id="manipulate">
17
+ <a href="/edit/#@handle">Edit</a>
18
+ <a href="/delete/#@handle">Delete</a>
19
+ <a href="/revert/#@handle">Revert</a>
20
+ <a href="/unrevert/#@handle">Unrevert</a>
21
+ </div>
22
+ <div id="content">
23
+ #@content
24
+ </div>
25
+ <div id="copyright">Wiktacular is powered by <a href="http://ramaze.rubyforge.org/">Ramaze</a></div>
26
+ </body>
27
+ </html>
@@ -1,11 +1,9 @@
1
- <Page>
2
- <div id="text">
3
- #@text
1
+ <div id="text">
2
+ #@text
3
+ </div>
4
+ <?r if @history ?>
5
+ <div id="history">
6
+ History of this entry:<br />
7
+ #@history
4
8
  </div>
5
- <?r if @history ?>
6
- <div id="history">
7
- History of this entry:<br />
8
- #@history
9
- </div>
10
- <?r end ?>
11
- </Page>
9
+ <?r end ?>
@@ -1,7 +1,6 @@
1
- <Page>
2
1
  <form method="POST" action="/save" id="new_entry">
3
2
  <input type="text" name="handle" />
4
3
  <textarea name="text"></textarea>
5
4
  <input type="submit" />
5
+ or #{A('cancel',:href=>'/')}
6
6
  </form>
7
- </Page>
File without changes
@@ -1,6 +1,6 @@
1
1
  <Page>
2
2
  <h1>#{@welcome}</h1>
3
- <p>Ramaze is working correctly with this application, now you can start working</p
3
+ <p>Ramaze is working correctly with this application, now you can start working</p>
4
4
 
5
5
  <p>
6
6
  To start you can modify:
@@ -28,6 +28,28 @@ module Ramaze
28
28
  # true.
29
29
 
30
30
  def cached_render
31
+ if Global.file_cache
32
+ cached_render_file
33
+ else
34
+ cached_render_memory
35
+ end
36
+ end
37
+
38
+ def cached_render_file
39
+ rendered = uncached_render
40
+
41
+ global_epath = Global.public_root/extended_path
42
+ FileUtils.mkdir_p(File.dirname(global_epath))
43
+ File.open( global_epath, 'w+'){|fp| fp.print(rendered) }
44
+
45
+ meta_epath = Global.file_cache_meta_dir/extended_path
46
+ FileUtils.mkdir_p(File.dirname(meta_epath))
47
+ File.open( meta_epath, 'w+'){|fp| fp.print(Time.now.to_i) }
48
+
49
+ rendered
50
+ end
51
+
52
+ def cached_render_memory
31
53
  action_cache = Cache.actions
32
54
 
33
55
  if out = action_cache[relaxed_hash]
@@ -41,12 +63,44 @@ module Ramaze
41
63
 
42
64
  # The 'normal' rendering process. Passes the Action instance to
43
65
  # Action#engine.transform, which returns the output of the action.
66
+ # Layout will be found and rendered in this step after self was rendered.
44
67
 
45
68
  def uncached_render
46
- [ before_process,
47
- engine.transform(self),
48
- after_process,
49
- ].join
69
+ bp = before_process
70
+ content = engine.transform(self)
71
+ ap = after_process
72
+
73
+ if tlayout = layout
74
+ instance.instance_variable_set("@content", content)
75
+ content = tlayout.render
76
+ Thread.current[:action] = self
77
+ end
78
+ [bp, content, ap].join
79
+ end
80
+
81
+ # Determine whether or not we have a layout to process and sets it up
82
+ # correctly to be rendered in the same context as current action.
83
+ # Will return false if the layout is the same as current action to avoid
84
+ # infinite recursion and also if no layout on this controller was found.
85
+
86
+ def layout
87
+ return false unless layouts = controller.trait[:layout]
88
+
89
+ possible = [layouts[:all], layouts[path]].compact
90
+ denied = layouts[:deny].to_a
91
+
92
+ if layout = possible.first
93
+ layout_action = Ramaze::Controller.resolve(layout)
94
+
95
+ if denied.include?(path) or layout_action.path == path
96
+ return false
97
+ end
98
+
99
+ layout_action.binding = binding
100
+ layout_action.controller = controller
101
+ layout_action.instance = instance
102
+ layout_action
103
+ end
50
104
  end
51
105
 
52
106
  # return true if the action is flagged for caching. Called by