Pistos-ramaze 2009.04.08 → 2009.06.12
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +3 -0
- data/MANIFEST +37 -22
- data/{README.markdown → README.md} +5 -24
- data/Rakefile +33 -26
- data/benchmark/bench_templates/bench.rb +67 -0
- data/benchmark/bench_templates/view/large.erb +79 -0
- data/benchmark/bench_templates/view/large.haml +41 -0
- data/benchmark/bench_templates/view/large.xhtml +79 -0
- data/benchmark/bench_templates/view/small.erb +21 -0
- data/benchmark/bench_templates/view/small.haml +12 -0
- data/benchmark/bench_templates/view/small.xhtml +21 -0
- data/benchmark/run.rb +14 -21
- data/benchmark/suite/minimal.rb +3 -5
- data/benchmark/suite/no_informer.rb +0 -2
- data/benchmark/suite/no_sessions.rb +3 -4
- data/benchmark/suite/no_template.rb +1 -3
- data/benchmark/suite/simple.rb +1 -3
- data/benchmark/suite/template_erubis.rb +0 -2
- data/benchmark/suite/template_etanni.rb +8 -0
- data/benchmark/suite/template_ezamar.rb +1 -3
- data/benchmark/suite/template_haml.rb +0 -2
- data/benchmark/suite/template_liquid.rb +0 -2
- data/benchmark/suite/template_markaby.rb +0 -2
- data/benchmark/suite/template_nagoro.rb +1 -3
- data/benchmark/suite/template_redcloth.rb +0 -2
- data/benchmark/suite/template_tenjin.rb +0 -2
- data/bin/ramaze +11 -163
- data/doc/AUTHORS +15 -8
- data/doc/CHANGELOG +10094 -12262
- data/doc/meta/announcement.txt +93 -46
- data/doc/tutorial/todolist.html +22 -58
- data/doc/tutorial/todolist.txt +20 -39
- data/examples/app/auth/layout/{auth.nag → auth.xhtml} +0 -0
- data/examples/app/auth/view/{index.nag → index.xhtml} +0 -0
- data/examples/app/auth/view/{login.nag → login.xhtml} +0 -0
- data/examples/app/auth/view/{secret.nag → secret.xhtml} +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 +12 -3
- data/examples/app/blog/model/init.rb +5 -0
- data/examples/app/blog/model/tag.rb +2 -2
- 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/chat/layout/{default.nag → default.xhtml} +0 -0
- data/examples/app/chat/view/{chat.nag → chat.xhtml} +0 -0
- data/examples/app/chat/view/{index.nag → index.xhtml} +0 -0
- data/examples/app/localization/locale/de.yaml +5 -0
- data/examples/app/localization/locale/en.yaml +5 -0
- data/examples/app/localization/locale/ja.yaml +5 -0
- data/examples/app/localization/start.rb +33 -20
- data/examples/app/wikore/spec/wikore.rb +4 -6
- data/examples/app/wikore/src/controller.rb +9 -11
- data/examples/app/wikore/src/model.rb +7 -10
- data/examples/app/wikore/start.rb +1 -1
- data/examples/app/wikore/{template → view}/index.xhtml +0 -0
- data/examples/helpers/cache.rb +6 -4
- data/examples/misc/css.rb +6 -12
- data/examples/misc/rapp.rb +28 -17
- data/lib/proto/app.rb +14 -0
- data/lib/proto/config.ru +8 -5
- data/lib/proto/controller/init.rb +3 -3
- data/lib/proto/spec/main.rb +9 -11
- data/lib/proto/start.rb +6 -10
- data/lib/ramaze.rb +8 -9
- data/lib/ramaze/app.rb +4 -3
- data/lib/ramaze/cache/localmemcache.rb +2 -2
- data/lib/ramaze/cache/memcache.rb +26 -1
- data/lib/ramaze/cache/sequel.rb +24 -9
- data/lib/ramaze/contrib/addressable_route.rb +56 -0
- data/lib/ramaze/contrib/email.rb +2 -0
- data/lib/ramaze/contrib/facebook/facebook.rb +4 -4
- data/lib/ramaze/contrib/sequel/create_join.rb +1 -0
- data/lib/ramaze/contrib/sequel/form_field.rb +4 -4
- data/lib/ramaze/contrib/sequel/image.rb +9 -11
- data/lib/ramaze/contrib/sequel/relation.rb +17 -3
- data/lib/ramaze/controller.rb +26 -18
- data/lib/ramaze/gestalt.rb +4 -1
- data/lib/ramaze/helper.rb +1 -0
- data/lib/ramaze/helper/auth.rb +0 -5
- data/lib/ramaze/helper/cache.rb +65 -25
- data/lib/ramaze/helper/form.rb +14 -2
- data/lib/ramaze/helper/formatting.rb +3 -1
- data/lib/ramaze/helper/gestalt.rb +32 -0
- data/lib/ramaze/helper/identity.rb +3 -3
- data/lib/ramaze/helper/layout.rb +97 -0
- data/lib/ramaze/helper/link.rb +6 -25
- data/lib/ramaze/helper/localize.rb +13 -3
- data/lib/ramaze/helper/paginate.rb +4 -2
- data/lib/ramaze/helper/ultraviolet.rb +2 -0
- data/lib/ramaze/helper/user.rb +3 -3
- data/lib/ramaze/log/rotatinginformer.rb +10 -10
- data/lib/ramaze/request.rb +3 -5
- data/lib/ramaze/setup.rb +22 -9
- data/lib/ramaze/spec.rb +8 -12
- data/lib/ramaze/spec/bacon.rb +34 -0
- data/lib/ramaze/spec/helper/template_examples.rb +15 -22
- data/lib/ramaze/tool/bin.rb +340 -0
- data/lib/ramaze/tool/project_creator.rb +1 -1
- data/lib/ramaze/version.rb +1 -1
- data/lib/ramaze/view.rb +6 -11
- data/lib/ramaze/view/erubis.rb +2 -2
- data/lib/ramaze/view/ezamar.rb +2 -2
- data/lib/ramaze/view/gestalt.rb +14 -0
- data/lib/ramaze/view/haml.rb +2 -1
- data/lib/ramaze/view/liquid.rb +45 -11
- data/lib/ramaze/view/maruku.rb +2 -1
- data/lib/ramaze/view/nagoro/render_partial.rb +9 -9
- data/lib/ramaze/view/sass.rb +1 -1
- data/lib/ramaze/view/tenjin.rb +7 -4
- data/lib/vendor/etag.rb +4 -2
- data/lib/vendor/route_exceptions.rb +9 -15
- data/ramaze.gemspec +56 -9
- data/spec/contrib/addressable_route.rb +30 -0
- data/spec/contrib/rest.rb +2 -2
- data/spec/examples/caching.rb +5 -7
- data/spec/examples/css.rb +3 -3
- data/spec/examples/element.rb +4 -3
- data/spec/examples/hello.rb +3 -3
- data/spec/examples/helpers/httpdigest.rb +44 -69
- data/spec/examples/linking.rb +3 -3
- data/spec/examples/simple.rb +3 -3
- data/spec/examples/templates/template_erubis.rb +8 -4
- data/spec/examples/templates/template_ezamar.rb +9 -4
- data/spec/examples/templates/template_haml.rb +8 -4
- data/spec/examples/templates/template_liquid.rb +8 -4
- data/spec/examples/templates/template_markaby.rb +9 -5
- data/spec/examples/templates/template_nagoro.rb +9 -5
- data/spec/examples/templates/template_redcloth.rb +8 -4
- data/spec/examples/templates/template_remarkably.rb +8 -4
- data/spec/examples/templates/template_tenjin.rb +8 -4
- data/spec/helper.rb +1 -2
- data/spec/ramaze/action/render.rb +4 -1
- data/spec/ramaze/app.rb +5 -2
- data/spec/ramaze/bin/ramaze.rb +96 -0
- data/spec/ramaze/cache/localmemcache.rb +1 -1
- data/spec/ramaze/cache/memcache.rb +7 -1
- data/spec/ramaze/cache/sequel.rb +1 -1
- data/spec/ramaze/controller/actionless_templates.rb +2 -2
- data/spec/ramaze/controller/lonely_mapping.rb +18 -0
- data/spec/ramaze/controller/mapping.rb +4 -15
- data/spec/ramaze/controller/provide_inheritance.rb +5 -2
- data/spec/ramaze/controller/resolve.rb +2 -2
- data/spec/ramaze/controller/subclass.rb +2 -2
- data/spec/ramaze/controller/template_resolving.rb +2 -2
- data/spec/ramaze/dispatcher/directory.rb +5 -2
- data/spec/ramaze/dispatcher/file.rb +28 -26
- data/spec/ramaze/error.rb +3 -3
- data/spec/ramaze/files.rb +5 -2
- data/spec/ramaze/gestalt.rb +26 -17
- data/spec/ramaze/helper/auth.rb +30 -41
- data/spec/ramaze/helper/bench.rb +6 -2
- data/spec/ramaze/helper/cache.rb +45 -5
- data/spec/ramaze/helper/flash.rb +11 -15
- data/spec/ramaze/helper/form.rb +6 -3
- data/spec/ramaze/helper/formatting.rb +4 -1
- data/spec/ramaze/helper/gestalt.rb +4 -1
- data/spec/ramaze/helper/gravatar.rb +4 -1
- data/spec/ramaze/helper/httpdigest.rb +51 -66
- data/spec/ramaze/helper/layout.rb +79 -0
- data/spec/ramaze/helper/layout/default.xhtml +5 -0
- data/spec/ramaze/helper/link.rb +33 -12
- data/spec/ramaze/helper/localize.rb +9 -4
- data/spec/ramaze/helper/maruku.rb +5 -2
- data/spec/ramaze/helper/pager.rb +2 -2
- data/spec/ramaze/helper/paginate.rb +5 -2
- data/spec/ramaze/helper/request_accessor.rb +5 -2
- data/spec/ramaze/helper/sequel_form.rb +7 -2
- data/spec/ramaze/helper/simple_captcha.rb +10 -14
- data/spec/ramaze/helper/stack.rb +32 -40
- data/spec/ramaze/helper/user.rb +19 -14
- data/spec/ramaze/helper/xhtml.rb +4 -1
- data/spec/ramaze/log/informer.rb +1 -1
- data/spec/ramaze/log/logging.rb +4 -1
- data/spec/ramaze/log/syslog.rb +6 -6
- data/spec/ramaze/params.rb +5 -6
- data/spec/ramaze/request.rb +16 -1
- data/spec/ramaze/session/memcache.rb +66 -0
- data/spec/ramaze/struct.rb +4 -1
- data/spec/ramaze/view.rb +2 -2
- data/spec/ramaze/view/erubis.rb +2 -2
- data/spec/ramaze/view/ezamar.rb +2 -2
- data/spec/ramaze/view/gestalt.rb +94 -0
- data/spec/ramaze/view/gestalt/external.ges +8 -0
- data/spec/ramaze/view/haml.rb +2 -2
- data/spec/ramaze/view/liquid.rb +2 -2
- data/spec/ramaze/view/nagoro.rb +2 -2
- data/spec/ramaze/view/redcloth.rb +2 -2
- data/spec/ramaze/view/remarkably.rb +2 -2
- data/spec/ramaze/view/sass.rb +2 -2
- data/spec/ramaze/view/tagz.rb +2 -2
- data/spec/ramaze/view/tenjin.rb +2 -2
- data/spec/snippets/array/put_within.rb +30 -25
- data/spec/snippets/binding/locals.rb +4 -1
- data/spec/snippets/numeric/filesize_format.rb +4 -1
- data/spec/snippets/numeric/time.rb +5 -2
- data/spec/snippets/object/__dir__.rb +4 -1
- data/spec/snippets/ordered_set.rb +4 -1
- data/spec/snippets/ramaze/acquire.rb +4 -1
- data/spec/snippets/ramaze/dictionary.rb +4 -1
- data/spec/snippets/ramaze/struct.rb +4 -1
- data/spec/snippets/string/camel_case.rb +4 -1
- data/spec/snippets/string/color.rb +4 -1
- data/spec/snippets/string/snake_case.rb +4 -1
- data/spec/snippets/string/unindent.rb +4 -1
- data/spec/snippets/thread/into.rb +4 -1
- data/tasks/bacon.rake +5 -3
- data/tasks/changelog.rake +3 -1
- data/tasks/{gem_installer.rake → gem_setup.rake} +45 -22
- data/tasks/release.rake +12 -27
- data/tasks/setup.rake +6 -0
- data/tasks/todo.rake +2 -4
- metadata +205 -31
- data/CHANGELOG +0 -16546
- data/benchmark/suite/template_builder.rb +0 -12
- data/doc/tutorial/todolist.mkd +0 -787
- data/examples/helpers/provide.rb +0 -23
- data/lib/proto/view/page.xhtml +0 -27
- data/lib/ramaze/snippets/divide.rb +0 -22
- data/lib/ramaze/snippets/kernel/constant.rb +0 -41
- data/lib/ramaze/snippets/object/acquire.rb +0 -37
- data/lib/ramaze/snippets/string/each.rb +0 -19
- data/spec/ramaze/helper/partial.rb +0 -40
- data/spec/snippets/kernel/constant.rb +0 -23
- data/tasks/install_dependencies.rake +0 -6
data/spec/ramaze/params.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Copyright (c) 2009 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/helper'
|
4
|
+
require File.expand_path('../../../spec/helper', __FILE__)
|
5
5
|
|
6
6
|
class TCParamsController < Ramaze::Controller
|
7
7
|
map '/'
|
@@ -51,7 +51,7 @@ class TCParamsController2 < Ramaze::Controller
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def keys
|
54
|
-
request.params.keys.
|
54
|
+
request.params.keys.inspect
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
@@ -64,7 +64,7 @@ class TCParamsController3 < Ramaze::Controller
|
|
64
64
|
end
|
65
65
|
|
66
66
|
describe "Simple Parameters" do
|
67
|
-
behaves_like :
|
67
|
+
behaves_like :rack_test
|
68
68
|
|
69
69
|
def handle(*url)
|
70
70
|
Ramaze::Mock.get(*url).body
|
@@ -103,8 +103,7 @@ describe "Simple Parameters" do
|
|
103
103
|
end
|
104
104
|
|
105
105
|
it "action that takes all params but needs at least one (not given here)" do
|
106
|
-
lambda{ handle('/at_least_one') }.
|
107
|
-
should.raise(ArgumentError)
|
106
|
+
lambda{ handle('/at_least_one') }.should.raise(ArgumentError)
|
108
107
|
end
|
109
108
|
|
110
109
|
it "one default" do
|
@@ -149,6 +148,6 @@ describe "Simple Parameters" do
|
|
149
148
|
end
|
150
149
|
|
151
150
|
it 'should handle valueless params' do
|
152
|
-
handle('/jo/keys?foo').should == '"foo"'
|
151
|
+
handle('/jo/keys?foo').should == '["foo"]'
|
153
152
|
end
|
154
153
|
end
|
data/spec/ramaze/request.rb
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
-
|
1
|
+
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
2
|
+
# All files in this distribution are subject to the terms of the Ruby license.
|
3
|
+
|
4
|
+
require File.expand_path('../../../spec/helper', __FILE__)
|
2
5
|
|
3
6
|
describe 'Ramaze::Request' do
|
4
7
|
def request(env = {})
|
@@ -46,4 +49,16 @@ describe 'Ramaze::Request' do
|
|
46
49
|
should 'provide #accept_charset' do
|
47
50
|
request(@env).accept_charset.should == 'UTF-8'
|
48
51
|
end
|
52
|
+
|
53
|
+
should 'properly parse requested locale' do
|
54
|
+
header = { "HTTP_ACCEPT_LANGUAGE" => "sv-se,sv;q=0.8,en-us;q=0.5,en;q=0.3" }
|
55
|
+
request(@env.merge(header)).accept_language_with_weight.should == [
|
56
|
+
['sv-se', 1.0], ['sv', 0.8], ['en-us', 0.5], ['en', 0.3]
|
57
|
+
]
|
58
|
+
|
59
|
+
header = { "HTTP_ACCEPT_LANGUAGE" => "nl-nl" }
|
60
|
+
request(@env.merge(header)).accept_language_with_weight.should == [
|
61
|
+
['nl-nl', 1.0]
|
62
|
+
]
|
63
|
+
end
|
49
64
|
end
|
@@ -0,0 +1,66 @@
|
|
1
|
+
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
2
|
+
# All files in this distribution are subject to the terms of the Ruby license.
|
3
|
+
|
4
|
+
require File.expand_path('../../../../spec/helper', __FILE__)
|
5
|
+
|
6
|
+
spec_precondition 'memcached is running' do
|
7
|
+
require 'memcache'
|
8
|
+
cache = MemCache.new(['localhost:11211'])
|
9
|
+
cache.set('active', true)
|
10
|
+
end
|
11
|
+
|
12
|
+
class SpecSession < Ramaze::Controller
|
13
|
+
map '/'
|
14
|
+
engine :None
|
15
|
+
|
16
|
+
def index
|
17
|
+
'No session here'
|
18
|
+
end
|
19
|
+
|
20
|
+
def init
|
21
|
+
session[:counter] = 0
|
22
|
+
end
|
23
|
+
|
24
|
+
def view
|
25
|
+
session[:counter]
|
26
|
+
end
|
27
|
+
|
28
|
+
def increment
|
29
|
+
session[:counter] += 1
|
30
|
+
end
|
31
|
+
|
32
|
+
def decrement
|
33
|
+
session[:counter] -= 1
|
34
|
+
end
|
35
|
+
|
36
|
+
def reset
|
37
|
+
session.clear
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
Ramaze::Cache.options.session = Ramaze::Cache::MemCache
|
42
|
+
|
43
|
+
describe Innate::Session do
|
44
|
+
behaves_like :rack_test
|
45
|
+
|
46
|
+
should 'initiate session as needed' do
|
47
|
+
get '/'
|
48
|
+
last_response.body.should == 'No session here'
|
49
|
+
last_response['Set-Cookie'].should == nil
|
50
|
+
|
51
|
+
get('/init')
|
52
|
+
last_response.body.should == '0'
|
53
|
+
|
54
|
+
1.upto(10) do |n|
|
55
|
+
get('/increment').body.should == n.to_s
|
56
|
+
end
|
57
|
+
|
58
|
+
get('/reset')
|
59
|
+
get('/view').body.should == ''
|
60
|
+
get('/init').body.should == '0'
|
61
|
+
|
62
|
+
-1.downto(-10) do |n|
|
63
|
+
get('/decrement').body.should == n.to_s
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
data/spec/ramaze/struct.rb
CHANGED
@@ -1,4 +1,7 @@
|
|
1
|
-
|
1
|
+
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
2
|
+
# All files in this distribution are subject to the terms of the Ruby license.
|
3
|
+
|
4
|
+
require File.expand_path('../../../spec/helper', __FILE__)
|
2
5
|
|
3
6
|
Point = Ramaze::Struct.new(:x,:y)
|
4
7
|
|
data/spec/ramaze/view.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Copyright (c) 2009 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/helper'
|
4
|
+
require File.expand_path('../../../spec/helper', __FILE__)
|
5
5
|
|
6
6
|
module Ramaze
|
7
7
|
module View
|
@@ -25,7 +25,7 @@ class SpecView < Ramaze::Controller
|
|
25
25
|
end
|
26
26
|
|
27
27
|
describe Ramaze::View do
|
28
|
-
behaves_like :
|
28
|
+
behaves_like :rack_test
|
29
29
|
|
30
30
|
it 'uses MyEngine' do
|
31
31
|
got = get('/')
|
data/spec/ramaze/view/erubis.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Copyright (c) 2009 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/helper'
|
4
|
+
require File.expand_path('../../../../spec/helper', __FILE__)
|
5
5
|
spec_require 'erubis'
|
6
6
|
|
7
7
|
Ramaze::App.options.views = 'erubis'
|
@@ -28,7 +28,7 @@ class SpecErubis < Ramaze::Controller
|
|
28
28
|
end
|
29
29
|
|
30
30
|
describe "Ramaze::View::Erubis" do
|
31
|
-
behaves_like :
|
31
|
+
behaves_like :rack_test
|
32
32
|
|
33
33
|
should 'render' do
|
34
34
|
got = get('/')
|
data/spec/ramaze/view/ezamar.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Copyright (c) 2009 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/helper'
|
4
|
+
require File.expand_path('../../../../spec/helper', __FILE__)
|
5
5
|
spec_require 'ezamar'
|
6
6
|
|
7
7
|
Ramaze::App.options.views = 'ezamar'
|
@@ -28,7 +28,7 @@ class SpecEzamar < Ramaze::Controller
|
|
28
28
|
end
|
29
29
|
|
30
30
|
describe "Ramaze::View::Ezamar" do
|
31
|
-
behaves_like :
|
31
|
+
behaves_like :rack_test
|
32
32
|
|
33
33
|
should 'render' do
|
34
34
|
got = get('/')
|
@@ -0,0 +1,94 @@
|
|
1
|
+
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
2
|
+
# All files in this distribution are subject to the terms of the Ruby license.
|
3
|
+
|
4
|
+
require File.expand_path('../../../../spec/helper', __FILE__)
|
5
|
+
spec_require 'ramaze/gestalt'
|
6
|
+
|
7
|
+
Ramaze::App.options.views = 'gestalt'
|
8
|
+
|
9
|
+
class SpecGestalt < Ramaze::Controller
|
10
|
+
map '/'
|
11
|
+
engine :Gestalt
|
12
|
+
helper :gestalt
|
13
|
+
|
14
|
+
def index
|
15
|
+
@title = 'Gestalt Index'
|
16
|
+
g
|
17
|
+
end
|
18
|
+
|
19
|
+
def links
|
20
|
+
g
|
21
|
+
end
|
22
|
+
|
23
|
+
def with_partial
|
24
|
+
g
|
25
|
+
end
|
26
|
+
|
27
|
+
def different_module
|
28
|
+
g(:foo, SpecGestalDifferentModule)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
module SpecGestaltView
|
33
|
+
def index
|
34
|
+
h1 @title
|
35
|
+
end
|
36
|
+
|
37
|
+
def links
|
38
|
+
ul do
|
39
|
+
li{ a "Index page", :href => rs(:index) }
|
40
|
+
li{ a "Internal template", :href => rs(:internal) }
|
41
|
+
li{ a "External template", :href => rs(:external) }
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
# def external
|
46
|
+
# ol do
|
47
|
+
# 3.times{ render_view('template') }
|
48
|
+
# end
|
49
|
+
# end
|
50
|
+
|
51
|
+
def with_partial
|
52
|
+
ul do
|
53
|
+
3.times{ _partial }
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
def _partial
|
58
|
+
li 'List Item'
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
module SpecGestalDifferentModule
|
63
|
+
def foo
|
64
|
+
p{ 'view module specified'}
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
describe Ramaze::View::Gestalt do
|
69
|
+
behaves_like :rack_test
|
70
|
+
|
71
|
+
should 'use g helper' do
|
72
|
+
get('/').body.should == '<h1>Gestalt Index</h1>'
|
73
|
+
end
|
74
|
+
|
75
|
+
should 'use other helper methods' do
|
76
|
+
get('/links').body.should ==
|
77
|
+
'<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>'
|
78
|
+
end
|
79
|
+
|
80
|
+
should 'render external template' do
|
81
|
+
get('/external').body.should ==
|
82
|
+
"<html><head><title>Gestalt Test</title></head><body><h1>Gestalt Template</h1></body></html>"
|
83
|
+
end
|
84
|
+
|
85
|
+
should 'use method like partials' do
|
86
|
+
get('/with_partial').body.should ==
|
87
|
+
'<ul><li>List Item</li><li>List Item</li><li>List Item</li></ul>'
|
88
|
+
end
|
89
|
+
|
90
|
+
should 'be able to specify different view module and method' do
|
91
|
+
get('/different_module').body.should ==
|
92
|
+
'<p>view module specified</p>'
|
93
|
+
end
|
94
|
+
end
|
data/spec/ramaze/view/haml.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Copyright (c) 2009 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/helper'
|
4
|
+
require File.expand_path('../../../../spec/helper', __FILE__)
|
5
5
|
spec_require 'haml'
|
6
6
|
|
7
7
|
Ramaze::App.options.views = 'haml'
|
@@ -32,7 +32,7 @@ class SpecHaml < Ramaze::Controller
|
|
32
32
|
end
|
33
33
|
|
34
34
|
describe Ramaze::View::Haml do
|
35
|
-
behaves_like :
|
35
|
+
behaves_like :rack_test
|
36
36
|
|
37
37
|
should 'render' do
|
38
38
|
got = get('/')
|
data/spec/ramaze/view/liquid.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Copyright (c) 2009 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/helper'
|
4
|
+
require File.expand_path('../../../../spec/helper', __FILE__)
|
5
5
|
spec_require 'liquid'
|
6
6
|
|
7
7
|
Ramaze::App.options.views = 'liquid'
|
@@ -28,7 +28,7 @@ class SpecLiquid < Ramaze::Controller
|
|
28
28
|
end
|
29
29
|
|
30
30
|
describe 'Ramaze::View::Liquid' do
|
31
|
-
behaves_like :
|
31
|
+
behaves_like :rack_test
|
32
32
|
|
33
33
|
should 'render' do
|
34
34
|
got = get('/')
|
data/spec/ramaze/view/nagoro.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Copyright (c) 2009 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/helper'
|
4
|
+
require File.expand_path('../../../../spec/helper', __FILE__)
|
5
5
|
spec_require 'nagoro'
|
6
6
|
|
7
7
|
Ramaze::App.options.views = 'nagoro'
|
@@ -28,7 +28,7 @@ class SpecNagoro < Ramaze::Controller
|
|
28
28
|
end
|
29
29
|
|
30
30
|
describe "Ramaze::View::Nagoro" do
|
31
|
-
behaves_like :
|
31
|
+
behaves_like :rack_test
|
32
32
|
|
33
33
|
should 'render' do
|
34
34
|
got = get('/')
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Copyright (c) 2009 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/helper'
|
4
|
+
require File.expand_path('../../../../spec/helper', __FILE__)
|
5
5
|
spec_requires 'erubis', 'redcloth'
|
6
6
|
|
7
7
|
Ramaze::App.options.views = 'redcloth'
|
@@ -28,7 +28,7 @@ class SpecRedCloth < Ramaze::Controller
|
|
28
28
|
end
|
29
29
|
|
30
30
|
describe "Ramaze::View::RedCloth" do
|
31
|
-
behaves_like :
|
31
|
+
behaves_like :rack_test
|
32
32
|
|
33
33
|
should 'render' do
|
34
34
|
got = get('/')
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# Copyright (c) 2009 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/helper'
|
4
|
+
require File.expand_path('../../../../spec/helper', __FILE__)
|
5
5
|
spec_require 'remarkably'
|
6
6
|
|
7
7
|
Ramaze::App.options.views = 'remarkably'
|
@@ -29,7 +29,7 @@ class SpecRemarkably < Ramaze::Controller
|
|
29
29
|
end
|
30
30
|
|
31
31
|
describe Ramaze::View::Remarkably do
|
32
|
-
behaves_like :
|
32
|
+
behaves_like :rack_test
|
33
33
|
|
34
34
|
should 'use remarkably methods' do
|
35
35
|
get('/').body.should == '<h1>Remarkably Index</h1>'
|
data/spec/ramaze/view/sass.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Copyright (c) 2009 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/helper'
|
4
|
+
require File.expand_path('../../../../spec/helper', __FILE__)
|
5
5
|
spec_require 'haml/util', 'sass/engine'
|
6
6
|
|
7
7
|
Ramaze::App.options.views = 'sass'
|
@@ -40,7 +40,7 @@ body
|
|
40
40
|
end
|
41
41
|
|
42
42
|
describe Ramaze::View::Sass do
|
43
|
-
behaves_like :
|
43
|
+
behaves_like :rack_test
|
44
44
|
|
45
45
|
should 'render inline' do
|
46
46
|
got = get('/style.css')
|
data/spec/ramaze/view/tagz.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Copyright (c) 2009 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/helper'
|
4
|
+
require File.expand_path('../../../../spec/helper', __FILE__)
|
5
5
|
spec_require 'tagz'
|
6
6
|
|
7
7
|
Ramaze::App.options.views = 'tagz'
|
@@ -31,7 +31,7 @@ class SpecTagz < Ramaze::Controller
|
|
31
31
|
end
|
32
32
|
|
33
33
|
describe Ramaze::View::Tagz do
|
34
|
-
behaves_like :
|
34
|
+
behaves_like :rack_test
|
35
35
|
|
36
36
|
should 'use tagz methods' do
|
37
37
|
get('/').body.should == '<h1>Tagz Index</h1>'
|
data/spec/ramaze/view/tenjin.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Copyright (c) 2009 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/helper'
|
4
|
+
require File.expand_path('../../../../spec/helper', __FILE__)
|
5
5
|
spec_require 'tenjin'
|
6
6
|
|
7
7
|
Ramaze::App.options.views = 'tenjin'
|
@@ -28,7 +28,7 @@ class SpecTenjin < Ramaze::Controller
|
|
28
28
|
end
|
29
29
|
|
30
30
|
describe 'Ramaze::View::Tenjin' do
|
31
|
-
behaves_like :
|
31
|
+
behaves_like :rack_test
|
32
32
|
|
33
33
|
should 'render' do
|
34
34
|
get('/').body.should == '<h1>Tenjin Index</h1>'
|