actionpack 3.0.0.beta3 → 3.0.0.beta4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of actionpack might be problematic. Click here for more details.
- data/CHANGELOG +19 -0
- data/lib/abstract_controller.rb +1 -1
- data/lib/abstract_controller/asset_paths.rb +9 -0
- data/lib/abstract_controller/base.rb +5 -13
- data/lib/abstract_controller/callbacks.rb +1 -1
- data/lib/abstract_controller/helpers.rb +0 -1
- data/lib/abstract_controller/layouts.rb +3 -3
- data/lib/abstract_controller/logger.rb +1 -1
- data/lib/abstract_controller/rendering.rb +1 -0
- data/lib/action_controller/base.rb +5 -1
- data/lib/action_controller/caching.rb +2 -3
- data/lib/action_controller/caching/actions.rb +1 -1
- data/lib/action_controller/caching/fragments.rb +1 -1
- data/lib/action_controller/caching/pages.rb +8 -8
- data/lib/action_controller/caching/sweeping.rb +1 -0
- data/lib/action_controller/deprecated/base.rb +10 -36
- data/lib/action_controller/metal.rb +45 -3
- data/lib/action_controller/metal/compatibility.rb +2 -2
- data/lib/action_controller/metal/helpers.rb +3 -3
- data/lib/action_controller/metal/http_authentication.rb +158 -0
- data/lib/action_controller/metal/instrumentation.rb +5 -5
- data/lib/action_controller/metal/rack_delegation.rb +4 -4
- data/lib/action_controller/metal/renderers.rb +3 -3
- data/lib/action_controller/metal/request_forgery_protection.rb +45 -74
- data/lib/action_controller/metal/responder.rb +1 -1
- data/lib/action_controller/metal/url_for.rb +8 -0
- data/lib/action_controller/railtie.rb +26 -39
- data/lib/action_controller/test_case.rb +147 -135
- data/lib/action_controller/vendor/html-scanner/html/tokenizer.rb +1 -0
- data/lib/action_dispatch.rb +0 -1
- data/lib/action_dispatch/http/parameters.rb +2 -1
- data/lib/action_dispatch/http/request.rb +19 -7
- data/lib/action_dispatch/http/response.rb +3 -33
- data/lib/action_dispatch/middleware/cookies.rb +44 -10
- data/lib/action_dispatch/middleware/flash.rb +11 -1
- data/lib/action_dispatch/middleware/params_parser.rb +3 -1
- data/lib/action_dispatch/middleware/session/abstract_store.rb +47 -83
- data/lib/action_dispatch/middleware/session/cookie_store.rb +19 -165
- data/lib/action_dispatch/middleware/session/mem_cache_store.rb +2 -2
- data/lib/action_dispatch/middleware/show_exceptions.rb +18 -12
- data/lib/action_dispatch/middleware/stack.rb +17 -67
- data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb +1 -1
- data/lib/action_dispatch/railtie.rb +0 -2
- data/lib/action_dispatch/routing/deprecated_mapper.rb +1 -0
- data/lib/action_dispatch/routing/mapper.rb +89 -23
- data/lib/action_dispatch/routing/route_set.rb +22 -16
- data/lib/action_dispatch/routing/url_for.rb +1 -1
- data/lib/action_dispatch/testing/assertions/routing.rb +1 -0
- data/lib/action_dispatch/testing/assertions/selector.rb +11 -7
- data/lib/action_dispatch/testing/test_process.rb +3 -2
- data/lib/action_pack/version.rb +1 -1
- data/lib/action_view.rb +5 -1
- data/lib/action_view/base.rb +10 -4
- data/lib/action_view/helpers/active_model_helper.rb +1 -8
- data/lib/action_view/helpers/asset_tag_helper.rb +7 -4
- data/lib/action_view/helpers/cache_helper.rb +14 -14
- data/lib/action_view/helpers/capture_helper.rb +25 -6
- data/lib/action_view/helpers/date_helper.rb +33 -44
- data/lib/action_view/helpers/form_helper.rb +47 -27
- data/lib/action_view/helpers/form_options_helper.rb +26 -3
- data/lib/action_view/helpers/form_tag_helper.rb +8 -4
- data/lib/action_view/helpers/number_helper.rb +5 -2
- data/lib/action_view/helpers/prototype_helper.rb +1 -1
- data/lib/action_view/helpers/tag_helper.rb +1 -1
- data/lib/action_view/helpers/text_helper.rb +55 -46
- data/lib/action_view/helpers/translation_helper.rb +19 -8
- data/lib/action_view/helpers/url_helper.rb +2 -4
- data/lib/action_view/locale/en.yml +14 -14
- data/lib/action_view/lookup_context.rb +52 -22
- data/lib/action_view/paths.rb +1 -0
- data/lib/action_view/render/layouts.rb +3 -12
- data/lib/action_view/render/partials.rb +21 -10
- data/lib/action_view/render/rendering.rb +1 -1
- data/lib/action_view/template.rb +172 -26
- data/lib/action_view/template/error.rb +25 -27
- data/lib/action_view/template/handlers.rb +1 -1
- data/lib/action_view/template/handlers/erb.rb +92 -45
- data/lib/action_view/template/resolver.rb +4 -1
- data/lib/action_view/test_case.rb +105 -72
- data/lib/action_view/testing/resolvers.rb +43 -0
- metadata +62 -20
- data/lib/abstract_controller/assigns.rb +0 -21
- data/lib/action_dispatch/middleware/cascade.rb +0 -29
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'action_view/template/resolver'
|
2
|
+
|
3
|
+
module ActionView #:nodoc:
|
4
|
+
# Use FixtureResolver in your tests to simulate the presence of files on the
|
5
|
+
# file system. This is used internally by Rails' own test suite, and is
|
6
|
+
# useful for testing extensions that have no way of knowing what the file
|
7
|
+
# system will look like at runtime.
|
8
|
+
class FixtureResolver < PathResolver
|
9
|
+
attr_reader :hash
|
10
|
+
|
11
|
+
def initialize(hash = {})
|
12
|
+
super()
|
13
|
+
@hash = hash
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def query(path, exts, formats)
|
19
|
+
query = Regexp.escape(path)
|
20
|
+
exts.each do |ext|
|
21
|
+
query << '(' << ext.map {|e| e && Regexp.escape(".#{e}") }.join('|') << '|)'
|
22
|
+
end
|
23
|
+
|
24
|
+
templates = []
|
25
|
+
@hash.select { |k,v| k =~ /^#{query}$/ }.each do |path, source|
|
26
|
+
handler, format = extract_handler_and_format(path, formats)
|
27
|
+
templates << Template.new(source, path, handler,
|
28
|
+
:virtual_path => path, :format => format)
|
29
|
+
end
|
30
|
+
|
31
|
+
templates.sort_by {|t| -t.identifier.match(/^#{query}$/).captures.reject(&:blank?).size }
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
class NullResolver < ActionView::PathResolver
|
36
|
+
def query(path, exts, formats)
|
37
|
+
handler, format = extract_handler_and_format(path, formats)
|
38
|
+
[ActionView::Template.new("Template generated by Null Resolver", path, handler, :virtual_path => path, :format => format)]
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|
43
|
+
|
metadata
CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
|
|
6
6
|
- 3
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 3.0.0.
|
9
|
+
- beta4
|
10
|
+
version: 3.0.0.beta4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- David Heinemeier Hansson
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-06-08 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -29,8 +29,8 @@ dependencies:
|
|
29
29
|
- 3
|
30
30
|
- 0
|
31
31
|
- 0
|
32
|
-
-
|
33
|
-
version: 3.0.0.
|
32
|
+
- beta4
|
33
|
+
version: 3.0.0.beta4
|
34
34
|
type: :runtime
|
35
35
|
version_requirements: *id001
|
36
36
|
- !ruby/object:Gem::Dependency
|
@@ -44,14 +44,42 @@ dependencies:
|
|
44
44
|
- 3
|
45
45
|
- 0
|
46
46
|
- 0
|
47
|
-
-
|
48
|
-
version: 3.0.0.
|
47
|
+
- beta4
|
48
|
+
version: 3.0.0.beta4
|
49
49
|
type: :runtime
|
50
50
|
version_requirements: *id002
|
51
51
|
- !ruby/object:Gem::Dependency
|
52
|
-
name:
|
52
|
+
name: builder
|
53
53
|
prerelease: false
|
54
54
|
requirement: &id003 !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ~>
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
segments:
|
59
|
+
- 2
|
60
|
+
- 1
|
61
|
+
- 2
|
62
|
+
version: 2.1.2
|
63
|
+
type: :runtime
|
64
|
+
version_requirements: *id003
|
65
|
+
- !ruby/object:Gem::Dependency
|
66
|
+
name: i18n
|
67
|
+
prerelease: false
|
68
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - ~>
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
segments:
|
73
|
+
- 0
|
74
|
+
- 4
|
75
|
+
- 1
|
76
|
+
version: 0.4.1
|
77
|
+
type: :runtime
|
78
|
+
version_requirements: *id004
|
79
|
+
- !ruby/object:Gem::Dependency
|
80
|
+
name: rack
|
81
|
+
prerelease: false
|
82
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
55
83
|
requirements:
|
56
84
|
- - ~>
|
57
85
|
- !ruby/object:Gem::Version
|
@@ -61,39 +89,53 @@ dependencies:
|
|
61
89
|
- 0
|
62
90
|
version: 1.1.0
|
63
91
|
type: :runtime
|
64
|
-
version_requirements: *
|
92
|
+
version_requirements: *id005
|
65
93
|
- !ruby/object:Gem::Dependency
|
66
94
|
name: rack-test
|
67
95
|
prerelease: false
|
68
|
-
requirement: &
|
96
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
69
97
|
requirements:
|
70
98
|
- - ~>
|
71
99
|
- !ruby/object:Gem::Version
|
72
100
|
segments:
|
73
101
|
- 0
|
74
102
|
- 5
|
75
|
-
-
|
76
|
-
version: 0.5.
|
103
|
+
- 4
|
104
|
+
version: 0.5.4
|
77
105
|
type: :runtime
|
78
|
-
version_requirements: *
|
106
|
+
version_requirements: *id006
|
79
107
|
- !ruby/object:Gem::Dependency
|
80
108
|
name: rack-mount
|
81
109
|
prerelease: false
|
82
|
-
requirement: &
|
110
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
83
111
|
requirements:
|
84
112
|
- - ~>
|
85
113
|
- !ruby/object:Gem::Version
|
86
114
|
segments:
|
87
115
|
- 0
|
88
116
|
- 6
|
117
|
+
- 3
|
118
|
+
version: 0.6.3
|
119
|
+
type: :runtime
|
120
|
+
version_requirements: *id007
|
121
|
+
- !ruby/object:Gem::Dependency
|
122
|
+
name: tzinfo
|
123
|
+
prerelease: false
|
124
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
125
|
+
requirements:
|
126
|
+
- - ~>
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
segments:
|
89
129
|
- 0
|
90
|
-
|
130
|
+
- 3
|
131
|
+
- 16
|
132
|
+
version: 0.3.16
|
91
133
|
type: :runtime
|
92
|
-
version_requirements: *
|
134
|
+
version_requirements: *id008
|
93
135
|
- !ruby/object:Gem::Dependency
|
94
136
|
name: erubis
|
95
137
|
prerelease: false
|
96
|
-
requirement: &
|
138
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
97
139
|
requirements:
|
98
140
|
- - ~>
|
99
141
|
- !ruby/object:Gem::Version
|
@@ -103,7 +145,7 @@ dependencies:
|
|
103
145
|
- 5
|
104
146
|
version: 2.6.5
|
105
147
|
type: :runtime
|
106
|
-
version_requirements: *
|
148
|
+
version_requirements: *id009
|
107
149
|
description: Web apps on Rails. Simple, battle-tested conventions for building and testing MVC web applications. Works with any Rack-compatible server.
|
108
150
|
email: david@loudthinking.com
|
109
151
|
executables: []
|
@@ -116,7 +158,7 @@ files:
|
|
116
158
|
- CHANGELOG
|
117
159
|
- README
|
118
160
|
- MIT-LICENSE
|
119
|
-
- lib/abstract_controller/
|
161
|
+
- lib/abstract_controller/asset_paths.rb
|
120
162
|
- lib/abstract_controller/base.rb
|
121
163
|
- lib/abstract_controller/callbacks.rb
|
122
164
|
- lib/abstract_controller/collector.rb
|
@@ -189,7 +231,6 @@ files:
|
|
189
231
|
- lib/action_dispatch/http/upload.rb
|
190
232
|
- lib/action_dispatch/http/url.rb
|
191
233
|
- lib/action_dispatch/middleware/callbacks.rb
|
192
|
-
- lib/action_dispatch/middleware/cascade.rb
|
193
234
|
- lib/action_dispatch/middleware/cookies.rb
|
194
235
|
- lib/action_dispatch/middleware/flash.rb
|
195
236
|
- lib/action_dispatch/middleware/head.rb
|
@@ -276,6 +317,7 @@ files:
|
|
276
317
|
- lib/action_view/template/text.rb
|
277
318
|
- lib/action_view/template.rb
|
278
319
|
- lib/action_view/test_case.rb
|
320
|
+
- lib/action_view/testing/resolvers.rb
|
279
321
|
- lib/action_view.rb
|
280
322
|
has_rdoc: true
|
281
323
|
homepage: http://www.rubyonrails.org
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module AbstractController
|
2
|
-
module Assigns
|
3
|
-
# This method should return a hash with assigns.
|
4
|
-
# You can overwrite this configuration per controller.
|
5
|
-
# :api: public
|
6
|
-
def view_assigns
|
7
|
-
hash = {}
|
8
|
-
variables = instance_variable_names
|
9
|
-
variables -= protected_instance_variables if respond_to?(:protected_instance_variables)
|
10
|
-
variables.each { |name| hash[name] = instance_variable_get(name) }
|
11
|
-
hash
|
12
|
-
end
|
13
|
-
|
14
|
-
# This method assigns the hash specified in _assigns_hash to the given object.
|
15
|
-
# :api: private
|
16
|
-
# TODO Ideally, this should be done on AV::Base.new initialization.
|
17
|
-
def _evaluate_assigns(object)
|
18
|
-
view_assigns.each { |k,v| object.instance_variable_set(k, v) }
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module ActionDispatch
|
2
|
-
class Cascade
|
3
|
-
def self.new(*apps)
|
4
|
-
apps = apps.flatten
|
5
|
-
|
6
|
-
case apps.length
|
7
|
-
when 0
|
8
|
-
raise ArgumentError, "app is required"
|
9
|
-
when 1
|
10
|
-
apps.first
|
11
|
-
else
|
12
|
-
super(apps)
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
def initialize(apps)
|
17
|
-
@apps = apps
|
18
|
-
end
|
19
|
-
|
20
|
-
def call(env)
|
21
|
-
result = nil
|
22
|
-
@apps.each do |app|
|
23
|
-
result = app.call(env)
|
24
|
-
break unless result[1]["X-Cascade"] == "pass"
|
25
|
-
end
|
26
|
-
result
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|