ramaze 0.0.9 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +14 -259
- data/bin/ramaze +52 -25
- data/doc/AUTHORS +6 -0
- data/doc/CHANGELOG +1363 -42
- data/doc/INSTALL +1 -1
- data/doc/README +48 -35
- data/doc/README.html +637 -0
- data/doc/TODO +7 -16
- data/doc/allison/allison.css +6 -7
- data/doc/allison/allison.gif +0 -0
- data/doc/allison/cache/STYLE +1 -2
- data/doc/changes.txt +3375 -0
- data/doc/changes.xml +3378 -0
- data/doc/meta/announcement.txt +47 -0
- data/doc/meta/configuration.txt +179 -0
- data/doc/meta/internals.txt +111 -0
- data/doc/readme_chunks/features.txt +8 -16
- data/doc/readme_chunks/installing.txt +7 -1
- data/doc/tutorial/todolist.txt +2 -3
- data/examples/blog/main.rb +9 -8
- data/examples/blog/public/styles/blog.css +132 -0
- data/examples/blog/src/controller.rb +14 -41
- data/examples/blog/src/model.rb +12 -13
- data/examples/blog/src/view.rb +16 -0
- data/examples/blog/template/edit.xhtml +19 -8
- data/examples/blog/template/index.xhtml +14 -22
- data/examples/blog/template/new.xhtml +18 -5
- data/examples/caching.rb +5 -8
- data/examples/element.rb +3 -3
- data/examples/hello.rb +3 -5
- data/examples/simple.rb +4 -7
- data/examples/templates/template/external.haml +8 -7
- data/examples/templates/template/external.mab +11 -8
- data/examples/templates/template_amrita2.rb +4 -4
- data/examples/templates/template_erubis.rb +3 -3
- data/examples/templates/template_ezamar.rb +1 -2
- data/examples/templates/template_haml.rb +24 -23
- data/examples/templates/template_liquid.rb +3 -1
- data/examples/templates/template_markaby.rb +15 -9
- data/examples/todolist/src/element/page.rb +1 -1
- data/lib/proto/conf/benchmark.yaml +6 -20
- data/lib/proto/conf/debug.yaml +6 -19
- data/lib/proto/conf/live.yaml +7 -19
- data/lib/proto/conf/silent.yaml +6 -16
- data/lib/proto/conf/stage.yaml +6 -18
- data/lib/proto/public/error.zmr +2 -2
- data/lib/ramaze.rb +34 -72
- data/lib/ramaze/adapter.rb +21 -18
- data/lib/ramaze/adapter/mongrel.rb +0 -3
- data/lib/ramaze/adapter/webrick.rb +6 -6
- data/lib/ramaze/cache/memcached.rb +3 -0
- data/lib/ramaze/controller.rb +227 -183
- data/lib/ramaze/dispatcher.rb +34 -129
- data/lib/ramaze/dispatcher/action.rb +28 -0
- data/lib/ramaze/dispatcher/error.rb +43 -0
- data/lib/ramaze/dispatcher/file.rb +34 -0
- data/lib/ramaze/global.rb +89 -48
- data/lib/ramaze/helper/aspect.rb +8 -6
- data/lib/ramaze/helper/auth.rb +3 -3
- data/lib/ramaze/helper/cache.rb +2 -2
- data/lib/ramaze/helper/file.rb +14 -0
- data/lib/ramaze/helper/inform.rb +36 -0
- data/lib/ramaze/helper/link.rb +7 -3
- data/lib/ramaze/helper/markaby.rb +30 -0
- data/lib/ramaze/helper/redirect.rb +2 -0
- data/lib/ramaze/inform.rb +8 -182
- data/lib/ramaze/inform/analogger.rb +19 -0
- data/lib/ramaze/inform/growl.rb +28 -0
- data/lib/ramaze/inform/hub.rb +26 -0
- data/lib/ramaze/inform/informer.rb +92 -0
- data/lib/ramaze/inform/informing.rb +44 -0
- data/lib/ramaze/inform/syslog.rb +27 -0
- data/lib/ramaze/inform/xosd.rb +42 -0
- data/lib/ramaze/snippets.rb +6 -2
- data/lib/ramaze/snippets/object/traits.rb +13 -1
- data/lib/ramaze/snippets/ramaze/autoreload.rb +58 -2
- data/lib/ramaze/snippets/string/color.rb +27 -0
- data/lib/ramaze/snippets/string/each.rb +6 -0
- data/lib/ramaze/snippets/struct/fill.rb +15 -0
- data/lib/ramaze/template/ezamar.rb +13 -22
- data/lib/ramaze/template/ezamar/element.rb +12 -12
- data/lib/ramaze/template/liquid.rb +19 -18
- data/lib/ramaze/template/markaby.rb +37 -58
- data/lib/ramaze/tool/localize.rb +128 -0
- data/lib/ramaze/tool/tidy.rb +51 -21
- data/lib/ramaze/trinity.rb +3 -3
- data/lib/ramaze/trinity/request.rb +41 -23
- data/lib/ramaze/trinity/response.rb +10 -5
- data/lib/ramaze/trinity/session.rb +17 -3
- data/lib/ramaze/version.rb +2 -2
- data/rake_tasks/conf.rake +56 -0
- data/rake_tasks/gem.rake +44 -0
- data/rake_tasks/maintaince.rake +187 -0
- data/spec/all.rb +32 -0
- data/spec/examples/caching.rb +19 -0
- data/spec/examples/element.rb +15 -0
- data/spec/examples/hello.rb +11 -0
- data/spec/examples/simple.rb +51 -0
- data/spec/examples/templates/template_amrita2.rb +14 -0
- data/spec/examples/templates/template_erubis.rb +21 -0
- data/spec/examples/templates/template_ezamar.rb +22 -0
- data/spec/examples/templates/template_haml.rb +23 -0
- data/spec/examples/templates/template_liquid.rb +24 -0
- data/spec/examples/templates/template_markaby.rb +21 -0
- data/spec/helper.rb +81 -0
- data/spec/{spec_helper_context.rb → helper/context.rb} +1 -1
- data/spec/helper/layout.rb +55 -0
- data/spec/helper/mock_http.rb +66 -0
- data/spec/{spec_helper_requester.rb → helper/requester.rb} +0 -6
- data/spec/{spec_helper_simple_http.rb → helper/simple_http.rb} +57 -57
- data/spec/helper/wrap.rb +193 -0
- data/spec/{adapter_spec.rb → ramaze/adapter.rb} +7 -5
- data/spec/{tc_adapter_mongrel.rb → ramaze/adapter/mongrel.rb} +2 -2
- data/spec/{tc_adapter_webrick.rb → ramaze/adapter/webrick.rb} +2 -2
- data/spec/{tc_cache.rb → ramaze/cache.rb} +16 -16
- data/spec/ramaze/conf/locale_de.yaml +6 -0
- data/spec/ramaze/conf/locale_en.yaml +6 -0
- data/spec/ramaze/controller.rb +184 -0
- data/spec/ramaze/controller/template/greet.xhtml +1 -0
- data/spec/ramaze/controller/template_resolving.rb +54 -0
- data/spec/ramaze/dependencies.rb +16 -0
- data/spec/{tc_element.rb → ramaze/element.rb} +21 -19
- data/spec/ramaze/error.rb +64 -0
- data/spec/{tc_gestalt.rb → ramaze/gestalt.rb} +10 -10
- data/spec/{tc_global.rb → ramaze/global.rb} +7 -7
- data/spec/{tc_helper_aspect.rb → ramaze/helper/aspect.rb} +22 -14
- data/spec/{tc_helper_auth.rb → ramaze/helper/auth.rb} +9 -7
- data/spec/{tc_helper_cache.rb → ramaze/helper/cache.rb} +14 -24
- data/spec/{tc_helper_feed.rb → ramaze/helper/feed.rb} +12 -12
- data/spec/ramaze/helper/file.rb +17 -0
- data/spec/{tc_helper_flash.rb → ramaze/helper/flash.rb} +16 -17
- data/spec/{tc_helper_form.rb → ramaze/helper/form.rb} +25 -26
- data/spec/{tc_helper_link.rb → ramaze/helper/link.rb} +9 -9
- data/spec/{tc_helper_redirect.rb → ramaze/helper/redirect.rb} +11 -10
- data/spec/{tc_helper_stack.rb → ramaze/helper/stack.rb} +10 -11
- data/spec/ramaze/inform/informer.rb +40 -0
- data/spec/ramaze/inform/syslog.rb +10 -0
- data/spec/ramaze/localize.rb +40 -0
- data/spec/ramaze/morpher.rb +82 -0
- data/spec/ramaze/params.rb +124 -0
- data/spec/{public → ramaze/public}/error404.xhtml +0 -0
- data/spec/{public → ramaze/public}/favicon.ico +0 -0
- data/spec/{public → ramaze/public}/ramaze.png +0 -0
- data/spec/{public → ramaze/public}/test_download.css +0 -0
- data/spec/ramaze/request.rb +129 -0
- data/spec/{tc_request_mongrel.rb → ramaze/request/mongrel.rb} +2 -2
- data/spec/{tc_request_webrick.rb → ramaze/request/webrick.rb} +1 -1
- data/spec/{tc_session.rb → ramaze/session.rb} +18 -18
- data/spec/{tc_store.rb → ramaze/store/default.rb} +10 -10
- data/spec/{tc_store_yaml.rb → ramaze/store/yaml.rb} +9 -9
- data/spec/ramaze/template.rb +86 -0
- data/spec/{tc_template_amrita2.rb → ramaze/template/amrita2.rb} +5 -5
- data/spec/{template → ramaze/template}/amrita2/data.amrita +0 -0
- data/spec/{template → ramaze/template}/amrita2/index.amrita +0 -0
- data/spec/{template → ramaze/template}/amrita2/sum.amrita +0 -0
- data/spec/{tc_template_erubis.rb → ramaze/template/erubis.rb} +9 -9
- data/spec/{template → ramaze/template}/erubis/sum.rhtml +0 -0
- data/spec/ramaze/template/ezamar.rb +62 -0
- data/spec/{template → ramaze/template}/ezamar/another/long/action.zmr +0 -0
- data/spec/{template → ramaze/template}/ezamar/combined.zmr +0 -0
- data/spec/{template → ramaze/template}/ezamar/file_only.zmr +0 -0
- data/spec/{template → ramaze/template}/ezamar/index.zmr +0 -0
- data/spec/ramaze/template/ezamar/nested.zmr +1 -0
- data/spec/{template → ramaze/template}/ezamar/some__long__action.zmr +0 -0
- data/spec/{template → ramaze/template}/ezamar/sum.zmr +0 -0
- data/spec/{tc_template_haml.rb → ramaze/template/haml.rb} +7 -7
- data/spec/{template → ramaze/template}/haml/index.haml +0 -0
- data/spec/{template → ramaze/template}/haml/with_vars.haml +0 -0
- data/spec/{tc_template_liquid.rb → ramaze/template/liquid.rb} +7 -7
- data/spec/{template → ramaze/template}/liquid/index.liquid +0 -0
- data/spec/{template → ramaze/template}/liquid/products.liquid +0 -0
- data/spec/ramaze/template/markaby.rb +59 -0
- data/spec/{template → ramaze/template}/markaby/external.mab +0 -0
- data/spec/{template → ramaze/template}/markaby/sum.mab +0 -0
- data/spec/ramaze/template/ramaze/external.test +1 -0
- data/spec/{tc_tidy.rb → ramaze/tidy.rb} +3 -3
- metadata +145 -81
- data/examples/blog/public/screen.css +0 -106
- data/examples/blog/src/element.rb +0 -58
- data/examples/blog/template/view.xhtml +0 -15
- data/examples/blog/test/tc_entry.rb +0 -18
- data/lib/proto/public/404.jpg +0 -0
- data/spec/request_tc_helper.rb +0 -135
- data/spec/spec_all.rb +0 -118
- data/spec/spec_helper.rb +0 -66
- data/spec/tc_controller.rb +0 -49
- data/spec/tc_dependencies.rb +0 -13
- data/spec/tc_error.rb +0 -43
- data/spec/tc_morpher.rb +0 -88
- data/spec/tc_params.rb +0 -125
- data/spec/tc_template_ezamar.rb +0 -64
- data/spec/tc_template_markaby.rb +0 -72
- data/spec/template/ezamar/nested.zmr +0 -1
@@ -0,0 +1,86 @@
|
|
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 'spec/helper'
|
5
|
+
require 'ramaze/template'
|
6
|
+
|
7
|
+
module Ramaze::Template
|
8
|
+
class TestTemplate < Template
|
9
|
+
Ramaze::Controller.register_engine self, %w[ test ]
|
10
|
+
class << self
|
11
|
+
def transform controller, options = {}
|
12
|
+
action, parameter, file, bound = *super
|
13
|
+
[ controller.class.name,
|
14
|
+
action,
|
15
|
+
parameter,
|
16
|
+
file
|
17
|
+
].to_yaml
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
class TCTemplateController < Ramaze::Controller
|
24
|
+
trait :engine => Ramaze::Template::TestTemplate
|
25
|
+
trait :template_root => (File.dirname(__FILE__)/:template/:ramaze)
|
26
|
+
|
27
|
+
def index *args
|
28
|
+
end
|
29
|
+
|
30
|
+
def some_other_method *args
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe "testing ramaze template" do
|
35
|
+
ramaze(:mapping => {'/' => TCTemplateController})
|
36
|
+
|
37
|
+
def getpage page
|
38
|
+
@controller, @action, @parameter, @file = YAML.load(get( page ).body)
|
39
|
+
end
|
40
|
+
|
41
|
+
it "Gets a blank page" do
|
42
|
+
getpage("/index")
|
43
|
+
|
44
|
+
@controller.should == "TCTemplateController"
|
45
|
+
@action.should == "index"
|
46
|
+
@parameter.should == []
|
47
|
+
@file.should == nil
|
48
|
+
end
|
49
|
+
|
50
|
+
it "Maps the index" do
|
51
|
+
getpage("/")
|
52
|
+
|
53
|
+
@controller.should == "TCTemplateController"
|
54
|
+
@action.should == "index"
|
55
|
+
@parameter.should == []
|
56
|
+
@file.should == nil
|
57
|
+
end
|
58
|
+
|
59
|
+
it "Parses parameters" do
|
60
|
+
getpage("/one/two/three")
|
61
|
+
|
62
|
+
@controller.should == "TCTemplateController"
|
63
|
+
@action.should == "index"
|
64
|
+
@parameter.should == %w{one two three}
|
65
|
+
@file.should == nil
|
66
|
+
end
|
67
|
+
|
68
|
+
it "Knows about other methods" do
|
69
|
+
getpage("/some_other_method")
|
70
|
+
|
71
|
+
@controller.should == "TCTemplateController"
|
72
|
+
@action.should == "some_other_method"
|
73
|
+
@parameter.should == []
|
74
|
+
@file.should == nil
|
75
|
+
end
|
76
|
+
|
77
|
+
it "Uses external template files" do
|
78
|
+
getpage("/external")
|
79
|
+
|
80
|
+
@controller.should == "TCTemplateController"
|
81
|
+
@action.should == "external"
|
82
|
+
@parameter.should == []
|
83
|
+
file = TCTemplateController.trait[:template_root]/'external.test'
|
84
|
+
@file.should == File.expand_path(file)
|
85
|
+
end
|
86
|
+
end
|
@@ -1,12 +1,12 @@
|
|
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
|
-
require 'spec/
|
4
|
+
require 'spec/helper'
|
5
5
|
|
6
6
|
testcase_requires 'amrita2'
|
7
7
|
|
8
8
|
class TCTemplateAmritaController < Ramaze::Controller
|
9
|
-
trait :template_root => 'spec/template/amrita2/'
|
9
|
+
trait :template_root => 'spec/ramaze/template/amrita2/'
|
10
10
|
trait :engine => Ramaze::Template::Amrita2
|
11
11
|
trait :actionless => true
|
12
12
|
|
@@ -19,11 +19,11 @@ class TCTemplateAmritaController < Ramaze::Controller
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
|
22
|
+
describe "Simply calling" do
|
23
23
|
ramaze(:mapping => {'/' => TCTemplateAmritaController})
|
24
24
|
|
25
|
-
|
26
|
-
get('/data').should ==
|
25
|
+
it "should respond to /data" do
|
26
|
+
get('/data').body.strip.should ==
|
27
27
|
%{<html>
|
28
28
|
<body>
|
29
29
|
<h1>hello world</h1>
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,12 +1,12 @@
|
|
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
|
-
require 'spec/
|
4
|
+
require 'spec/helper'
|
5
5
|
|
6
6
|
testcase_requires 'erubis'
|
7
7
|
|
8
8
|
class TCTemplateErubisController < Ramaze::Controller
|
9
|
-
trait :template_root => 'spec/template/erubis/'
|
9
|
+
trait :template_root => 'spec/ramaze/template/erubis/'
|
10
10
|
trait :engine => Ramaze::Template::Erubis
|
11
11
|
|
12
12
|
def index
|
@@ -23,18 +23,18 @@ class TCTemplateErubisController < Ramaze::Controller
|
|
23
23
|
end
|
24
24
|
end
|
25
25
|
|
26
|
-
|
26
|
+
describe "Erubis" do
|
27
27
|
ramaze(:mapping => {'/' => TCTemplateErubisController})
|
28
28
|
|
29
|
-
|
30
|
-
get('/').should == 'Erubis Index'
|
29
|
+
it "index" do
|
30
|
+
get('/').body.should == 'Erubis Index'
|
31
31
|
end
|
32
32
|
|
33
|
-
|
34
|
-
get('/sum/1/2').should == '3'
|
33
|
+
it "sum" do
|
34
|
+
get('/sum/1/2').body.strip.should == '3'
|
35
35
|
end
|
36
36
|
|
37
|
-
|
38
|
-
get('/inline/foo/bar').should == %w[foo bar].inspect
|
37
|
+
it "inline" do
|
38
|
+
get('/inline/foo/bar').body.should == %w[foo bar].inspect
|
39
39
|
end
|
40
40
|
end
|
File without changes
|
@@ -0,0 +1,62 @@
|
|
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 'spec/helper'
|
5
|
+
|
6
|
+
class TCTemplateController < Ramaze::Controller
|
7
|
+
trait :template_root => 'spec/ramaze/template/ezamar'
|
8
|
+
trait :engine => Ramaze::Template::Ezamar
|
9
|
+
|
10
|
+
def index text
|
11
|
+
@text = text
|
12
|
+
end
|
13
|
+
|
14
|
+
def sum num1, num2
|
15
|
+
@num1, @num2 = num1.to_i, num2.to_i
|
16
|
+
end
|
17
|
+
|
18
|
+
def nested key, value
|
19
|
+
instance_variable_set("@#{key}", value)
|
20
|
+
end
|
21
|
+
|
22
|
+
def internal *args
|
23
|
+
@args = args
|
24
|
+
'<?r i = 2 ?>#{i * i} #{@args.inspect} on the table'
|
25
|
+
end
|
26
|
+
|
27
|
+
def combined
|
28
|
+
@a = 'boo'
|
29
|
+
nil
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
describe "Ezamar" do
|
35
|
+
ramaze(:mapping => {'/' => TCTemplateController})
|
36
|
+
|
37
|
+
it "hello world" do
|
38
|
+
get('/World').body.should == 'Hello, World!'
|
39
|
+
get('/You').body.should == 'Hello, You!'
|
40
|
+
end
|
41
|
+
|
42
|
+
it "summing" do
|
43
|
+
get('/sum/1/2').body.should == '3'
|
44
|
+
end
|
45
|
+
|
46
|
+
it "nasty nested stuff" do
|
47
|
+
get('/nested/foo/bar').body.should == 'bar'
|
48
|
+
end
|
49
|
+
|
50
|
+
it "template inside controller" do
|
51
|
+
get('/internal').body.should == '4 [] on the table'
|
52
|
+
get('/internal/foo').body.should == '4 ["foo"] on the table'
|
53
|
+
end
|
54
|
+
|
55
|
+
it "without method" do
|
56
|
+
get('/file_only').body.should == "This is only the file"
|
57
|
+
end
|
58
|
+
|
59
|
+
it "combined" do
|
60
|
+
get('/combined').body.should == 'boo'
|
61
|
+
end
|
62
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
#@foo
|
File without changes
|
File without changes
|
@@ -1,12 +1,12 @@
|
|
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
|
-
require 'spec/
|
4
|
+
require 'spec/helper'
|
5
5
|
|
6
6
|
testcase_requires 'ramaze/template/haml'
|
7
7
|
|
8
8
|
class TCTemplateHamlController < Ramaze::Controller
|
9
|
-
trait :template_root => 'spec/template/haml/'
|
9
|
+
trait :template_root => 'spec/ramaze/template/haml/'
|
10
10
|
trait :engine => Ramaze::Template::Haml
|
11
11
|
|
12
12
|
helper :link
|
@@ -19,11 +19,11 @@ class TCTemplateHamlController < Ramaze::Controller
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
-
|
22
|
+
describe "Simply calling" do
|
23
23
|
ramaze(:mapping => {'/' => TCTemplateHamlController})
|
24
24
|
|
25
|
-
|
26
|
-
get('/').should ==
|
25
|
+
it "index" do
|
26
|
+
get('/').body.strip.should ==
|
27
27
|
"<div id='contact'>
|
28
28
|
<h1>Eugene Mumbai</h1>
|
29
29
|
<ul class='info'>
|
@@ -33,8 +33,8 @@ context "Simply calling" do
|
|
33
33
|
</div>"
|
34
34
|
end
|
35
35
|
|
36
|
-
|
37
|
-
get('/with_vars').should ==
|
36
|
+
it "variables in controller" do
|
37
|
+
get('/with_vars').body.strip.should ==
|
38
38
|
%{<div id='content'>
|
39
39
|
<div class='title'>
|
40
40
|
<h1>Teen Wolf</h1>
|
File without changes
|
File without changes
|
@@ -1,7 +1,7 @@
|
|
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
|
-
require 'spec/
|
4
|
+
require 'spec/helper'
|
5
5
|
|
6
6
|
testcase_requires 'liquid'
|
7
7
|
|
@@ -25,7 +25,7 @@ end
|
|
25
25
|
|
26
26
|
|
27
27
|
class TCTemplateLiquidController < Ramaze::Controller
|
28
|
-
trait :template_root => 'spec/template/liquid/'
|
28
|
+
trait :template_root => 'spec/ramaze/template/liquid/'
|
29
29
|
trait :engine => Ramaze::Template::Liquid
|
30
30
|
trait :liquid_options => { :filters => ProductsFilter }
|
31
31
|
|
@@ -47,16 +47,16 @@ class TCTemplateLiquidController < Ramaze::Controller
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
|
50
|
+
describe "Liquid" do
|
51
51
|
ramaze(:mapping => {'/' => TCTemplateLiquidController})
|
52
52
|
|
53
|
-
|
54
|
-
get('/').should == "hi tobi"
|
53
|
+
it "index" do
|
54
|
+
get('/').body.strip.should == "hi tobi"
|
55
55
|
end
|
56
56
|
|
57
|
-
|
57
|
+
it "products" do
|
58
58
|
o = get('/products')
|
59
|
-
o = o.split("\n").map{|l| l.strip!; l.empty? ? nil : l}.compact.join("\n")
|
59
|
+
o = o.body.split("\n").map{|l| l.strip!; l.empty? ? nil : l}.compact.join("\n")
|
60
60
|
o.should == %{
|
61
61
|
<?xml version="1.0" encoding="utf-8"?>
|
62
62
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
File without changes
|
File without changes
|
@@ -0,0 +1,59 @@
|
|
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 'spec/helper'
|
5
|
+
|
6
|
+
testcase_requires 'markaby'
|
7
|
+
|
8
|
+
class TCTemplateMarkabyController < Ramaze::Controller
|
9
|
+
trait :template_root => 'spec/ramaze/template/markaby/'
|
10
|
+
trait :engine => Ramaze::Template::Markaby
|
11
|
+
|
12
|
+
helper :markaby
|
13
|
+
|
14
|
+
def index
|
15
|
+
mab { h1 "Markaby Index" }
|
16
|
+
end
|
17
|
+
|
18
|
+
def links
|
19
|
+
mab do
|
20
|
+
ul do
|
21
|
+
li { a "Index page", :href => R(self,:index) }
|
22
|
+
li { a "Internal template", :href => R(self,:internal) }
|
23
|
+
li { a "External template", :href => R(self,:external) }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def external
|
29
|
+
end
|
30
|
+
|
31
|
+
def sum num1, num2
|
32
|
+
@num1, @num2 = num1.to_i, num2.to_i
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
describe "Markaby" do
|
37
|
+
ramaze(:mapping => {'/' => TCTemplateMarkabyController})
|
38
|
+
|
39
|
+
it "index" do
|
40
|
+
get('/').body.should == '<h1>Markaby Index</h1>'
|
41
|
+
end
|
42
|
+
|
43
|
+
it "links" do
|
44
|
+
get('/links').body.should == '<ul><li><a href="/index">Index page</a></li><li><a href="/internal">Internal template</a></li><li><a href="/external">External template</a></li></ul>'
|
45
|
+
end
|
46
|
+
|
47
|
+
it "sum" do
|
48
|
+
get('/sum/1/2').body.should == '<div>3</div>'
|
49
|
+
end
|
50
|
+
|
51
|
+
it "external" do
|
52
|
+
get('/external').body.should == "<html><head><meta content=\"text/html; charset=utf-8\" http-equiv=\"Content-Type\"/><title>Markaby Test</title></head><body><h1>Markaby Template</h1></body></html>"
|
53
|
+
end
|
54
|
+
|
55
|
+
it "should not respond to mab" do
|
56
|
+
response = get('/mab')
|
57
|
+
response.status.should == 404
|
58
|
+
end
|
59
|
+
end
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
Hello World
|
@@ -1,12 +1,12 @@
|
|
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
|
-
require 'spec/
|
4
|
+
require 'spec/helper'
|
5
5
|
|
6
6
|
testcase_requires 'tidy', 'ramaze/tool/tidy'
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
describe "testing tidy" do
|
9
|
+
it "tidy some simple html" do
|
10
10
|
Ramaze::Tool::Tidy.tidy("<html></html>").should =~ %r{<html>\s+<head>\s+<meta name="generator" content="HTML Tidy (.*?)" />\s+<title></title>\s+</head>\s+<body></body>\s+</html>}
|
11
11
|
end
|
12
12
|
end
|
metadata
CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.9.2
|
|
3
3
|
specification_version: 1
|
4
4
|
name: ramaze
|
5
5
|
version: !ruby/object:Gem::Version
|
6
|
-
version: 0.0
|
7
|
-
date: 2007-
|
6
|
+
version: 0.1.0
|
7
|
+
date: 2007-05-11 00:00:00 +09:00
|
8
8
|
summary: Ramaze tries to be a very simple Webframework without the voodoo
|
9
9
|
require_paths:
|
10
10
|
- lib
|
@@ -35,7 +35,7 @@ post_install_message: |-
|
|
35
35
|
ramaze --create yourproject
|
36
36
|
|
37
37
|
* Browse and try the Examples in
|
38
|
-
/usr/lib/ruby/gems/1.8/gems/ramaze-0.0
|
38
|
+
/usr/lib/ruby/gems/1.8/gems/ramaze-0.1.0/examples
|
39
39
|
|
40
40
|
============================================================
|
41
41
|
authors:
|
@@ -51,17 +51,15 @@ files:
|
|
51
51
|
- examples/blog/src
|
52
52
|
- examples/blog/src/model.rb
|
53
53
|
- examples/blog/src/controller.rb
|
54
|
-
- examples/blog/src/
|
55
|
-
- examples/blog/test
|
56
|
-
- examples/blog/test/tc_entry.rb
|
54
|
+
- examples/blog/src/view.rb
|
57
55
|
- examples/blog/template
|
58
56
|
- examples/blog/template/new.xhtml
|
59
|
-
- examples/blog/template/view.xhtml
|
60
57
|
- examples/blog/template/edit.xhtml
|
61
58
|
- examples/blog/template/index.xhtml
|
62
59
|
- examples/blog/main.rb
|
63
60
|
- examples/blog/public
|
64
|
-
- examples/blog/public/
|
61
|
+
- examples/blog/public/styles
|
62
|
+
- examples/blog/public/styles/blog.css
|
65
63
|
- examples/nitro_form.rb
|
66
64
|
- examples/caching.rb
|
67
65
|
- examples/todolist
|
@@ -118,6 +116,10 @@ files:
|
|
118
116
|
- bin/ramaze
|
119
117
|
- doc/GPL
|
120
118
|
- doc/TODO
|
119
|
+
- doc/meta
|
120
|
+
- doc/meta/internals.txt
|
121
|
+
- doc/meta/configuration.txt
|
122
|
+
- doc/meta/announcement.txt
|
121
123
|
- doc/readme_chunks
|
122
124
|
- doc/readme_chunks/appendix.txt
|
123
125
|
- doc/readme_chunks/thanks.txt
|
@@ -132,6 +134,7 @@ files:
|
|
132
134
|
- doc/tutorial
|
133
135
|
- doc/tutorial/todolist.html
|
134
136
|
- doc/tutorial/todolist.txt
|
137
|
+
- doc/AUTHORS
|
135
138
|
- doc/allison
|
136
139
|
- doc/allison/LICENSE
|
137
140
|
- doc/allison/cache
|
@@ -155,79 +158,118 @@ files:
|
|
155
158
|
- doc/allison/allison.rb
|
156
159
|
- doc/allison/allison.css
|
157
160
|
- doc/allison/allison.gif
|
161
|
+
- doc/README.html
|
158
162
|
- doc/INSTALL
|
159
163
|
- doc/COPYING
|
160
164
|
- doc/ProjectInfo
|
161
|
-
-
|
162
|
-
-
|
163
|
-
- spec/
|
164
|
-
- spec/
|
165
|
-
- spec/
|
166
|
-
- spec/
|
167
|
-
- spec/
|
168
|
-
- spec/
|
169
|
-
- spec/
|
170
|
-
- spec/
|
171
|
-
- spec/
|
172
|
-
- spec/
|
173
|
-
- spec/
|
174
|
-
- spec/
|
175
|
-
- spec/
|
176
|
-
- spec/
|
177
|
-
- spec/
|
178
|
-
- spec/
|
179
|
-
- spec/
|
180
|
-
- spec/
|
181
|
-
- spec/
|
182
|
-
- spec/template
|
183
|
-
- spec/template/
|
184
|
-
- spec/template/
|
185
|
-
- spec/template/
|
186
|
-
- spec/template/
|
187
|
-
- spec/template/ezamar
|
188
|
-
- spec/template/
|
189
|
-
- spec/template/
|
190
|
-
- spec/template/
|
191
|
-
- spec/template/
|
192
|
-
- spec/template/
|
193
|
-
- spec/template/
|
194
|
-
- spec/template/
|
195
|
-
- spec/template/
|
196
|
-
- spec/template/
|
197
|
-
- spec/template/
|
198
|
-
- spec/template/
|
199
|
-
- spec/template/
|
200
|
-
- spec/
|
201
|
-
- spec/
|
202
|
-
- spec/
|
203
|
-
- spec/
|
204
|
-
- spec/
|
205
|
-
- spec/
|
206
|
-
- spec/
|
207
|
-
- spec/
|
208
|
-
- spec/
|
209
|
-
- spec/
|
210
|
-
- spec/
|
211
|
-
- spec/
|
212
|
-
- spec/
|
213
|
-
- spec/
|
214
|
-
- spec/
|
215
|
-
- spec/
|
216
|
-
- spec/
|
217
|
-
- spec/
|
218
|
-
- spec/
|
219
|
-
- spec/
|
220
|
-
- spec/
|
221
|
-
- spec/
|
222
|
-
- spec/
|
223
|
-
- spec/
|
224
|
-
- spec/
|
225
|
-
- spec/
|
226
|
-
- spec/
|
227
|
-
- spec/
|
228
|
-
- spec/
|
229
|
-
- spec/
|
230
|
-
- spec/
|
165
|
+
- doc/changes.txt
|
166
|
+
- doc/changes.xml
|
167
|
+
- spec/all.rb
|
168
|
+
- spec/helper
|
169
|
+
- spec/helper/context.rb
|
170
|
+
- spec/helper/simple_http.rb
|
171
|
+
- spec/helper/mock_http.rb
|
172
|
+
- spec/helper/layout.rb
|
173
|
+
- spec/helper/requester.rb
|
174
|
+
- spec/helper/wrap.rb
|
175
|
+
- spec/ramaze
|
176
|
+
- spec/ramaze/conf
|
177
|
+
- spec/ramaze/conf/locale_de.yaml
|
178
|
+
- spec/ramaze/conf/locale_en.yaml
|
179
|
+
- spec/ramaze/request
|
180
|
+
- spec/ramaze/request/mongrel.rb
|
181
|
+
- spec/ramaze/request/webrick.rb
|
182
|
+
- spec/ramaze/store
|
183
|
+
- spec/ramaze/store/yaml.rb
|
184
|
+
- spec/ramaze/store/default.rb
|
185
|
+
- spec/ramaze/error.rb
|
186
|
+
- spec/ramaze/template
|
187
|
+
- spec/ramaze/template/haml
|
188
|
+
- spec/ramaze/template/haml/index.haml
|
189
|
+
- spec/ramaze/template/haml/with_vars.haml
|
190
|
+
- spec/ramaze/template/markaby.rb
|
191
|
+
- spec/ramaze/template/ezamar.rb
|
192
|
+
- spec/ramaze/template/erubis.rb
|
193
|
+
- spec/ramaze/template/markaby
|
194
|
+
- spec/ramaze/template/markaby/external.mab
|
195
|
+
- spec/ramaze/template/markaby/sum.mab
|
196
|
+
- spec/ramaze/template/liquid.rb
|
197
|
+
- spec/ramaze/template/erubis
|
198
|
+
- spec/ramaze/template/erubis/sum.rhtml
|
199
|
+
- spec/ramaze/template/ezamar
|
200
|
+
- spec/ramaze/template/ezamar/sum.zmr
|
201
|
+
- spec/ramaze/template/ezamar/nested.zmr
|
202
|
+
- spec/ramaze/template/ezamar/combined.zmr
|
203
|
+
- spec/ramaze/template/ezamar/index.zmr
|
204
|
+
- spec/ramaze/template/ezamar/some__long__action.zmr
|
205
|
+
- spec/ramaze/template/ezamar/file_only.zmr
|
206
|
+
- spec/ramaze/template/ezamar/another
|
207
|
+
- spec/ramaze/template/ezamar/another/long
|
208
|
+
- spec/ramaze/template/ezamar/another/long/action.zmr
|
209
|
+
- spec/ramaze/template/liquid
|
210
|
+
- spec/ramaze/template/liquid/index.liquid
|
211
|
+
- spec/ramaze/template/liquid/products.liquid
|
212
|
+
- spec/ramaze/template/haml.rb
|
213
|
+
- spec/ramaze/template/ramaze
|
214
|
+
- spec/ramaze/template/ramaze/external.test
|
215
|
+
- spec/ramaze/template/amrita2
|
216
|
+
- spec/ramaze/template/amrita2/sum.amrita
|
217
|
+
- spec/ramaze/template/amrita2/index.amrita
|
218
|
+
- spec/ramaze/template/amrita2/data.amrita
|
219
|
+
- spec/ramaze/template/amrita2.rb
|
220
|
+
- spec/ramaze/cache.rb
|
221
|
+
- spec/ramaze/dependencies.rb
|
222
|
+
- spec/ramaze/template.rb
|
223
|
+
- spec/ramaze/tidy.rb
|
224
|
+
- spec/ramaze/helper
|
225
|
+
- spec/ramaze/helper/link.rb
|
226
|
+
- spec/ramaze/helper/cache.rb
|
227
|
+
- spec/ramaze/helper/feed.rb
|
228
|
+
- spec/ramaze/helper/file.rb
|
229
|
+
- spec/ramaze/helper/redirect.rb
|
230
|
+
- spec/ramaze/helper/form.rb
|
231
|
+
- spec/ramaze/helper/flash.rb
|
232
|
+
- spec/ramaze/helper/stack.rb
|
233
|
+
- spec/ramaze/helper/auth.rb
|
234
|
+
- spec/ramaze/helper/aspect.rb
|
235
|
+
- spec/ramaze/adapter.rb
|
236
|
+
- spec/ramaze/localize.rb
|
237
|
+
- spec/ramaze/inform
|
238
|
+
- spec/ramaze/inform/informer.rb
|
239
|
+
- spec/ramaze/inform/syslog.rb
|
240
|
+
- spec/ramaze/adapter
|
241
|
+
- spec/ramaze/adapter/mongrel.rb
|
242
|
+
- spec/ramaze/adapter/webrick.rb
|
243
|
+
- spec/ramaze/request.rb
|
244
|
+
- spec/ramaze/controller
|
245
|
+
- spec/ramaze/controller/template_resolving.rb
|
246
|
+
- spec/ramaze/controller/template
|
247
|
+
- spec/ramaze/controller/template/greet.xhtml
|
248
|
+
- spec/ramaze/controller.rb
|
249
|
+
- spec/ramaze/public
|
250
|
+
- spec/ramaze/public/favicon.ico
|
251
|
+
- spec/ramaze/public/ramaze.png
|
252
|
+
- spec/ramaze/public/test_download.css
|
253
|
+
- spec/ramaze/public/error404.xhtml
|
254
|
+
- spec/ramaze/gestalt.rb
|
255
|
+
- spec/ramaze/global.rb
|
256
|
+
- spec/ramaze/session.rb
|
257
|
+
- spec/ramaze/element.rb
|
258
|
+
- spec/ramaze/morpher.rb
|
259
|
+
- spec/ramaze/params.rb
|
260
|
+
- spec/examples
|
261
|
+
- spec/examples/caching.rb
|
262
|
+
- spec/examples/element.rb
|
263
|
+
- spec/examples/simple.rb
|
264
|
+
- spec/examples/hello.rb
|
265
|
+
- spec/examples/templates
|
266
|
+
- spec/examples/templates/template_ezamar.rb
|
267
|
+
- spec/examples/templates/template_erubis.rb
|
268
|
+
- spec/examples/templates/template_liquid.rb
|
269
|
+
- spec/examples/templates/template_amrita2.rb
|
270
|
+
- spec/examples/templates/template_haml.rb
|
271
|
+
- spec/examples/templates/template_markaby.rb
|
272
|
+
- spec/helper.rb
|
231
273
|
- lib/proto
|
232
274
|
- lib/proto/doc
|
233
275
|
- lib/proto/log
|
@@ -255,7 +297,6 @@ files:
|
|
255
297
|
- lib/proto/public/css/coderay.css
|
256
298
|
- lib/proto/public/favicon.ico
|
257
299
|
- lib/proto/public/ramaze.png
|
258
|
-
- lib/proto/public/404.jpg
|
259
300
|
- lib/proto/public/error.zmr
|
260
301
|
- lib/ramaze.rb
|
261
302
|
- lib/ramaze
|
@@ -263,6 +304,7 @@ files:
|
|
263
304
|
- lib/ramaze/tool/mime_types.yaml
|
264
305
|
- lib/ramaze/tool/mime.rb
|
265
306
|
- lib/ramaze/tool/tidy.rb
|
307
|
+
- lib/ramaze/tool/localize.rb
|
266
308
|
- lib/ramaze/tool/create.rb
|
267
309
|
- lib/ramaze/cache
|
268
310
|
- lib/ramaze/cache/yaml_store.rb
|
@@ -287,9 +329,11 @@ files:
|
|
287
329
|
- lib/ramaze/snippets.rb
|
288
330
|
- lib/ramaze/template.rb
|
289
331
|
- lib/ramaze/helper
|
332
|
+
- lib/ramaze/helper/markaby.rb
|
290
333
|
- lib/ramaze/helper/link.rb
|
291
334
|
- lib/ramaze/helper/cache.rb
|
292
335
|
- lib/ramaze/helper/feed.rb
|
336
|
+
- lib/ramaze/helper/file.rb
|
293
337
|
- lib/ramaze/helper/redirect.rb
|
294
338
|
- lib/ramaze/helper/form.rb
|
295
339
|
- lib/ramaze/helper/identity.rb
|
@@ -298,7 +342,16 @@ files:
|
|
298
342
|
- lib/ramaze/helper/auth.rb
|
299
343
|
- lib/ramaze/helper/aspect.rb
|
300
344
|
- lib/ramaze/helper/nitroform.rb
|
345
|
+
- lib/ramaze/helper/inform.rb
|
301
346
|
- lib/ramaze/adapter.rb
|
347
|
+
- lib/ramaze/inform
|
348
|
+
- lib/ramaze/inform/informer.rb
|
349
|
+
- lib/ramaze/inform/xosd.rb
|
350
|
+
- lib/ramaze/inform/syslog.rb
|
351
|
+
- lib/ramaze/inform/growl.rb
|
352
|
+
- lib/ramaze/inform/hub.rb
|
353
|
+
- lib/ramaze/inform/informing.rb
|
354
|
+
- lib/ramaze/inform/analogger.rb
|
302
355
|
- lib/ramaze/trinity
|
303
356
|
- lib/ramaze/trinity/response.rb
|
304
357
|
- lib/ramaze/trinity/request.rb
|
@@ -310,6 +363,10 @@ files:
|
|
310
363
|
- lib/ramaze/adapter/cgi.rb
|
311
364
|
- lib/ramaze/controller.rb
|
312
365
|
- lib/ramaze/dispatcher.rb
|
366
|
+
- lib/ramaze/dispatcher
|
367
|
+
- lib/ramaze/dispatcher/error.rb
|
368
|
+
- lib/ramaze/dispatcher/file.rb
|
369
|
+
- lib/ramaze/dispatcher/action.rb
|
313
370
|
- lib/ramaze/trinity.rb
|
314
371
|
- lib/ramaze/gestalt.rb
|
315
372
|
- lib/ramaze/global.rb
|
@@ -336,13 +393,20 @@ files:
|
|
336
393
|
- lib/ramaze/snippets/ramaze/caller_lines.rb
|
337
394
|
- lib/ramaze/snippets/ramaze/caller_info.rb
|
338
395
|
- lib/ramaze/snippets/string
|
396
|
+
- lib/ramaze/snippets/string/each.rb
|
397
|
+
- lib/ramaze/snippets/string/color.rb
|
339
398
|
- lib/ramaze/snippets/string/DIVIDE.rb
|
340
399
|
- lib/ramaze/snippets/string/camel_case.rb
|
341
400
|
- lib/ramaze/snippets/string/snake_case.rb
|
401
|
+
- lib/ramaze/snippets/struct
|
402
|
+
- lib/ramaze/snippets/struct/fill.rb
|
342
403
|
- lib/ramaze/snippets/symbol
|
343
404
|
- lib/ramaze/snippets/symbol/to_proc.rb
|
344
405
|
- lib/ramaze/version.rb
|
345
406
|
- lib/ramaze/inform.rb
|
407
|
+
- rake_tasks/conf.rake
|
408
|
+
- rake_tasks/gem.rake
|
409
|
+
- rake_tasks/maintaince.rake
|
346
410
|
test_files: []
|
347
411
|
|
348
412
|
rdoc_options:
|
@@ -386,7 +450,7 @@ dependencies:
|
|
386
450
|
requirements:
|
387
451
|
- - ">="
|
388
452
|
- !ruby/object:Gem::Version
|
389
|
-
version: 0.7.
|
453
|
+
version: 0.7.3
|
390
454
|
version:
|
391
455
|
- !ruby/object:Gem::Dependency
|
392
456
|
name: rspec
|
@@ -395,7 +459,7 @@ dependencies:
|
|
395
459
|
requirements:
|
396
460
|
- - ">="
|
397
461
|
- !ruby/object:Gem::Version
|
398
|
-
version: 0.
|
462
|
+
version: 0.9.1
|
399
463
|
version:
|
400
464
|
- !ruby/object:Gem::Dependency
|
401
465
|
name: rack
|