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.
- data/bin/ramaze +58 -26
- data/doc/AUTHORS +2 -0
- data/doc/CHANGELOG +401 -0
- data/doc/README +14 -9
- data/doc/README.html +737 -0
- data/doc/TODO +14 -14
- data/doc/changes.txt +401 -0
- data/doc/changes.xml +401 -0
- data/doc/meta/announcement.txt +28 -15
- data/doc/meta/configuration.txt +3 -3
- data/doc/meta/internals.txt +2 -2
- data/doc/meta/users.kml +62 -0
- data/doc/readme_chunks/examples.txt +1 -1
- data/doc/readme_chunks/features.txt +13 -8
- data/doc/tutorial/todolist.html +2 -2
- data/doc/tutorial/todolist.mkd +2 -2
- data/examples/blog/README +3 -0
- data/examples/blog/spec/blog.rb +101 -0
- data/examples/blog/{main.rb → start.rb} +0 -0
- data/examples/caching.rb +16 -5
- data/examples/layout.rb +41 -0
- data/examples/templates/template_amrita2.rb +1 -1
- data/examples/templates/template_erubis.rb +1 -1
- data/examples/templates/template_ezamar.rb +1 -1
- data/examples/templates/template_haml.rb +1 -1
- data/examples/templates/template_liquid.rb +1 -1
- data/examples/templates/template_markaby.rb +1 -1
- data/examples/templates/template_remarkably.rb +1 -1
- data/examples/todolist/README +1 -0
- data/{spec/examples → examples/todolist/spec}/todolist.rb +3 -3
- data/examples/todolist/{main.rb → start.rb} +0 -0
- data/examples/whywiki/{main.rb → start.rb} +0 -0
- data/examples/wiktacular/README +2 -0
- data/examples/wiktacular/spec/wiktacular.rb +146 -0
- data/examples/wiktacular/src/controller.rb +11 -0
- data/examples/wiktacular/src/model.rb +5 -1
- data/examples/wiktacular/{main.rb → start.rb} +0 -1
- data/examples/wiktacular/template/edit.xhtml +1 -2
- data/examples/wiktacular/template/html_layout.xhtml +27 -0
- data/examples/wiktacular/template/index.xhtml +8 -10
- data/examples/wiktacular/template/new.xhtml +1 -2
- data/lib/proto/{main.rb → start.rb} +0 -0
- data/lib/proto/template/index.xhtml +1 -1
- data/lib/ramaze/action/render.rb +58 -4
- data/lib/ramaze/action.rb +20 -0
- data/lib/ramaze/adapter/cgi.rb +7 -4
- data/lib/ramaze/adapter/fcgi.rb +6 -4
- data/lib/ramaze/adapter/mongrel.rb +4 -0
- data/lib/ramaze/adapter/webrick.rb +20 -9
- data/lib/ramaze/adapter.rb +3 -1
- data/lib/ramaze/cache/memcached.rb +2 -26
- data/lib/ramaze/cache.rb +8 -4
- data/lib/ramaze/controller/resolve.rb +26 -8
- data/lib/ramaze/controller.rb +44 -7
- data/lib/ramaze/dispatcher/action.rb +5 -1
- data/lib/ramaze/dispatcher/directory.rb +115 -0
- data/lib/ramaze/dispatcher/error.rb +19 -5
- data/lib/ramaze/dispatcher/file.rb +2 -2
- data/lib/ramaze/dispatcher.rb +52 -39
- data/lib/ramaze/global/dsl.rb +3 -2
- data/lib/ramaze/global/globalstruct.rb +26 -4
- data/lib/ramaze/global.rb +20 -11
- data/lib/ramaze/helper/aspect.rb +29 -11
- data/lib/ramaze/helper/auth.rb +2 -2
- data/lib/ramaze/helper/cache.rb +2 -0
- data/lib/ramaze/helper/identity.rb +21 -6
- data/lib/ramaze/helper/link.rb +1 -1
- data/lib/ramaze/helper/pager.rb +158 -100
- data/lib/ramaze/helper/partial.rb +22 -0
- data/lib/ramaze/helper/redirect.rb +1 -2
- data/lib/ramaze/helper/stack.rb +1 -1
- data/lib/ramaze/inform/informer.rb +20 -0
- data/lib/ramaze/inform/syslog.rb +5 -0
- data/lib/ramaze/snippets/kernel/__dir__.rb +21 -0
- data/lib/ramaze/snippets/kernel/aquire.rb +22 -12
- data/lib/ramaze/snippets/numeric/human_readable_filesize_format.rb +33 -0
- data/lib/ramaze/snippets/ramaze/caller_lines.rb +1 -1
- data/lib/ramaze/snippets/struct/values_at.rb +11 -4
- data/lib/ramaze/sourcereload.rb +29 -1
- data/{spec → lib/ramaze/spec}/helper/context.rb +0 -0
- data/{spec → lib/ramaze/spec}/helper/layout.rb +1 -1
- data/{spec → lib/ramaze/spec}/helper/minimal.rb +0 -0
- data/{spec → lib/ramaze/spec}/helper/mock_http.rb +0 -0
- data/{spec → lib/ramaze/spec}/helper/requester.rb +0 -0
- data/{spec → lib/ramaze/spec}/helper/simple_http.rb +0 -0
- data/{spec → lib/ramaze/spec}/helper/wrap.rb +0 -0
- data/lib/ramaze/spec/helper.rb +60 -0
- data/lib/ramaze/store/default.rb +3 -0
- data/lib/ramaze/template/ezamar/render_partial.rb +3 -0
- data/lib/ramaze/template/sass.rb +45 -0
- data/lib/ramaze/template.rb +1 -1
- data/lib/ramaze/tool/create.rb +5 -5
- data/lib/ramaze/tool/localize.rb +26 -5
- data/lib/ramaze/tool/mime.rb +7 -0
- data/lib/ramaze/trinity/response.rb +15 -0
- data/lib/ramaze/trinity/session.rb +1 -1
- data/lib/ramaze/version.rb +1 -1
- data/lib/ramaze.rb +5 -0
- data/rake_tasks/conf.rake +4 -4
- data/rake_tasks/maintaince.rake +12 -7
- data/rake_tasks/spec.rake +7 -4
- data/spec/examples/caching.rb +6 -8
- data/spec/helper.rb +3 -60
- data/spec/ramaze/action/basics.rb +17 -0
- data/spec/ramaze/action/cache.rb +28 -0
- data/spec/ramaze/action/layout.rb +110 -0
- data/spec/ramaze/action/render.rb +14 -0
- data/spec/ramaze/action/template/bar.xhtml +1 -0
- data/spec/ramaze/action/template/other_wrapper.xhtml +1 -0
- data/spec/ramaze/action/template/single_wrapper.xhtml +1 -0
- data/spec/ramaze/controller/template/edit/content.xhtml +1 -0
- data/spec/ramaze/controller/template/edit.xhtml +1 -0
- data/spec/ramaze/controller/template_resolving.rb +2 -2
- data/spec/ramaze/dispatcher/directory.rb +53 -0
- data/spec/ramaze/dispatcher/file.rb +0 -3
- data/spec/ramaze/error.rb +17 -2
- data/spec/ramaze/helper/aspect.rb +14 -20
- data/spec/ramaze/helper/pager.rb +83 -1
- data/spec/ramaze/helper/partial.rb +1 -1
- data/spec/ramaze/helper/template/test_template.xhtml +1 -0
- data/spec/ramaze/inform/informer.rb +37 -5
- data/spec/ramaze/localize.rb +1 -1
- data/spec/ramaze/template/haml.rb +5 -5
- data/spec/ramaze/template/sass/file.css.sass +5 -0
- data/spec/ramaze/template/sass.rb +46 -0
- data/spec/ramaze/template.rb +1 -1
- data/spec/ramaze/trinity/session.rb +27 -0
- data/spec/snippets/kernel/__dir__.rb +8 -0
- data/spec/snippets/kernel/aquire.rb +71 -0
- data/spec/snippets/kernel/constant.rb +27 -0
- data/spec/snippets/numeric/human_readable_filesize_format.rb +11 -0
- data/spec/snippets/ramaze/caller_info.rb +39 -0
- data/spec/snippets/ramaze/caller_lines.rb +27 -0
- data/spec/snippets/string/DIVIDE.rb +18 -0
- data/spec/snippets/string/camel_case.rb +25 -0
- data/spec/snippets/string/color.rb +11 -0
- data/spec/snippets/string/snake_case.rb +17 -0
- data/spec/snippets/struct/fill.rb +27 -0
- data/spec/snippets/struct/values_at.rb +39 -0
- metadata +71 -31
- data/examples/todolist/todolist.db +0 -5
- data/examples/wiktacular/src/page.rb +0 -66
- data/lib/ramaze/helper/feed.rb +0 -135
- data/lib/ramaze/helper/form.rb +0 -204
- data/lib/ramaze/snippets/openstruct/temp.rb +0 -13
- data/lib/ramaze/store/yaml.rb +0 -170
- data/spec/ramaze/helper/feed.rb +0 -127
- data/spec/ramaze/helper/form.rb +0 -146
- 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
|
|
12
|
+
template_root __DIR__/:template
|
|
13
13
|
trait :engine => Template::Amrita2
|
|
14
14
|
|
|
15
15
|
def index
|
|
@@ -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 '
|
|
6
|
+
require 'start'
|
|
7
7
|
|
|
8
8
|
# fix the paths to template and public for the spec
|
|
9
9
|
class MainController
|
|
10
|
-
template_root '
|
|
10
|
+
template_root __DIR__ / '../template'
|
|
11
11
|
end
|
|
12
12
|
|
|
13
13
|
describe 'todolist' do
|
|
File without changes
|
|
File without changes
|
|
@@ -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
|
-
|
|
65
|
+
ENTRIES_DIR/@name
|
|
62
66
|
end
|
|
63
67
|
|
|
64
68
|
def content
|
|
@@ -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
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
6
|
-
<div id="history">
|
|
7
|
-
History of this entry:<br />
|
|
8
|
-
#@history
|
|
9
|
-
</div>
|
|
10
|
-
<?r end ?>
|
|
11
|
-
</Page>
|
|
9
|
+
<?r end ?>
|
|
File without changes
|
data/lib/ramaze/action/render.rb
CHANGED
|
@@ -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
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|