ramaze 2011.12.28 → 2012.03.07
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gems +34 -0
- data/.travis.yml +0 -1
- data/.yardopts +3 -2
- data/README.md +8 -6
- data/examples/app/blog/controller/init.rb +0 -1
- data/examples/app/blog/controller/posts.rb +0 -9
- data/examples/app/blog/controller/users.rb +0 -8
- data/examples/app/blog/model/comment.rb +0 -3
- data/examples/app/blog/model/post.rb +0 -2
- data/examples/app/blog/model/user.rb +1 -6
- data/examples/app/wikore/spec/wikore.rb +2 -2
- data/examples/app/wikore/src/model.rb +2 -8
- data/examples/app/wikore/start.rb +2 -2
- data/examples/misc/memleak_detector.rb +1 -1
- data/guide/AUTHORS +5 -2
- data/guide/CHANGELOG +203 -0
- data/guide/LICENSE +19 -0
- data/guide/general/contributing.md +74 -1
- data/guide/general/helpers.md +14 -0
- data/guide/general/middlewares.md +35 -16
- data/guide/general/sessions.md +39 -13
- data/lib/proto/layout/default.xhtml +1 -1
- data/lib/ramaze.rb +1 -1
- data/lib/ramaze/cache.rb +1 -1
- data/lib/ramaze/cache/localmemcache.rb +1 -1
- data/lib/ramaze/cache/lru.rb +1 -1
- data/lib/ramaze/controller.rb +1 -1
- data/lib/ramaze/dependencies.rb +3 -2
- data/lib/ramaze/gestalt.rb +1 -1
- data/lib/ramaze/helper.rb +1 -1
- data/lib/ramaze/helper/auth.rb +1 -1
- data/lib/ramaze/helper/cache.rb +1 -1
- data/lib/ramaze/helper/csrf.rb +14 -21
- data/lib/ramaze/helper/erector.rb +1 -1
- data/lib/ramaze/helper/flash.rb +1 -1
- data/lib/ramaze/helper/formatting.rb +1 -1
- data/lib/ramaze/helper/identity.rb +1 -1
- data/lib/ramaze/helper/link.rb +1 -1
- data/lib/ramaze/helper/markaby.rb +1 -1
- data/lib/ramaze/helper/stack.rb +1 -1
- data/lib/ramaze/helper/tagz.rb +1 -1
- data/lib/ramaze/helper/thread.rb +1 -1
- data/lib/ramaze/helper/user.rb +68 -30
- data/lib/ramaze/log.rb +1 -1
- data/lib/ramaze/log/analogger.rb +1 -1
- data/lib/ramaze/log/growl.rb +1 -1
- data/lib/ramaze/log/hub.rb +1 -1
- data/lib/ramaze/log/informer.rb +1 -1
- data/lib/ramaze/log/knotify.rb +1 -1
- data/lib/ramaze/log/logger.rb +1 -1
- data/lib/ramaze/log/logging.rb +1 -1
- data/lib/ramaze/log/syslog.rb +1 -1
- data/lib/ramaze/log/xosd.rb +1 -1
- data/lib/ramaze/plugin.rb +1 -1
- data/lib/ramaze/reloader.rb +1 -1
- data/lib/ramaze/request.rb +1 -1
- data/lib/ramaze/response.rb +1 -1
- data/lib/ramaze/snippets.rb +1 -1
- data/lib/ramaze/snippets/array/put_within.rb +1 -1
- data/lib/ramaze/snippets/kernel/pretty_inspect.rb +1 -1
- data/lib/ramaze/snippets/numeric/filesize_format.rb +1 -1
- data/lib/ramaze/snippets/object/__dir__.rb +1 -1
- data/lib/ramaze/snippets/object/instance_variable_defined.rb +1 -1
- data/lib/ramaze/snippets/ordered_set.rb +1 -1
- data/lib/ramaze/snippets/ramaze/acquire.rb +1 -1
- data/lib/ramaze/snippets/ramaze/struct.rb +1 -1
- data/lib/ramaze/snippets/string/camel_case.rb +1 -1
- data/lib/ramaze/snippets/string/color.rb +1 -1
- data/lib/ramaze/snippets/string/end_with.rb +1 -1
- data/lib/ramaze/snippets/string/ord.rb +1 -1
- data/lib/ramaze/snippets/string/snake_case.rb +1 -1
- data/lib/ramaze/snippets/thread/into.rb +1 -1
- data/lib/ramaze/spec/helper/template_examples.rb +1 -1
- data/lib/ramaze/version.rb +1 -1
- data/lib/ramaze/view.rb +3 -2
- data/lib/ramaze/view/erector.rb +16 -14
- data/lib/ramaze/view/erubis.rb +4 -3
- data/lib/ramaze/view/ezamar.rb +3 -1
- data/lib/ramaze/view/haml.rb +4 -0
- data/lib/ramaze/view/liquid.rb +4 -3
- data/lib/ramaze/view/lokar.rb +3 -1
- data/lib/ramaze/view/mustache.rb +3 -1
- data/lib/ramaze/view/nagoro.rb +4 -1
- data/lib/ramaze/view/remarkably.rb +4 -0
- data/lib/ramaze/view/sass.rb +5 -1
- data/lib/ramaze/view/slim.rb +45 -0
- data/lib/ramaze/view/slippers.rb +8 -6
- data/lib/ramaze/view/tagz.rb +3 -1
- data/lib/ramaze/view/tenjin.rb +3 -1
- data/ramaze.gemspec +1 -1
- data/spec/examples/templates/template_erubis.rb +1 -1
- data/spec/examples/templates/template_ezamar.rb +1 -1
- data/spec/examples/templates/template_haml.rb +1 -1
- data/spec/examples/templates/template_liquid.rb +1 -1
- data/spec/examples/templates/template_markaby.rb +1 -1
- data/spec/examples/templates/template_mustache.rb +1 -1
- data/spec/examples/templates/template_nagoro.rb +1 -1
- data/spec/examples/templates/template_remarkably.rb +1 -1
- data/spec/examples/templates/template_tenjin.rb +1 -1
- data/spec/ramaze/action/render.rb +1 -1
- data/spec/ramaze/app.rb +1 -1
- data/spec/ramaze/app/location.rb +1 -1
- data/spec/ramaze/cache/localmemcache.rb +1 -1
- data/spec/ramaze/cache/lru.rb +1 -1
- data/spec/ramaze/cache/memcache.rb +1 -1
- data/spec/ramaze/cache/redis.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 +1 -1
- data/spec/ramaze/controller/mapping.rb +1 -1
- data/spec/ramaze/controller/provide_inheritance.rb +1 -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 +1 -1
- data/spec/ramaze/dispatcher/file.rb +1 -1
- data/spec/ramaze/error.rb +1 -1
- data/spec/ramaze/files.rb +1 -1
- data/spec/ramaze/gestalt.rb +1 -1
- data/spec/ramaze/helper/auth.rb +1 -1
- data/spec/ramaze/helper/bench.rb +1 -1
- data/spec/ramaze/helper/cache.rb +1 -1
- data/spec/ramaze/helper/csrf.rb +10 -19
- data/spec/ramaze/helper/flash.rb +1 -1
- data/spec/ramaze/helper/formatting.rb +1 -1
- data/spec/ramaze/helper/gestalt.rb +1 -1
- data/spec/ramaze/helper/gravatar.rb +1 -1
- data/spec/ramaze/helper/layout.rb +1 -1
- data/spec/ramaze/helper/link.rb +1 -1
- data/spec/ramaze/helper/localize.rb +1 -1
- data/spec/ramaze/helper/maruku.rb +1 -1
- data/spec/ramaze/helper/paginate.rb +1 -1
- data/spec/ramaze/helper/request_accessor.rb +1 -1
- data/spec/ramaze/helper/simple_captcha.rb +1 -1
- data/spec/ramaze/helper/stack.rb +1 -1
- data/spec/ramaze/helper/user.rb +1 -1
- data/spec/ramaze/helper/xhtml.rb +1 -1
- data/spec/ramaze/log/informer.rb +1 -1
- data/spec/ramaze/log/logging.rb +1 -1
- data/spec/ramaze/log/syslog.rb +1 -1
- data/spec/ramaze/params.rb +1 -1
- data/spec/ramaze/request.rb +1 -1
- data/spec/ramaze/session/memcache.rb +1 -1
- data/spec/ramaze/struct.rb +1 -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 +1 -1
- data/spec/ramaze/view/haml.rb +1 -1
- data/spec/ramaze/view/liquid.rb +1 -1
- data/spec/ramaze/view/lokar.rb +1 -1
- data/spec/ramaze/view/mustache.rb +1 -1
- data/spec/ramaze/view/nagoro.rb +1 -1
- data/spec/ramaze/view/remarkably.rb +1 -1
- data/spec/ramaze/view/sass.rb +1 -1
- data/spec/ramaze/view/slim.rb +49 -0
- data/spec/ramaze/view/slim/external.slim +5 -0
- data/spec/ramaze/view/slim/external_vars.slim +5 -0
- data/spec/ramaze/view/tagz.rb +1 -1
- data/spec/ramaze/view/tenjin.rb +1 -1
- data/spec/snippets/array/put_within.rb +1 -1
- data/spec/snippets/binding/locals.rb +1 -1
- data/spec/snippets/numeric/filesize_format.rb +1 -1
- data/spec/snippets/numeric/time.rb +1 -1
- data/spec/snippets/object/__dir__.rb +1 -1
- data/spec/snippets/ordered_set.rb +1 -1
- data/spec/snippets/ramaze/acquire.rb +1 -1
- data/spec/snippets/ramaze/dictionary.rb +1 -1
- data/spec/snippets/ramaze/lru_hash.rb +1 -1
- data/spec/snippets/ramaze/struct.rb +1 -1
- data/spec/snippets/string/camel_case.rb +1 -1
- data/spec/snippets/string/color.rb +1 -1
- data/spec/snippets/string/snake_case.rb +1 -1
- data/spec/snippets/string/unindent.rb +1 -1
- data/spec/snippets/thread/into.rb +1 -1
- metadata +75 -60
- data/guide/GPL_LICENSE +0 -339
- data/guide/RUBY_LICENSE +0 -53
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
|
data/spec/ramaze/app.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../spec/helper', __FILE__)
|
|
5
5
|
|
data/spec/ramaze/app/location.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
|
data/spec/ramaze/cache/lru.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
spec_require 'dalli'
|
data/spec/ramaze/cache/redis.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2011 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
spec_require 'redis'
|
data/spec/ramaze/cache/sequel.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
spec_require 'sequel'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
|
data/spec/ramaze/error.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../spec/helper', __FILE__)
|
|
5
5
|
require 'rexml/document'
|
data/spec/ramaze/files.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../spec/helper', __FILE__)
|
|
5
5
|
|
data/spec/ramaze/gestalt.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# * Encoding: UTF-8
|
|
2
2
|
#
|
|
3
3
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
4
|
-
# All files in this distribution are subject to the terms of the
|
|
4
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
5
5
|
|
|
6
6
|
require File.expand_path('../../../spec/helper', __FILE__)
|
|
7
7
|
require 'ramaze/gestalt'
|
data/spec/ramaze/helper/auth.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
|
data/spec/ramaze/helper/bench.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
require 'ramaze/helper/bench'
|
data/spec/ramaze/helper/cache.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
|
data/spec/ramaze/helper/csrf.rb
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
2
2
|
require 'ramaze/helper/csrf'
|
|
3
3
|
|
|
4
|
-
##
|
|
5
|
-
# A quick note on this controller.
|
|
6
|
-
# I decided to user global variables ($foo) instead of sending
|
|
7
|
-
# certain data to the "browser", this makes it much easier to compare
|
|
8
|
-
# certain values.
|
|
9
|
-
#
|
|
10
|
-
# - Yorick Peterse
|
|
11
|
-
#
|
|
12
4
|
class SpecHelperCSRF < Ramaze::Controller
|
|
13
5
|
|
|
14
6
|
engine :none
|
|
@@ -20,23 +12,19 @@ class SpecHelperCSRF < Ramaze::Controller
|
|
|
20
12
|
end
|
|
21
13
|
end
|
|
22
14
|
|
|
23
|
-
# Generate a new csrf token
|
|
24
15
|
def index
|
|
25
16
|
generate_csrf_token
|
|
26
17
|
end
|
|
27
18
|
|
|
28
|
-
# Retrieve the current value of the CSRF token
|
|
29
19
|
def get
|
|
30
20
|
return get_csrf_token
|
|
31
21
|
end
|
|
32
22
|
|
|
33
|
-
|
|
34
|
-
def dont_regenerate
|
|
23
|
+
def regenerate
|
|
35
24
|
$token_sess = session[:_csrf][:token]
|
|
36
25
|
$token_method = get_csrf_token
|
|
37
26
|
end
|
|
38
27
|
|
|
39
|
-
# Check the TTL
|
|
40
28
|
def check_ttl
|
|
41
29
|
generate_csrf_token :ttl => 3
|
|
42
30
|
$old_token = get_csrf_token
|
|
@@ -44,11 +32,13 @@ class SpecHelperCSRF < Ramaze::Controller
|
|
|
44
32
|
$new_token = get_csrf_token
|
|
45
33
|
end
|
|
46
34
|
|
|
47
|
-
# Check if the before_all block works
|
|
48
35
|
def check_post
|
|
49
36
|
"POST allowed."
|
|
50
37
|
end
|
|
51
38
|
|
|
39
|
+
def get_token
|
|
40
|
+
get_csrf_token
|
|
41
|
+
end
|
|
52
42
|
end
|
|
53
43
|
|
|
54
44
|
describe Ramaze::Helper::CSRF do
|
|
@@ -68,11 +58,11 @@ describe Ramaze::Helper::CSRF do
|
|
|
68
58
|
got.body.length.should.equal 128
|
|
69
59
|
end
|
|
70
60
|
|
|
71
|
-
it '
|
|
72
|
-
got = get '/
|
|
61
|
+
it 'generate a new token if the previous one is valid' do
|
|
62
|
+
got = get '/regenerate'
|
|
73
63
|
|
|
74
|
-
got.status.should.equal
|
|
75
|
-
$token_sess.should.equal $token_method
|
|
64
|
+
got.status.should.equal 200
|
|
65
|
+
$token_sess.should.not.equal $token_method
|
|
76
66
|
end
|
|
77
67
|
|
|
78
68
|
it 'expire token after 3 seconds' do
|
|
@@ -86,8 +76,9 @@ describe Ramaze::Helper::CSRF do
|
|
|
86
76
|
methods = [:get, :post, :put, :delete]
|
|
87
77
|
|
|
88
78
|
methods.each do |method|
|
|
79
|
+
token = get('/get_token').body
|
|
89
80
|
got_invalid = self.send(method, '/check_post', :name => "Yorick Peterse")
|
|
90
|
-
got_valid = self.send(method, '/check_post', :csrf_token =>
|
|
81
|
+
got_valid = self.send(method, '/check_post', :csrf_token => token)
|
|
91
82
|
|
|
92
83
|
got_invalid.status.should.equal 401
|
|
93
84
|
got_invalid.body.should.equal "The specified CSRF token is incorrect."
|
data/spec/ramaze/helper/flash.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
require 'ramaze/helper/formatting'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
require 'ramaze/helper/gestalt'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
require 'ramaze/helper/gravatar'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
|
data/spec/ramaze/helper/link.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# * Encoding: UTF-8
|
|
2
2
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
3
|
-
# All files in this distribution are subject to the terms of the
|
|
3
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
4
4
|
|
|
5
5
|
$KCODE = 'u' if /regexp/.respond_to?(:kcode)
|
|
6
6
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
spec_require 'maruku'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
spec_require 'hpricot'
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
|
data/spec/ramaze/helper/stack.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
|
data/spec/ramaze/helper/user.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
|
data/spec/ramaze/helper/xhtml.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
require 'ramaze/helper/xhtml'
|
data/spec/ramaze/log/informer.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
require 'ramaze/log/informer'
|
data/spec/ramaze/log/logging.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
|
data/spec/ramaze/log/syslog.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2008 rob@rebeltechnologies.nl
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
|
data/spec/ramaze/params.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../spec/helper', __FILE__)
|
|
5
5
|
|
data/spec/ramaze/request.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../spec/helper', __FILE__)
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../../spec/helper', __FILE__)
|
|
5
5
|
require 'dalli'
|
data/spec/ramaze/struct.rb
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Copyright (c) 2009 Michael Fellinger m.fellinger@gmail.com
|
|
2
|
-
# All files in this distribution are subject to the terms of the
|
|
2
|
+
# All files in this distribution are subject to the terms of the MIT license.
|
|
3
3
|
|
|
4
4
|
require File.expand_path('../../../spec/helper', __FILE__)
|
|
5
5
|
|