ramaze 2009.06.12 → 2009.07
Sign up to get free protection for your applications and to get access to all the features.
- data/MANIFEST +10 -0
- data/README.md +4 -9
- data/Rakefile +30 -21
- data/doc/AUTHORS +1 -1
- data/doc/CHANGELOG +144 -0
- data/doc/meta/announcement.txt +47 -76
- data/examples/misc/css.rb +6 -12
- data/lib/proto/app.rb +4 -5
- data/lib/proto/controller/init.rb +1 -1
- data/lib/proto/spec/main.rb +3 -4
- data/lib/ramaze.rb +0 -2
- data/lib/ramaze/app.rb +4 -3
- data/lib/ramaze/cache.rb +1 -0
- data/lib/ramaze/cache/lru.rb +42 -0
- data/lib/ramaze/contrib/addressable_route.rb +10 -9
- data/lib/ramaze/controller.rb +1 -3
- data/lib/ramaze/helper/blue_form.rb +214 -0
- data/lib/ramaze/helper/cache.rb +44 -9
- data/lib/ramaze/helper/formatting.rb +5 -2
- data/lib/ramaze/helper/layout.rb +2 -2
- data/lib/ramaze/helper/paginate.rb +28 -33
- data/lib/ramaze/request.rb +1 -1
- data/lib/ramaze/snippets/ramaze/lru_hash.rb +248 -0
- data/lib/ramaze/spec/bacon.rb +5 -0
- data/lib/ramaze/spec/helper/template_examples.rb +4 -1
- data/lib/ramaze/version.rb +1 -1
- data/lib/ramaze/view.rb +4 -3
- data/lib/ramaze/view/less.rb +12 -0
- data/ramaze.gemspec +27 -24
- data/spec/contrib/addressable_route.rb +3 -5
- data/spec/contrib/rest.rb +1 -1
- data/spec/examples/caching.rb +2 -2
- data/spec/examples/css.rb +2 -2
- data/spec/examples/element.rb +2 -2
- data/spec/examples/hello.rb +2 -2
- data/spec/examples/helpers/httpdigest.rb +2 -2
- data/spec/examples/linking.rb +2 -2
- data/spec/examples/simple.rb +2 -2
- data/spec/examples/templates/template_erubis.rb +5 -2
- data/spec/examples/templates/template_ezamar.rb +5 -2
- data/spec/examples/templates/template_haml.rb +5 -2
- data/spec/examples/templates/template_liquid.rb +5 -2
- data/spec/examples/templates/template_markaby.rb +5 -2
- data/spec/examples/templates/template_nagoro.rb +5 -2
- data/spec/examples/templates/template_redcloth.rb +5 -2
- data/spec/examples/templates/template_remarkably.rb +5 -2
- data/spec/examples/templates/template_tenjin.rb +5 -2
- data/spec/ramaze/action/render.rb +4 -1
- data/spec/ramaze/app.rb +4 -1
- data/spec/ramaze/app/location.rb +43 -0
- data/spec/ramaze/bin/ramaze.rb +7 -2
- data/spec/ramaze/cache/localmemcache.rb +1 -1
- data/spec/ramaze/cache/lru.rb +48 -0
- data/spec/ramaze/cache/memcache.rb +1 -1
- data/spec/ramaze/cache/sequel.rb +1 -1
- data/spec/ramaze/controller/actionless_templates.rb +1 -1
- data/spec/ramaze/controller/lonely_mapping.rb +3 -1
- data/spec/ramaze/controller/mapping.rb +4 -1
- data/spec/ramaze/controller/provide_inheritance.rb +4 -1
- data/spec/ramaze/controller/resolve.rb +1 -1
- data/spec/ramaze/controller/subclass.rb +1 -1
- data/spec/ramaze/controller/template_resolving.rb +1 -1
- data/spec/ramaze/dispatcher/directory.rb +4 -1
- data/spec/ramaze/dispatcher/file.rb +8 -8
- data/spec/ramaze/error.rb +1 -1
- data/spec/ramaze/files.rb +4 -1
- data/spec/ramaze/gestalt.rb +4 -1
- data/spec/ramaze/helper/auth.rb +1 -1
- data/spec/ramaze/helper/bench.rb +4 -1
- data/spec/ramaze/helper/blue_form.rb +433 -0
- data/spec/ramaze/helper/cache.rb +2 -2
- data/spec/ramaze/helper/flash.rb +1 -1
- data/spec/ramaze/helper/form.rb +4 -1
- 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 +4 -1
- data/spec/ramaze/helper/layout.rb +1 -1
- data/spec/ramaze/helper/link.rb +1 -1
- data/spec/ramaze/helper/localize.rb +4 -1
- data/spec/ramaze/helper/maruku.rb +4 -1
- data/spec/ramaze/helper/pager.rb +1 -1
- data/spec/ramaze/helper/paginate.rb +4 -1
- data/spec/ramaze/helper/request_accessor.rb +4 -1
- data/spec/ramaze/helper/sequel_form.rb +4 -1
- data/spec/ramaze/helper/simple_captcha.rb +1 -1
- data/spec/ramaze/helper/stack.rb +1 -1
- data/spec/ramaze/helper/user.rb +4 -1
- 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 +1 -1
- data/spec/ramaze/request.rb +4 -1
- data/spec/ramaze/session/memcache.rb +1 -1
- data/spec/ramaze/struct.rb +4 -1
- data/spec/ramaze/view.rb +1 -1
- data/spec/ramaze/view/erubis.rb +1 -1
- data/spec/ramaze/view/ezamar.rb +1 -1
- data/spec/ramaze/view/gestalt.rb +2 -2
- data/spec/ramaze/view/haml.rb +1 -1
- data/spec/ramaze/view/less.rb +60 -0
- data/spec/ramaze/view/less/file.css.less +8 -0
- data/spec/ramaze/view/liquid.rb +1 -1
- data/spec/ramaze/view/nagoro.rb +1 -1
- data/spec/ramaze/view/redcloth.rb +1 -1
- data/spec/ramaze/view/remarkably.rb +1 -1
- data/spec/ramaze/view/sass.rb +1 -1
- data/spec/ramaze/view/tagz.rb +1 -1
- data/spec/ramaze/view/tenjin.rb +1 -1
- 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/lru_hash.rb +88 -0
- 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 +8 -2
- data/tasks/gem_setup.rake +21 -8
- data/tasks/setup.rake +8 -2
- metadata +29 -9
data/spec/ramaze/helper/cache.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 SpecHelperCache < Ramaze::Controller
|
7
7
|
map '/'
|
@@ -107,7 +107,7 @@ describe Ramaze::Helper::Cache do
|
|
107
107
|
lambda{ get('/ttl').body }.should.not.change{ get('/ttl').body }
|
108
108
|
end
|
109
109
|
|
110
|
-
lambda{ sleep 1; get('/ttl').body }.should.change{ get('/ttl').body }
|
110
|
+
lambda{ sleep 1.5; get('/ttl').body }.should.change{ get('/ttl').body }
|
111
111
|
end
|
112
112
|
|
113
113
|
it 'caches actions with block keys' do
|
data/spec/ramaze/helper/flash.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 SpecHelperFlash < Ramaze::Controller
|
7
7
|
map '/'
|
data/spec/ramaze/helper/form.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
|
require 'ramaze/helper/formatting'
|
3
6
|
|
4
7
|
describe 'Helper::Formatting' do
|
@@ -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
|
require 'ramaze/helper/gestalt'
|
3
6
|
|
4
7
|
describe Ramaze::Helper::Gestalt do
|
@@ -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
|
require 'ramaze/helper/gravatar'
|
3
6
|
|
4
7
|
describe Ramaze::Helper::Gravatar do
|
@@ -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
|
REALM = 'HttpDigestTestRealm'
|
4
7
|
|
@@ -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 LayoutHelperOne < Ramaze::Controller
|
7
7
|
map '/one'
|
data/spec/ramaze/helper/link.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 SpecHelperLink < Ramaze::Controller
|
7
7
|
map '/'
|
@@ -1,6 +1,9 @@
|
|
1
1
|
# * Encoding: UTF-8
|
2
|
+
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
3
|
+
# All files in this distribution are subject to the terms of the Ruby license.
|
4
|
+
|
2
5
|
$KCODE = 'u' if /regexp/.respond_to?(:kcode)
|
3
|
-
require 'spec/helper'
|
6
|
+
require File.expand_path('../../../../spec/helper', __FILE__)
|
4
7
|
spec_requires 'locale/tag', 'locale'
|
5
8
|
|
6
9
|
class SpecHelperLocalize < Ramaze::Controller
|
@@ -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
|
spec_require 'maruku'
|
3
6
|
|
4
7
|
class SpecHelperMaruku < Ramaze::Controller
|
data/spec/ramaze/helper/pager.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 'hpricot'
|
6
6
|
|
7
7
|
module Og
|
@@ -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
|
spec_require 'hpricot'
|
3
6
|
|
4
7
|
class SpecHelperPaginateArray < Ramaze::Controller
|
@@ -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
|
class SpecHelperRequestAccessor < Ramaze::Controller
|
4
7
|
map '/'
|
@@ -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
|
spec_requires 'hpricot', 'sequel'
|
4
7
|
|
@@ -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 SpecSimpleCaptcha < Ramaze::Controller
|
7
7
|
helper :simple_captcha
|
data/spec/ramaze/helper/stack.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 SpecStackHelper < Ramaze::Controller
|
7
7
|
map '/'
|
data/spec/ramaze/helper/user.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
|
class MockSequelUser
|
4
7
|
def profile
|
data/spec/ramaze/helper/xhtml.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
|
require 'ramaze/helper/xhtml'
|
3
6
|
|
4
7
|
describe Ramaze::Helper::XHTML do
|
data/spec/ramaze/log/informer.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
|
require 'ramaze/log/informer'
|
6
6
|
|
7
7
|
describe 'Informer' do
|
data/spec/ramaze/log/logging.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
|
class SpecLogger
|
4
7
|
include Ramaze::Logging
|
data/spec/ramaze/log/syslog.rb
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# Copyright (c) 2008 rob@rebeltechnologies.nl
|
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
|
require 'ramaze/log/syslog'
|
7
7
|
|
8
8
|
describe 'Syslog' do
|
9
9
|
|
10
10
|
# close the syslog, if it was open for some reason before we
|
11
|
-
# start a test.
|
11
|
+
# start a test.
|
12
12
|
before do
|
13
13
|
if ( Syslog.opened? )
|
14
14
|
::Syslog.close
|
@@ -24,8 +24,8 @@ describe 'Syslog' do
|
|
24
24
|
end
|
25
25
|
|
26
26
|
it 'should handle non default initialization' do
|
27
|
-
syslog = Ramaze::Logger::Syslog.new( 'ramaze_syslog_test',
|
28
|
-
::Syslog::LOG_NDELAY | ::Syslog::LOG_NOWAIT,
|
27
|
+
syslog = Ramaze::Logger::Syslog.new( 'ramaze_syslog_test',
|
28
|
+
::Syslog::LOG_NDELAY | ::Syslog::LOG_NOWAIT,
|
29
29
|
::Syslog::LOG_DAEMON )
|
30
30
|
::Syslog.opened?.should == true
|
31
31
|
::Syslog.ident.should == 'ramaze_syslog_test'
|
@@ -43,7 +43,7 @@ describe 'Syslog' do
|
|
43
43
|
child = fork {
|
44
44
|
logpipe[0].close
|
45
45
|
STDERR.reopen(logpipe[1])
|
46
|
-
syslog = Ramaze::Logger::Syslog.new( 'ramaze_syslog_test',
|
46
|
+
syslog = Ramaze::Logger::Syslog.new( 'ramaze_syslog_test',
|
47
47
|
::Syslog::LOG_PID | ::Syslog::LOG_NDELAY | ::Syslog::LOG_PERROR,
|
48
48
|
::Syslog::LOG_USER )
|
49
49
|
syslog.send priority, msg
|
@@ -54,7 +54,7 @@ describe 'Syslog' do
|
|
54
54
|
|
55
55
|
logpipe[0].gets.should == "ramaze_syslog_test[#{child}]: #{msg}\n"
|
56
56
|
end
|
57
|
-
|
57
|
+
|
58
58
|
it 'should handle debug' do
|
59
59
|
test_log_msg :direct, :debug, "Hello Debug World"
|
60
60
|
end
|
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 '/'
|
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 = {})
|
@@ -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
|
spec_precondition 'memcached is running' do
|
7
7
|
require 'memcache'
|
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
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'
|
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'
|
data/spec/ramaze/view/gestalt.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 'ramaze/gestalt'
|
6
6
|
|
7
7
|
Ramaze::App.options.views = 'gestalt'
|
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'
|
@@ -0,0 +1,60 @@
|
|
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 'less'
|
6
|
+
|
7
|
+
Ramaze::App.options.views = 'less'
|
8
|
+
|
9
|
+
class SpecLess < Ramaze::Controller
|
10
|
+
map '/'
|
11
|
+
provide :css, :Less
|
12
|
+
|
13
|
+
def style
|
14
|
+
<<-LESS
|
15
|
+
@dark: #110011;
|
16
|
+
.outline { border: 1px solid black }
|
17
|
+
|
18
|
+
.article {
|
19
|
+
a { text-decoration: none }
|
20
|
+
p { color: @dark }
|
21
|
+
.outline;
|
22
|
+
}
|
23
|
+
LESS
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
describe Ramaze::View::Less do
|
28
|
+
behaves_like :rack_test
|
29
|
+
|
30
|
+
def cmp(actually, expected)
|
31
|
+
actually.strip.split("\n").sort.
|
32
|
+
should == expected.strip.split("\n").sort
|
33
|
+
end
|
34
|
+
|
35
|
+
should 'render inline' do
|
36
|
+
got = get('/style.css')
|
37
|
+
got.status.should == 200
|
38
|
+
got['Content-Type'].should == 'text/css'
|
39
|
+
|
40
|
+
cmp(got.body, <<-CSS)
|
41
|
+
.outline { border: 1px solid black; }
|
42
|
+
.article a { text-decoration: none; }
|
43
|
+
.article p { color: #110011; }
|
44
|
+
.article { border: 1px solid black; }
|
45
|
+
CSS
|
46
|
+
end
|
47
|
+
|
48
|
+
should 'render from file' do
|
49
|
+
got = get('/file.css')
|
50
|
+
got.status.should == 200
|
51
|
+
got['Content-Type'].should == 'text/css'
|
52
|
+
|
53
|
+
cmp(got.body, <<-CSS)
|
54
|
+
.outline { border: 1px solid black; }
|
55
|
+
.article a { text-decoration: none; }
|
56
|
+
.article p { color: #110011; }
|
57
|
+
.article { border: 1px solid black; }
|
58
|
+
CSS
|
59
|
+
end
|
60
|
+
end
|
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'
|
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'
|
@@ -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'
|