manveru-ramaze 2009.04 → 2009.04.01
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +0 -405
- data/MANIFEST +16 -16
- data/Rakefile +4 -24
- data/bin/ramaze +52 -275
- data/doc/tutorial/todolist.html +5 -83
- data/doc/tutorial/todolist.txt +33 -85
- data/examples/app/auth/layout/{auth.xhtml → auth.nag} +0 -0
- data/examples/app/auth/view/{index.xhtml → index.nag} +0 -0
- data/examples/app/auth/view/{login.xhtml → login.nag} +0 -0
- data/examples/app/auth/view/{secret.xhtml → secret.nag} +0 -0
- data/examples/app/blog/app.rb +1 -1
- data/examples/app/blog/controller/comment.rb +1 -1
- data/examples/app/blog/controller/entry.rb +3 -12
- data/examples/app/blog/model/init.rb +0 -5
- data/examples/app/blog/model/tag.rb +2 -2
- data/examples/app/blog/start.rb +1 -1
- data/examples/app/blog/view/entry/index.nag +3 -3
- data/examples/app/blog/view/feed.atom.nag +1 -1
- data/examples/app/blog/view/feed.rss.nag +1 -1
- data/examples/app/blog/view/index.nag +1 -1
- data/examples/app/blog/view/tag/index.nag +1 -1
- data/examples/app/todolist/model/init.rb +0 -3
- data/examples/app/wikore/spec/wikore.rb +6 -4
- data/examples/app/wikore/src/controller.rb +11 -9
- data/examples/app/wikore/src/model.rb +10 -7
- data/examples/app/wikore/start.rb +1 -1
- data/examples/app/wikore/{view → template}/index.xhtml +0 -0
- data/examples/helpers/provide.rb +23 -0
- data/examples/misc/rapp.rb +17 -28
- data/examples/templates/template_redcloth.rb +2 -2
- data/examples/templates/template_xslt.rb +48 -0
- data/examples/templates/view/external.xsl +57 -0
- data/lib/proto/config.ru +5 -4
- data/lib/proto/controller/init.rb +2 -2
- data/lib/proto/layout/{default.xhtml → default.nag} +0 -0
- data/lib/proto/spec/main.rb +8 -7
- data/lib/proto/start.rb +10 -6
- data/lib/proto/view/{index.xhtml → index.nag} +0 -0
- data/lib/proto/view/page.nag +27 -0
- data/lib/ramaze/app.rb +5 -5
- data/lib/ramaze/cache.rb +2 -3
- data/lib/ramaze/contrib/email.rb +0 -2
- data/lib/ramaze/contrib/sequel/create_join.rb +0 -1
- data/lib/ramaze/contrib/sequel/fill.rb +12 -0
- data/lib/ramaze/contrib/sequel/form_field.rb +4 -4
- data/lib/ramaze/contrib/sequel/image.rb +11 -9
- data/lib/ramaze/contrib/sequel/relation.rb +3 -17
- data/lib/ramaze/controller/default.rb +0 -5
- data/lib/ramaze/helper/cache.rb +8 -22
- data/lib/ramaze/helper/formatting.rb +0 -2
- data/lib/ramaze/helper/httpdigest.rb +1 -1
- data/lib/ramaze/helper/link.rb +5 -2
- data/lib/ramaze/helper/localize.rb +3 -13
- data/lib/ramaze/helper/paginate.rb +0 -1
- data/lib/ramaze/helper/partial.rb +10 -85
- data/lib/ramaze/helper.rb +16 -6
- data/lib/ramaze/request.rb +1 -22
- data/lib/ramaze/snippets/ramaze/deprecated.rb +1 -0
- data/lib/ramaze/snippets/string/each.rb +19 -0
- data/lib/ramaze/spec.rb +2 -9
- data/lib/ramaze/version.rb +1 -1
- data/lib/ramaze/view/haml.rb +0 -1
- data/lib/ramaze/view/liquid.rb +11 -45
- data/lib/ramaze/view/nagoro/render_partial.rb +9 -9
- data/lib/ramaze/view.rb +0 -4
- data/lib/ramaze.rb +0 -2
- data/ramaze.gemspec +12 -12
- data/spec/contrib/sequel/fill.rb +47 -0
- data/spec/examples/helpers/httpdigest.rb +67 -42
- data/spec/examples/templates/template_markaby.rb +1 -1
- data/spec/examples/templates/template_xslt.rb +10 -0
- data/spec/ramaze/dispatcher/file.rb +20 -22
- data/spec/ramaze/error.rb +1 -1
- data/spec/ramaze/helper/auth.rb +40 -29
- data/spec/ramaze/helper/cache.rb +3 -43
- data/spec/ramaze/helper/flash.rb +14 -10
- data/spec/ramaze/helper/httpdigest.rb +65 -47
- data/spec/ramaze/helper/localize.rb +9 -9
- data/spec/ramaze/helper/partial.rb +40 -0
- data/spec/ramaze/helper/sequel_form.rb +1 -1
- data/spec/ramaze/helper/simple_captcha.rb +13 -9
- data/spec/ramaze/helper/stack.rb +39 -31
- data/spec/ramaze/helper/user.rb +13 -15
- data/spec/ramaze/request.rb +0 -12
- data/tasks/bacon.rake +21 -38
- data/tasks/release.rake +22 -4
- metadata +24 -22
- data/lib/proto/app.rb +0 -15
- data/lib/ramaze/cache/localmemcache.rb +0 -56
- data/lib/ramaze/contrib/app_graph.rb +0 -64
- data/lib/ramaze/tool/create.rb +0 -48
- data/lib/ramaze/tool/project_creator.rb +0 -111
- data/spec/ramaze/cache/localmemcache.rb +0 -49
- data/tasks/setup.rake +0 -24
File without changes
|
File without changes
|
File without changes
|
File without changes
|
data/examples/app/blog/app.rb
CHANGED
@@ -25,6 +25,9 @@ module Blog
|
|
25
25
|
@comment_count = number_counter(@entry.comments.count, 'comment')
|
26
26
|
end
|
27
27
|
|
28
|
+
def feed
|
29
|
+
end
|
30
|
+
|
28
31
|
def edit(slug)
|
29
32
|
login_required
|
30
33
|
@entry = Entry.from_slug(slug)
|
@@ -58,18 +61,6 @@ module Blog
|
|
58
61
|
Entry.from_slug(slug).destroy
|
59
62
|
end
|
60
63
|
|
61
|
-
def trackback(slug)
|
62
|
-
render_partial(:index){|a|
|
63
|
-
a.method = :index
|
64
|
-
a.params << slug
|
65
|
-
} + <<-COMMENT.strip
|
66
|
-
I really have not the faintest idea about what this is supposed to do.<br />
|
67
|
-
People tell me it's broken, but nobody tells me how to fix it :)<br />
|
68
|
-
For now I'll just use it to show off how to modify an action that requires a
|
69
|
-
method parameter.
|
70
|
-
COMMENT
|
71
|
-
end
|
72
|
-
|
73
64
|
private
|
74
65
|
|
75
66
|
def fetch_tags
|
@@ -1,15 +1,10 @@
|
|
1
1
|
require 'sequel'
|
2
|
-
require 'sequel/extensions/inflector'
|
3
2
|
|
4
3
|
module Blog
|
5
4
|
DB = Sequel.sqlite("#{__DIR__}/../blog.db")
|
6
5
|
# DB = Sequel.connect("sqlite:///#{__DIR__}/../blog.db")
|
7
6
|
end
|
8
7
|
|
9
|
-
Sequel::Model.plugin :validation_class_methods
|
10
|
-
Sequel::Model.plugin :schema
|
11
|
-
Sequel::Model.plugin :hook_class_methods
|
12
|
-
|
13
8
|
require 'model/tag'
|
14
9
|
require 'model/entry'
|
15
10
|
require 'model/comment'
|
@@ -7,8 +7,8 @@ module Blog
|
|
7
7
|
foreign_key :tag_id
|
8
8
|
end
|
9
9
|
|
10
|
-
|
11
|
-
|
10
|
+
belongs_to :entry, :class => 'Blog::Entry'
|
11
|
+
belongs_to :tag, :class => 'Blog::Tag'
|
12
12
|
|
13
13
|
create_table unless table_exists?
|
14
14
|
end
|
data/examples/app/blog/start.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
#{ Blog::Entries.
|
1
|
+
#{ Blog::Entries.partial_content(:show, :entry => @entry) }
|
2
2
|
<div id="comments" class="comments">
|
3
3
|
<?r @entry.comments.each do |comment| ?>
|
4
|
-
#{ Blog::Comments.
|
4
|
+
#{ Blog::Comments.partial_content(:show, :comment => comment) }
|
5
5
|
<?r end ?>
|
6
|
-
#{ Blog::Comments.
|
6
|
+
#{ Blog::Comments.partial_content(:form, :entry => @entry) }
|
7
7
|
</div>
|
@@ -13,6 +13,6 @@
|
|
13
13
|
<id>#{ "#{ Blog.options.uuid }/atom" }</id>
|
14
14
|
<generator uri='#{ @generator_uri }'>#{ @generator }</generator>
|
15
15
|
<?r @entries.each do |entry| ?>
|
16
|
-
#{ Blog::Entries.
|
16
|
+
#{ Blog::Entries.partial_content('feed.atom', :entry => entry) }
|
17
17
|
<?end ?>
|
18
18
|
</feed>
|
@@ -19,7 +19,7 @@
|
|
19
19
|
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
|
20
20
|
<ttl>240</ttl>
|
21
21
|
<?r @entries.each do |entry| ?>
|
22
|
-
#{ Blog::Entries.
|
22
|
+
#{ Blog::Entries.partial_content('feed.rss', :entry => entry) }
|
23
23
|
<?r end ?>
|
24
24
|
</channel>
|
25
25
|
</rss>
|
@@ -1,18 +1,20 @@
|
|
1
1
|
require 'ramaze'
|
2
|
-
require 'ramaze/spec'
|
2
|
+
require 'ramaze/spec/helper'
|
3
3
|
|
4
|
-
|
4
|
+
spec_require 'hpricot', 'sequel'
|
5
5
|
|
6
6
|
$LOAD_PATH.unshift base = __DIR__('..')
|
7
7
|
require 'start'
|
8
8
|
|
9
9
|
describe 'Wikore' do
|
10
|
-
behaves_like
|
10
|
+
behaves_like 'http'
|
11
|
+
ramaze :public_root => base/:public,
|
12
|
+
:view_root => base/:template
|
11
13
|
|
12
14
|
def check_redirect(to = '/')
|
13
15
|
response = yield
|
14
16
|
response.status.should == 302
|
15
|
-
response.body.should =~ /<a href=
|
17
|
+
response.body.should =~ /<a href="#{to}">/
|
16
18
|
end
|
17
19
|
|
18
20
|
def page_should_exist(name, *matches)
|
@@ -18,28 +18,26 @@ class MainController < Ramaze::Controller
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
class
|
21
|
+
class PageController < Ramaze::Controller
|
22
22
|
map '/page'
|
23
23
|
|
24
|
-
|
25
|
-
redirect_referer unless request.post?
|
24
|
+
helper :aspect
|
26
25
|
|
26
|
+
def create
|
27
27
|
change "Created Page '%s'" do |title, text|
|
28
28
|
Page.create(:title => title, :text => text, :version => 1)
|
29
|
-
redirect MainController
|
29
|
+
redirect R(MainController, title)
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
33
|
def save
|
34
|
-
redirect_referer unless request.post?
|
35
|
-
|
36
34
|
change "Updated Page '%s'" do |title, text|
|
37
35
|
page = Page[:title => title]
|
38
36
|
page.backup
|
39
37
|
page.text = text
|
40
38
|
page.version += 1
|
41
39
|
page.save
|
42
|
-
redirect MainController
|
40
|
+
redirect R(MainController, title)
|
43
41
|
end
|
44
42
|
end
|
45
43
|
|
@@ -62,7 +60,11 @@ class Pages < Ramaze::Controller
|
|
62
60
|
def revert(title)
|
63
61
|
page = Page[:title => title]
|
64
62
|
page.revert
|
65
|
-
redirect MainController
|
63
|
+
redirect R(MainController, title)
|
64
|
+
end
|
65
|
+
|
66
|
+
before :create, :save do
|
67
|
+
redirect_referer unless request.post?
|
66
68
|
end
|
67
69
|
|
68
70
|
private
|
@@ -73,6 +75,6 @@ class Pages < Ramaze::Controller
|
|
73
75
|
message % title
|
74
76
|
end
|
75
77
|
|
76
|
-
redirect
|
78
|
+
redirect(R(MainController, redirect_to))
|
77
79
|
end
|
78
80
|
end
|
@@ -1,14 +1,17 @@
|
|
1
1
|
require 'sequel'
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
3
|
+
begin
|
4
|
+
case $wikore_db
|
5
|
+
when :memory
|
6
|
+
DB = Sequel.sqlite
|
7
|
+
else
|
8
|
+
DB_FILE = __DIR__('wikore.db')
|
9
|
+
DB = Sequel.connect("sqlite://#{DB_FILE}")
|
10
|
+
end
|
11
|
+
rescue NoMethodError
|
12
|
+
raise LoadError, 'Install latest Sequel gem'
|
8
13
|
end
|
9
14
|
|
10
|
-
Sequel::Model.plugin :schema
|
11
|
-
|
12
15
|
module Model
|
13
16
|
PAGE_SCHEMA = lambda{
|
14
17
|
primary_key :id
|
File without changes
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'ramaze'
|
2
|
+
require 'fjson'
|
3
|
+
|
4
|
+
class User
|
5
|
+
def to_yaml
|
6
|
+
"Look, I'm YAML!".to_yaml
|
7
|
+
end
|
8
|
+
|
9
|
+
def to_json
|
10
|
+
"Look, I'm YSON!".to_json
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
class MainController < Ramaze::Controller
|
15
|
+
helper :provide
|
16
|
+
provides :yaml, :json
|
17
|
+
|
18
|
+
def user
|
19
|
+
display User.new
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
Ramaze.start
|
data/examples/misc/rapp.rb
CHANGED
@@ -4,13 +4,10 @@
|
|
4
4
|
require 'rubygems'
|
5
5
|
require 'ramaze'
|
6
6
|
require 'sequel'
|
7
|
-
require 'abbrev'
|
8
7
|
|
9
|
-
DB = Sequel.sqlite
|
8
|
+
DB = Sequel.sqlite :logger => Ramaze::Log
|
10
9
|
|
11
10
|
class Post < Sequel::Model
|
12
|
-
plugin :schema
|
13
|
-
plugin :hook_class_methods
|
14
11
|
set_schema{ primary_key :id; time :created_at; text :text }
|
15
12
|
before_create{ self.created_at ||= Time.now }
|
16
13
|
create_table
|
@@ -21,35 +18,27 @@ end
|
|
21
18
|
class MainController < Ramaze::Controller
|
22
19
|
def index
|
23
20
|
@posts = Post.order(:created_at.desc).first(10)
|
24
|
-
|
25
|
-
|
26
|
-
<
|
27
|
-
|
28
|
-
|
29
|
-
<
|
30
|
-
|
31
|
-
|
32
|
-
<div id="posts" class="container">
|
33
|
-
<?r @posts.each do |post| ?>
|
34
|
-
<div id="post-#{post.id}" class="post">
|
35
|
-
<p class="text">#{post.text}</p>
|
36
|
-
<p class="created">#{post.created_at}</p>
|
37
|
-
</div>
|
38
|
-
<?r end ?>
|
21
|
+
%q(<h1>Welcome to Rapp</h1>
|
22
|
+
<h2>A minimal chat wall</h2>
|
23
|
+
<p>Recent Posts:</p>
|
24
|
+
<div id="posts" class="container">
|
25
|
+
<?r @posts.each do |post| ?>
|
26
|
+
<div id="post-#{post.id}" class="post">
|
27
|
+
<p class="text">#{post.text}</p>
|
28
|
+
<p class="created">#{post.created_at}</p>
|
39
29
|
</div>
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
</
|
47
|
-
TEMPLATE
|
30
|
+
<?r end ?>
|
31
|
+
</div>
|
32
|
+
<p>Post Something:</p>
|
33
|
+
<form action="#{Rs(:create)}" method="POST">
|
34
|
+
<input type="text" size="40" name="text" />
|
35
|
+
<input type="submit" value="Post Message!" />
|
36
|
+
</form>)
|
48
37
|
end
|
49
38
|
|
50
39
|
def create
|
51
40
|
Post.create(:text => request[:text])
|
52
|
-
redirect
|
41
|
+
redirect Rs(:/)
|
53
42
|
end
|
54
43
|
end
|
55
44
|
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
require 'ramaze'
|
3
|
+
require 'ramaze/gestalt'
|
4
|
+
|
5
|
+
class MainController < Ramaze::Controller
|
6
|
+
engine :XSLT
|
7
|
+
|
8
|
+
def index
|
9
|
+
redirect R(:external)
|
10
|
+
end
|
11
|
+
|
12
|
+
def external *args
|
13
|
+
r = lambda { |*a| R(*a) }
|
14
|
+
response['Content-Type'] = 'application/xhtml+xml'
|
15
|
+
|
16
|
+
#options = {:place => :internal, :action => 'internal',
|
17
|
+
# :args => args, :request => request, :this => self}
|
18
|
+
Ramaze::Gestalt.build do
|
19
|
+
page(:title=>"Template::XSLT") do
|
20
|
+
heading "The external Template for XSLT"
|
21
|
+
text "Here you can pass some stuff if you like, parameters are just passed like this:"
|
22
|
+
list do
|
23
|
+
item {
|
24
|
+
link(:href => r.call(@this, :external, :one)) { "external/one" }
|
25
|
+
}
|
26
|
+
item {
|
27
|
+
link(:href => r.call(@this, :external, :one, :two, :three)) { "external/one/two/three" }
|
28
|
+
}
|
29
|
+
item {
|
30
|
+
link(:href => r.call(@this, :external, :one, :foo => :bar)) { "external/one?foo=bar" }
|
31
|
+
}
|
32
|
+
end
|
33
|
+
text "The arguments you have passed to this action are:"
|
34
|
+
if args.empty?
|
35
|
+
text "none"
|
36
|
+
else
|
37
|
+
list {
|
38
|
+
args.each do |arg|
|
39
|
+
item arg
|
40
|
+
end
|
41
|
+
}
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
Ramaze.start :file => __FILE__
|
@@ -0,0 +1,57 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<xsl:stylesheet version="1.0"
|
3
|
+
xmlns="http://www.w3.org/1999/xhtml"
|
4
|
+
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
5
|
+
exclude-result-prefixes="xsl">
|
6
|
+
|
7
|
+
<xsl:output method="xml"
|
8
|
+
version="1.0"
|
9
|
+
encoding="utf-8"
|
10
|
+
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN"
|
11
|
+
doctype-system="DTD/xhtml1-strict.dtd"
|
12
|
+
indent="yes"/>
|
13
|
+
|
14
|
+
<xsl:template match="/page">
|
15
|
+
<html>
|
16
|
+
<head>
|
17
|
+
<title>
|
18
|
+
<xsl:value-of select="@title"/>
|
19
|
+
</title>
|
20
|
+
</head>
|
21
|
+
<body>
|
22
|
+
<xsl:apply-templates/>
|
23
|
+
</body>
|
24
|
+
</html>
|
25
|
+
</xsl:template>
|
26
|
+
|
27
|
+
<xsl:template match="heading">
|
28
|
+
<h1>
|
29
|
+
<xsl:apply-templates/>
|
30
|
+
</h1>
|
31
|
+
</xsl:template>
|
32
|
+
|
33
|
+
<xsl:template match="list">
|
34
|
+
<ul>
|
35
|
+
<xsl:apply-templates/>
|
36
|
+
</ul>
|
37
|
+
</xsl:template>
|
38
|
+
|
39
|
+
<xsl:template match="list/item">
|
40
|
+
<li>
|
41
|
+
<xsl:apply-templates/>
|
42
|
+
</li>
|
43
|
+
</xsl:template>
|
44
|
+
|
45
|
+
<xsl:template match="link">
|
46
|
+
<a href="{@href}">
|
47
|
+
<xsl:apply-templates/>
|
48
|
+
</a>
|
49
|
+
</xsl:template>
|
50
|
+
|
51
|
+
<xsl:template match="text">
|
52
|
+
<p>
|
53
|
+
<xsl:apply-templates/>
|
54
|
+
</p>
|
55
|
+
</xsl:template>
|
56
|
+
|
57
|
+
</xsl:stylesheet>
|
data/lib/proto/config.ru
CHANGED
@@ -8,9 +8,10 @@
|
|
8
8
|
# Rack::Builder DSL to configure middleware and build up applications easily.
|
9
9
|
#
|
10
10
|
# rackup automatically figures out the environment it is run in, and runs your
|
11
|
-
# application as FastCGI, CGI, or standalone with Mongrel or WEBrick
|
11
|
+
# application as FastCGI, CGI, or standalone with Mongrel or WEBrick—all from
|
12
12
|
# the same configuration.
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
cwd = File.dirname(__FILE__)
|
15
|
+
require "#{cwd}/start"
|
16
|
+
Ramaze.start(:started => true)
|
17
|
+
run Innate
|
File without changes
|
data/lib/proto/spec/main.rb
CHANGED
@@ -2,20 +2,21 @@ require 'ramaze'
|
|
2
2
|
require 'ramaze/spec'
|
3
3
|
|
4
4
|
require __DIR__('../start')
|
5
|
-
Ramaze.options.roots = __DIR__('../')
|
6
5
|
|
7
6
|
describe MainController do
|
8
7
|
behaves_like :mock
|
9
8
|
|
10
9
|
should 'show start page' do
|
11
|
-
get('/')
|
12
|
-
|
13
|
-
|
10
|
+
got = get('/')
|
11
|
+
got.status.should == 200
|
12
|
+
got['Content-Type'].should == 'text/html'
|
13
|
+
got.body.should =~ /<h1>Welcome to Ramaze!<\/h1>/
|
14
14
|
end
|
15
15
|
|
16
16
|
should 'show /notemplate' do
|
17
|
-
get('/notemplate')
|
18
|
-
|
19
|
-
|
17
|
+
got = get('/notemplate')
|
18
|
+
got.status.should == 200
|
19
|
+
got['Content-Type'].should == 'text/html'
|
20
|
+
got.body.should =~ /there is no 'notemplate.xhtml' associated with this action/
|
20
21
|
end
|
21
22
|
end
|
data/lib/proto/start.rb
CHANGED
@@ -1,8 +1,12 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
# All application related things should go into `app.rb`, this file is simply
|
4
|
-
# for options related to running the application locally.
|
1
|
+
require 'rubygems'
|
2
|
+
require 'ramaze'
|
5
3
|
|
6
|
-
|
4
|
+
# Add the directory this file resides in to the load path, so you can run the
|
5
|
+
# app from any other working directory
|
6
|
+
$LOAD_PATH.unshift(__DIR__)
|
7
7
|
|
8
|
-
|
8
|
+
# Initialize controllers and models
|
9
|
+
require 'controller/init'
|
10
|
+
require 'model/init'
|
11
|
+
|
12
|
+
Ramaze.start(:adapter => :webrick, :port => 7000) if __FILE__ == $0
|
File without changes
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<?xml version="1.0" ?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml">
|
5
|
+
<head>
|
6
|
+
<title>#{@title}</title>
|
7
|
+
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
8
|
+
<meta http-equiv="Content-Style-Type" content="text/css" />
|
9
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
10
|
+
<meta http-equiv="expires" content="0" />
|
11
|
+
<meta name="description" content="Description for search engines" />
|
12
|
+
<meta name="generator" content="Ramaze #{Ramaze::VERSION}" />
|
13
|
+
<meta name="keywords" content="Ramaze, Your own keywords" />
|
14
|
+
<meta name="author" content="Max Mustermann" />
|
15
|
+
<meta name="date" content="#{Time.now.iso8601}" />
|
16
|
+
<style type="text/css">
|
17
|
+
body { margin: 2em; }
|
18
|
+
#content { margin-left: 2em; }
|
19
|
+
</style>
|
20
|
+
</head>
|
21
|
+
<body>
|
22
|
+
<h1>#{@title}</h1>
|
23
|
+
<div id="content">
|
24
|
+
#@content
|
25
|
+
</div>
|
26
|
+
</body>
|
27
|
+
</html>
|
data/lib/ramaze/app.rb
CHANGED
@@ -68,11 +68,11 @@ module Ramaze
|
|
68
68
|
|
69
69
|
APP_LIST = {}
|
70
70
|
|
71
|
-
attr_reader :name, :location, :
|
71
|
+
attr_reader :name, :location, :map, :options
|
72
72
|
|
73
73
|
def initialize(name, location)
|
74
74
|
@name = name.to_sym
|
75
|
-
@
|
75
|
+
@map = Innate::URLMap.new
|
76
76
|
self.location = location
|
77
77
|
|
78
78
|
APP_LIST[@name] = self
|
@@ -95,16 +95,16 @@ module Ramaze
|
|
95
95
|
|
96
96
|
def to_app
|
97
97
|
files = Ramaze::Files.new(*public_roots)
|
98
|
-
app = Current.new(Route.new(
|
98
|
+
app = Current.new(Route.new(@map), Rewrite.new(@map))
|
99
99
|
Rack::Cascade.new([files, app])
|
100
100
|
end
|
101
101
|
|
102
102
|
def map(location, object)
|
103
|
-
|
103
|
+
@map.map(location, object)
|
104
104
|
end
|
105
105
|
|
106
106
|
def to(object)
|
107
|
-
return unless mapped =
|
107
|
+
return unless mapped = @map.to(object)
|
108
108
|
[location, mapped].join('/').squeeze('/')
|
109
109
|
end
|
110
110
|
|
data/lib/ramaze/cache.rb
CHANGED
@@ -7,9 +7,8 @@ module Ramaze
|
|
7
7
|
Cache = Innate::Cache
|
8
8
|
|
9
9
|
class Cache
|
10
|
-
autoload :
|
11
|
-
autoload :
|
12
|
-
autoload :Sequel, 'ramaze/cache/sequel'
|
10
|
+
autoload :MemCache, 'ramaze/cache/memcache'
|
11
|
+
autoload :Sequel, 'ramaze/cache/sequel'
|
13
12
|
|
14
13
|
def self.clear_after_reload
|
15
14
|
action.clear if respond_to?(:action)
|
data/lib/ramaze/contrib/email.rb
CHANGED