actionpack 4.2.10 → 7.2.0.rc1
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.
- checksums.yaml +5 -5
- data/CHANGELOG.md +86 -600
- data/MIT-LICENSE +1 -1
- data/README.rdoc +13 -14
- data/lib/abstract_controller/asset_paths.rb +5 -1
- data/lib/abstract_controller/base.rb +166 -136
- data/lib/abstract_controller/caching/fragments.rb +149 -0
- data/lib/abstract_controller/caching.rb +68 -0
- data/lib/abstract_controller/callbacks.rb +126 -57
- data/lib/abstract_controller/collector.rb +13 -15
- data/lib/abstract_controller/deprecator.rb +9 -0
- data/lib/abstract_controller/error.rb +8 -0
- data/lib/abstract_controller/helpers.rb +181 -132
- data/lib/abstract_controller/logger.rb +5 -1
- data/lib/abstract_controller/railties/routes_helpers.rb +10 -3
- data/lib/abstract_controller/rendering.rb +56 -56
- data/lib/abstract_controller/translation.rb +29 -15
- data/lib/abstract_controller/url_for.rb +15 -11
- data/lib/abstract_controller.rb +21 -5
- data/lib/action_controller/api/api_rendering.rb +18 -0
- data/lib/action_controller/api.rb +154 -0
- data/lib/action_controller/base.rb +219 -155
- data/lib/action_controller/caching.rb +28 -68
- data/lib/action_controller/deprecator.rb +9 -0
- data/lib/action_controller/form_builder.rb +55 -0
- data/lib/action_controller/log_subscriber.rb +35 -22
- data/lib/action_controller/metal/allow_browser.rb +119 -0
- data/lib/action_controller/metal/basic_implicit_render.rb +17 -0
- data/lib/action_controller/metal/conditional_get.rb +259 -122
- data/lib/action_controller/metal/content_security_policy.rb +86 -0
- data/lib/action_controller/metal/cookies.rb +9 -5
- data/lib/action_controller/metal/data_streaming.rb +87 -104
- data/lib/action_controller/metal/default_headers.rb +21 -0
- data/lib/action_controller/metal/etag_with_flash.rb +22 -0
- data/lib/action_controller/metal/etag_with_template_digest.rb +35 -26
- data/lib/action_controller/metal/exceptions.rb +71 -24
- data/lib/action_controller/metal/flash.rb +26 -19
- data/lib/action_controller/metal/head.rb +45 -36
- data/lib/action_controller/metal/helpers.rb +80 -64
- data/lib/action_controller/metal/http_authentication.rb +297 -244
- data/lib/action_controller/metal/implicit_render.rb +57 -9
- data/lib/action_controller/metal/instrumentation.rb +76 -64
- data/lib/action_controller/metal/live.rb +238 -176
- data/lib/action_controller/metal/logging.rb +22 -0
- data/lib/action_controller/metal/mime_responds.rb +177 -166
- data/lib/action_controller/metal/parameter_encoding.rb +84 -0
- data/lib/action_controller/metal/params_wrapper.rb +145 -118
- data/lib/action_controller/metal/permissions_policy.rb +38 -0
- data/lib/action_controller/metal/rate_limiting.rb +62 -0
- data/lib/action_controller/metal/redirecting.rb +203 -64
- data/lib/action_controller/metal/renderers.rb +108 -65
- data/lib/action_controller/metal/rendering.rb +216 -56
- data/lib/action_controller/metal/request_forgery_protection.rb +496 -163
- data/lib/action_controller/metal/rescue.rb +19 -21
- data/lib/action_controller/metal/streaming.rb +179 -138
- data/lib/action_controller/metal/strong_parameters.rb +1058 -382
- data/lib/action_controller/metal/testing.rb +11 -17
- data/lib/action_controller/metal/url_for.rb +37 -21
- data/lib/action_controller/metal.rb +236 -138
- data/lib/action_controller/railtie.rb +89 -11
- data/lib/action_controller/railties/helpers.rb +5 -1
- data/lib/action_controller/renderer.rb +161 -0
- data/lib/action_controller/template_assertions.rb +13 -0
- data/lib/action_controller/test_case.rb +425 -497
- data/lib/action_controller.rb +44 -22
- data/lib/action_dispatch/constants.rb +34 -0
- data/lib/action_dispatch/deprecator.rb +9 -0
- data/lib/action_dispatch/http/cache.rb +119 -63
- data/lib/action_dispatch/http/content_disposition.rb +47 -0
- data/lib/action_dispatch/http/content_security_policy.rb +364 -0
- data/lib/action_dispatch/http/filter_parameters.rb +36 -34
- data/lib/action_dispatch/http/filter_redirect.rb +24 -12
- data/lib/action_dispatch/http/headers.rb +66 -31
- data/lib/action_dispatch/http/mime_negotiation.rb +106 -75
- data/lib/action_dispatch/http/mime_type.rb +196 -136
- data/lib/action_dispatch/http/mime_types.rb +25 -7
- data/lib/action_dispatch/http/parameters.rb +97 -45
- data/lib/action_dispatch/http/permissions_policy.rb +187 -0
- data/lib/action_dispatch/http/rack_cache.rb +6 -0
- data/lib/action_dispatch/http/request.rb +299 -170
- data/lib/action_dispatch/http/response.rb +311 -160
- data/lib/action_dispatch/http/upload.rb +52 -23
- data/lib/action_dispatch/http/url.rb +201 -125
- data/lib/action_dispatch/journey/formatter.rb +110 -50
- data/lib/action_dispatch/journey/gtg/builder.rb +37 -50
- data/lib/action_dispatch/journey/gtg/simulator.rb +20 -17
- data/lib/action_dispatch/journey/gtg/transition_table.rb +96 -36
- data/lib/action_dispatch/journey/nfa/dot.rb +5 -14
- data/lib/action_dispatch/journey/nodes/node.rb +100 -20
- data/lib/action_dispatch/journey/parser.rb +19 -17
- data/lib/action_dispatch/journey/parser.y +4 -3
- data/lib/action_dispatch/journey/parser_extras.rb +14 -4
- data/lib/action_dispatch/journey/path/pattern.rb +79 -63
- data/lib/action_dispatch/journey/route.rb +108 -44
- data/lib/action_dispatch/journey/router/utils.rb +41 -29
- data/lib/action_dispatch/journey/router.rb +64 -57
- data/lib/action_dispatch/journey/routes.rb +23 -21
- data/lib/action_dispatch/journey/scanner.rb +28 -17
- data/lib/action_dispatch/journey/visitors.rb +100 -54
- data/lib/action_dispatch/journey/visualizer/fsm.js +49 -24
- data/lib/action_dispatch/journey/visualizer/index.html.erb +1 -1
- data/lib/action_dispatch/journey.rb +7 -5
- data/lib/action_dispatch/log_subscriber.rb +25 -0
- data/lib/action_dispatch/middleware/actionable_exceptions.rb +46 -0
- data/lib/action_dispatch/middleware/assume_ssl.rb +27 -0
- data/lib/action_dispatch/middleware/callbacks.rb +7 -6
- data/lib/action_dispatch/middleware/cookies.rb +471 -328
- data/lib/action_dispatch/middleware/debug_exceptions.rb +149 -66
- data/lib/action_dispatch/middleware/debug_locks.rb +129 -0
- data/lib/action_dispatch/middleware/debug_view.rb +73 -0
- data/lib/action_dispatch/middleware/exception_wrapper.rb +275 -73
- data/lib/action_dispatch/middleware/executor.rb +32 -0
- data/lib/action_dispatch/middleware/flash.rb +143 -101
- data/lib/action_dispatch/middleware/host_authorization.rb +171 -0
- data/lib/action_dispatch/middleware/public_exceptions.rb +36 -27
- data/lib/action_dispatch/middleware/reloader.rb +10 -92
- data/lib/action_dispatch/middleware/remote_ip.rb +133 -107
- data/lib/action_dispatch/middleware/request_id.rb +29 -15
- data/lib/action_dispatch/middleware/server_timing.rb +78 -0
- data/lib/action_dispatch/middleware/session/abstract_store.rb +49 -27
- data/lib/action_dispatch/middleware/session/cache_store.rb +33 -16
- data/lib/action_dispatch/middleware/session/cookie_store.rb +86 -80
- data/lib/action_dispatch/middleware/session/mem_cache_store.rb +15 -3
- data/lib/action_dispatch/middleware/show_exceptions.rb +66 -36
- data/lib/action_dispatch/middleware/ssl.rb +134 -36
- data/lib/action_dispatch/middleware/stack.rb +109 -44
- data/lib/action_dispatch/middleware/static.rb +159 -90
- data/lib/action_dispatch/middleware/templates/rescues/_actions.html.erb +13 -0
- data/lib/action_dispatch/middleware/templates/rescues/_actions.text.erb +0 -0
- data/lib/action_dispatch/middleware/templates/rescues/_message_and_suggestions.html.erb +22 -0
- data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb +7 -24
- data/lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb +1 -1
- data/lib/action_dispatch/middleware/templates/rescues/_source.html.erb +36 -0
- data/lib/action_dispatch/middleware/templates/rescues/_source.text.erb +8 -0
- data/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb +46 -36
- data/lib/action_dispatch/middleware/templates/rescues/blocked_host.html.erb +12 -0
- data/lib/action_dispatch/middleware/templates/rescues/blocked_host.text.erb +9 -0
- data/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb +26 -7
- data/lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb +3 -3
- data/lib/action_dispatch/middleware/templates/rescues/invalid_statement.html.erb +24 -0
- data/lib/action_dispatch/middleware/templates/rescues/invalid_statement.text.erb +16 -0
- data/lib/action_dispatch/middleware/templates/rescues/layout.erb +139 -15
- data/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.html.erb +23 -0
- data/lib/action_dispatch/middleware/templates/rescues/missing_exact_template.text.erb +3 -0
- data/lib/action_dispatch/middleware/templates/rescues/missing_template.html.erb +6 -6
- data/lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb +7 -7
- data/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb +9 -9
- data/lib/action_dispatch/middleware/templates/rescues/template_error.text.erb +1 -1
- data/lib/action_dispatch/middleware/templates/rescues/unknown_action.html.erb +4 -4
- data/lib/action_dispatch/middleware/templates/rescues/unknown_action.text.erb +1 -1
- data/lib/action_dispatch/middleware/templates/routes/_route.html.erb +7 -4
- data/lib/action_dispatch/middleware/templates/routes/_table.html.erb +125 -93
- data/lib/action_dispatch/railtie.rb +44 -16
- data/lib/action_dispatch/request/session.rb +159 -69
- data/lib/action_dispatch/request/utils.rb +97 -23
- data/lib/action_dispatch/routing/endpoint.rb +11 -2
- data/lib/action_dispatch/routing/inspector.rb +195 -106
- data/lib/action_dispatch/routing/mapper.rb +1338 -955
- data/lib/action_dispatch/routing/polymorphic_routes.rb +234 -201
- data/lib/action_dispatch/routing/redirection.rb +78 -51
- data/lib/action_dispatch/routing/route_set.rb +460 -374
- data/lib/action_dispatch/routing/routes_proxy.rb +36 -12
- data/lib/action_dispatch/routing/url_for.rb +172 -124
- data/lib/action_dispatch/routing.rb +159 -158
- data/lib/action_dispatch/system_test_case.rb +206 -0
- data/lib/action_dispatch/system_testing/browser.rb +84 -0
- data/lib/action_dispatch/system_testing/driver.rb +85 -0
- data/lib/action_dispatch/system_testing/server.rb +33 -0
- data/lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb +164 -0
- data/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +23 -0
- data/lib/action_dispatch/testing/assertion_response.rb +48 -0
- data/lib/action_dispatch/testing/assertions/response.rb +71 -39
- data/lib/action_dispatch/testing/assertions/routing.rb +228 -103
- data/lib/action_dispatch/testing/assertions.rb +9 -6
- data/lib/action_dispatch/testing/integration.rb +486 -306
- data/lib/action_dispatch/testing/request_encoder.rb +60 -0
- data/lib/action_dispatch/testing/test_helpers/page_dump_helper.rb +35 -0
- data/lib/action_dispatch/testing/test_process.rb +35 -22
- data/lib/action_dispatch/testing/test_request.rb +29 -34
- data/lib/action_dispatch/testing/test_response.rb +48 -15
- data/lib/action_dispatch.rb +82 -40
- data/lib/action_pack/gem_version.rb +8 -4
- data/lib/action_pack/version.rb +6 -2
- data/lib/action_pack.rb +21 -18
- metadata +146 -56
- data/lib/action_controller/caching/fragments.rb +0 -103
- data/lib/action_controller/metal/force_ssl.rb +0 -97
- data/lib/action_controller/metal/hide_actions.rb +0 -40
- data/lib/action_controller/metal/rack_delegation.rb +0 -32
- data/lib/action_controller/middleware.rb +0 -39
- data/lib/action_controller/model_naming.rb +0 -12
- data/lib/action_dispatch/http/parameter_filter.rb +0 -72
- data/lib/action_dispatch/journey/backwards.rb +0 -5
- data/lib/action_dispatch/journey/nfa/builder.rb +0 -76
- data/lib/action_dispatch/journey/nfa/simulator.rb +0 -47
- data/lib/action_dispatch/journey/nfa/transition_table.rb +0 -163
- data/lib/action_dispatch/journey/router/strexp.rb +0 -27
- data/lib/action_dispatch/middleware/params_parser.rb +0 -60
- data/lib/action_dispatch/middleware/templates/rescues/_source.erb +0 -27
- data/lib/action_dispatch/testing/assertions/dom.rb +0 -3
- data/lib/action_dispatch/testing/assertions/selector.rb +0 -3
- data/lib/action_dispatch/testing/assertions/tag.rb +0 -3
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionpack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 7.2.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Heinemeier Hansson
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,110 +16,160 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 7.2.0.rc1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 7.2.0.rc1
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: nokogiri
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 1.8.5
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 1.8.5
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: racc
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
27
55
|
- !ruby/object:Gem::Dependency
|
28
56
|
name: rack
|
29
57
|
requirement: !ruby/object:Gem::Requirement
|
30
58
|
requirements:
|
31
|
-
- - "
|
59
|
+
- - ">="
|
32
60
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
61
|
+
version: 2.2.4
|
62
|
+
- - "<"
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '3.2'
|
34
65
|
type: :runtime
|
35
66
|
prerelease: false
|
36
67
|
version_requirements: !ruby/object:Gem::Requirement
|
37
68
|
requirements:
|
38
|
-
- - "
|
69
|
+
- - ">="
|
39
70
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
71
|
+
version: 2.2.4
|
72
|
+
- - "<"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '3.2'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: rack-session
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: 1.0.1
|
82
|
+
type: :runtime
|
83
|
+
prerelease: false
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: 1.0.1
|
41
89
|
- !ruby/object:Gem::Dependency
|
42
90
|
name: rack-test
|
43
91
|
requirement: !ruby/object:Gem::Requirement
|
44
92
|
requirements:
|
45
|
-
- - "
|
93
|
+
- - ">="
|
46
94
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.6.
|
95
|
+
version: 0.6.3
|
48
96
|
type: :runtime
|
49
97
|
prerelease: false
|
50
98
|
version_requirements: !ruby/object:Gem::Requirement
|
51
99
|
requirements:
|
52
|
-
- - "
|
100
|
+
- - ">="
|
53
101
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.6.
|
102
|
+
version: 0.6.3
|
55
103
|
- !ruby/object:Gem::Dependency
|
56
104
|
name: rails-html-sanitizer
|
57
105
|
requirement: !ruby/object:Gem::Requirement
|
58
106
|
requirements:
|
59
107
|
- - "~>"
|
60
108
|
- !ruby/object:Gem::Version
|
61
|
-
version: '1.
|
62
|
-
- - ">="
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
version: 1.0.2
|
109
|
+
version: '1.6'
|
65
110
|
type: :runtime
|
66
111
|
prerelease: false
|
67
112
|
version_requirements: !ruby/object:Gem::Requirement
|
68
113
|
requirements:
|
69
114
|
- - "~>"
|
70
115
|
- !ruby/object:Gem::Version
|
71
|
-
version: '1.
|
72
|
-
- - ">="
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: 1.0.2
|
116
|
+
version: '1.6'
|
75
117
|
- !ruby/object:Gem::Dependency
|
76
118
|
name: rails-dom-testing
|
77
119
|
requirement: !ruby/object:Gem::Requirement
|
78
120
|
requirements:
|
79
121
|
- - "~>"
|
80
122
|
- !ruby/object:Gem::Version
|
81
|
-
version: '
|
82
|
-
- - ">="
|
83
|
-
- !ruby/object:Gem::Version
|
84
|
-
version: 1.0.5
|
123
|
+
version: '2.2'
|
85
124
|
type: :runtime
|
86
125
|
prerelease: false
|
87
126
|
version_requirements: !ruby/object:Gem::Requirement
|
88
127
|
requirements:
|
89
128
|
- - "~>"
|
90
129
|
- !ruby/object:Gem::Version
|
91
|
-
version: '
|
92
|
-
|
130
|
+
version: '2.2'
|
131
|
+
- !ruby/object:Gem::Dependency
|
132
|
+
name: useragent
|
133
|
+
requirement: !ruby/object:Gem::Requirement
|
134
|
+
requirements:
|
135
|
+
- - "~>"
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
version: '0.16'
|
138
|
+
type: :runtime
|
139
|
+
prerelease: false
|
140
|
+
version_requirements: !ruby/object:Gem::Requirement
|
141
|
+
requirements:
|
142
|
+
- - "~>"
|
93
143
|
- !ruby/object:Gem::Version
|
94
|
-
version:
|
144
|
+
version: '0.16'
|
95
145
|
- !ruby/object:Gem::Dependency
|
96
146
|
name: actionview
|
97
147
|
requirement: !ruby/object:Gem::Requirement
|
98
148
|
requirements:
|
99
149
|
- - '='
|
100
150
|
- !ruby/object:Gem::Version
|
101
|
-
version:
|
151
|
+
version: 7.2.0.rc1
|
102
152
|
type: :runtime
|
103
153
|
prerelease: false
|
104
154
|
version_requirements: !ruby/object:Gem::Requirement
|
105
155
|
requirements:
|
106
156
|
- - '='
|
107
157
|
- !ruby/object:Gem::Version
|
108
|
-
version:
|
158
|
+
version: 7.2.0.rc1
|
109
159
|
- !ruby/object:Gem::Dependency
|
110
160
|
name: activemodel
|
111
161
|
requirement: !ruby/object:Gem::Requirement
|
112
162
|
requirements:
|
113
163
|
- - '='
|
114
164
|
- !ruby/object:Gem::Version
|
115
|
-
version:
|
165
|
+
version: 7.2.0.rc1
|
116
166
|
type: :development
|
117
167
|
prerelease: false
|
118
168
|
version_requirements: !ruby/object:Gem::Requirement
|
119
169
|
requirements:
|
120
170
|
- - '='
|
121
171
|
- !ruby/object:Gem::Version
|
122
|
-
version:
|
172
|
+
version: 7.2.0.rc1
|
123
173
|
description: Web apps on Rails. Simple, battle-tested conventions for building and
|
124
174
|
testing MVC web applications. Works with any Rack-compatible server.
|
125
175
|
email: david@loudthinking.com
|
@@ -133,8 +183,12 @@ files:
|
|
133
183
|
- lib/abstract_controller.rb
|
134
184
|
- lib/abstract_controller/asset_paths.rb
|
135
185
|
- lib/abstract_controller/base.rb
|
186
|
+
- lib/abstract_controller/caching.rb
|
187
|
+
- lib/abstract_controller/caching/fragments.rb
|
136
188
|
- lib/abstract_controller/callbacks.rb
|
137
189
|
- lib/abstract_controller/collector.rb
|
190
|
+
- lib/abstract_controller/deprecator.rb
|
191
|
+
- lib/abstract_controller/error.rb
|
138
192
|
- lib/abstract_controller/helpers.rb
|
139
193
|
- lib/abstract_controller/logger.rb
|
140
194
|
- lib/abstract_controller/railties/routes_helpers.rb
|
@@ -142,28 +196,37 @@ files:
|
|
142
196
|
- lib/abstract_controller/translation.rb
|
143
197
|
- lib/abstract_controller/url_for.rb
|
144
198
|
- lib/action_controller.rb
|
199
|
+
- lib/action_controller/api.rb
|
200
|
+
- lib/action_controller/api/api_rendering.rb
|
145
201
|
- lib/action_controller/base.rb
|
146
202
|
- lib/action_controller/caching.rb
|
147
|
-
- lib/action_controller/
|
203
|
+
- lib/action_controller/deprecator.rb
|
204
|
+
- lib/action_controller/form_builder.rb
|
148
205
|
- lib/action_controller/log_subscriber.rb
|
149
206
|
- lib/action_controller/metal.rb
|
207
|
+
- lib/action_controller/metal/allow_browser.rb
|
208
|
+
- lib/action_controller/metal/basic_implicit_render.rb
|
150
209
|
- lib/action_controller/metal/conditional_get.rb
|
210
|
+
- lib/action_controller/metal/content_security_policy.rb
|
151
211
|
- lib/action_controller/metal/cookies.rb
|
152
212
|
- lib/action_controller/metal/data_streaming.rb
|
213
|
+
- lib/action_controller/metal/default_headers.rb
|
214
|
+
- lib/action_controller/metal/etag_with_flash.rb
|
153
215
|
- lib/action_controller/metal/etag_with_template_digest.rb
|
154
216
|
- lib/action_controller/metal/exceptions.rb
|
155
217
|
- lib/action_controller/metal/flash.rb
|
156
|
-
- lib/action_controller/metal/force_ssl.rb
|
157
218
|
- lib/action_controller/metal/head.rb
|
158
219
|
- lib/action_controller/metal/helpers.rb
|
159
|
-
- lib/action_controller/metal/hide_actions.rb
|
160
220
|
- lib/action_controller/metal/http_authentication.rb
|
161
221
|
- lib/action_controller/metal/implicit_render.rb
|
162
222
|
- lib/action_controller/metal/instrumentation.rb
|
163
223
|
- lib/action_controller/metal/live.rb
|
224
|
+
- lib/action_controller/metal/logging.rb
|
164
225
|
- lib/action_controller/metal/mime_responds.rb
|
226
|
+
- lib/action_controller/metal/parameter_encoding.rb
|
165
227
|
- lib/action_controller/metal/params_wrapper.rb
|
166
|
-
- lib/action_controller/metal/
|
228
|
+
- lib/action_controller/metal/permissions_policy.rb
|
229
|
+
- lib/action_controller/metal/rate_limiting.rb
|
167
230
|
- lib/action_controller/metal/redirecting.rb
|
168
231
|
- lib/action_controller/metal/renderers.rb
|
169
232
|
- lib/action_controller/metal/rendering.rb
|
@@ -173,36 +236,36 @@ files:
|
|
173
236
|
- lib/action_controller/metal/strong_parameters.rb
|
174
237
|
- lib/action_controller/metal/testing.rb
|
175
238
|
- lib/action_controller/metal/url_for.rb
|
176
|
-
- lib/action_controller/middleware.rb
|
177
|
-
- lib/action_controller/model_naming.rb
|
178
239
|
- lib/action_controller/railtie.rb
|
179
240
|
- lib/action_controller/railties/helpers.rb
|
241
|
+
- lib/action_controller/renderer.rb
|
242
|
+
- lib/action_controller/template_assertions.rb
|
180
243
|
- lib/action_controller/test_case.rb
|
181
244
|
- lib/action_dispatch.rb
|
245
|
+
- lib/action_dispatch/constants.rb
|
246
|
+
- lib/action_dispatch/deprecator.rb
|
182
247
|
- lib/action_dispatch/http/cache.rb
|
248
|
+
- lib/action_dispatch/http/content_disposition.rb
|
249
|
+
- lib/action_dispatch/http/content_security_policy.rb
|
183
250
|
- lib/action_dispatch/http/filter_parameters.rb
|
184
251
|
- lib/action_dispatch/http/filter_redirect.rb
|
185
252
|
- lib/action_dispatch/http/headers.rb
|
186
253
|
- lib/action_dispatch/http/mime_negotiation.rb
|
187
254
|
- lib/action_dispatch/http/mime_type.rb
|
188
255
|
- lib/action_dispatch/http/mime_types.rb
|
189
|
-
- lib/action_dispatch/http/parameter_filter.rb
|
190
256
|
- lib/action_dispatch/http/parameters.rb
|
257
|
+
- lib/action_dispatch/http/permissions_policy.rb
|
191
258
|
- lib/action_dispatch/http/rack_cache.rb
|
192
259
|
- lib/action_dispatch/http/request.rb
|
193
260
|
- lib/action_dispatch/http/response.rb
|
194
261
|
- lib/action_dispatch/http/upload.rb
|
195
262
|
- lib/action_dispatch/http/url.rb
|
196
263
|
- lib/action_dispatch/journey.rb
|
197
|
-
- lib/action_dispatch/journey/backwards.rb
|
198
264
|
- lib/action_dispatch/journey/formatter.rb
|
199
265
|
- lib/action_dispatch/journey/gtg/builder.rb
|
200
266
|
- lib/action_dispatch/journey/gtg/simulator.rb
|
201
267
|
- lib/action_dispatch/journey/gtg/transition_table.rb
|
202
|
-
- lib/action_dispatch/journey/nfa/builder.rb
|
203
268
|
- lib/action_dispatch/journey/nfa/dot.rb
|
204
|
-
- lib/action_dispatch/journey/nfa/simulator.rb
|
205
|
-
- lib/action_dispatch/journey/nfa/transition_table.rb
|
206
269
|
- lib/action_dispatch/journey/nodes/node.rb
|
207
270
|
- lib/action_dispatch/journey/parser.rb
|
208
271
|
- lib/action_dispatch/journey/parser.y
|
@@ -210,7 +273,6 @@ files:
|
|
210
273
|
- lib/action_dispatch/journey/path/pattern.rb
|
211
274
|
- lib/action_dispatch/journey/route.rb
|
212
275
|
- lib/action_dispatch/journey/router.rb
|
213
|
-
- lib/action_dispatch/journey/router/strexp.rb
|
214
276
|
- lib/action_dispatch/journey/router/utils.rb
|
215
277
|
- lib/action_dispatch/journey/routes.rb
|
216
278
|
- lib/action_dispatch/journey/scanner.rb
|
@@ -218,16 +280,23 @@ files:
|
|
218
280
|
- lib/action_dispatch/journey/visualizer/fsm.css
|
219
281
|
- lib/action_dispatch/journey/visualizer/fsm.js
|
220
282
|
- lib/action_dispatch/journey/visualizer/index.html.erb
|
283
|
+
- lib/action_dispatch/log_subscriber.rb
|
284
|
+
- lib/action_dispatch/middleware/actionable_exceptions.rb
|
285
|
+
- lib/action_dispatch/middleware/assume_ssl.rb
|
221
286
|
- lib/action_dispatch/middleware/callbacks.rb
|
222
287
|
- lib/action_dispatch/middleware/cookies.rb
|
223
288
|
- lib/action_dispatch/middleware/debug_exceptions.rb
|
289
|
+
- lib/action_dispatch/middleware/debug_locks.rb
|
290
|
+
- lib/action_dispatch/middleware/debug_view.rb
|
224
291
|
- lib/action_dispatch/middleware/exception_wrapper.rb
|
292
|
+
- lib/action_dispatch/middleware/executor.rb
|
225
293
|
- lib/action_dispatch/middleware/flash.rb
|
226
|
-
- lib/action_dispatch/middleware/
|
294
|
+
- lib/action_dispatch/middleware/host_authorization.rb
|
227
295
|
- lib/action_dispatch/middleware/public_exceptions.rb
|
228
296
|
- lib/action_dispatch/middleware/reloader.rb
|
229
297
|
- lib/action_dispatch/middleware/remote_ip.rb
|
230
298
|
- lib/action_dispatch/middleware/request_id.rb
|
299
|
+
- lib/action_dispatch/middleware/server_timing.rb
|
231
300
|
- lib/action_dispatch/middleware/session/abstract_store.rb
|
232
301
|
- lib/action_dispatch/middleware/session/cache_store.rb
|
233
302
|
- lib/action_dispatch/middleware/session/cookie_store.rb
|
@@ -236,14 +305,24 @@ files:
|
|
236
305
|
- lib/action_dispatch/middleware/ssl.rb
|
237
306
|
- lib/action_dispatch/middleware/stack.rb
|
238
307
|
- lib/action_dispatch/middleware/static.rb
|
308
|
+
- lib/action_dispatch/middleware/templates/rescues/_actions.html.erb
|
309
|
+
- lib/action_dispatch/middleware/templates/rescues/_actions.text.erb
|
310
|
+
- lib/action_dispatch/middleware/templates/rescues/_message_and_suggestions.html.erb
|
239
311
|
- lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb
|
240
312
|
- lib/action_dispatch/middleware/templates/rescues/_request_and_response.text.erb
|
241
|
-
- lib/action_dispatch/middleware/templates/rescues/_source.erb
|
313
|
+
- lib/action_dispatch/middleware/templates/rescues/_source.html.erb
|
314
|
+
- lib/action_dispatch/middleware/templates/rescues/_source.text.erb
|
242
315
|
- lib/action_dispatch/middleware/templates/rescues/_trace.html.erb
|
243
316
|
- lib/action_dispatch/middleware/templates/rescues/_trace.text.erb
|
317
|
+
- lib/action_dispatch/middleware/templates/rescues/blocked_host.html.erb
|
318
|
+
- lib/action_dispatch/middleware/templates/rescues/blocked_host.text.erb
|
244
319
|
- lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb
|
245
320
|
- lib/action_dispatch/middleware/templates/rescues/diagnostics.text.erb
|
321
|
+
- lib/action_dispatch/middleware/templates/rescues/invalid_statement.html.erb
|
322
|
+
- lib/action_dispatch/middleware/templates/rescues/invalid_statement.text.erb
|
246
323
|
- lib/action_dispatch/middleware/templates/rescues/layout.erb
|
324
|
+
- lib/action_dispatch/middleware/templates/rescues/missing_exact_template.html.erb
|
325
|
+
- lib/action_dispatch/middleware/templates/rescues/missing_exact_template.text.erb
|
247
326
|
- lib/action_dispatch/middleware/templates/rescues/missing_template.html.erb
|
248
327
|
- lib/action_dispatch/middleware/templates/rescues/missing_template.text.erb
|
249
328
|
- lib/action_dispatch/middleware/templates/rescues/routing_error.html.erb
|
@@ -266,24 +345,36 @@ files:
|
|
266
345
|
- lib/action_dispatch/routing/route_set.rb
|
267
346
|
- lib/action_dispatch/routing/routes_proxy.rb
|
268
347
|
- lib/action_dispatch/routing/url_for.rb
|
348
|
+
- lib/action_dispatch/system_test_case.rb
|
349
|
+
- lib/action_dispatch/system_testing/browser.rb
|
350
|
+
- lib/action_dispatch/system_testing/driver.rb
|
351
|
+
- lib/action_dispatch/system_testing/server.rb
|
352
|
+
- lib/action_dispatch/system_testing/test_helpers/screenshot_helper.rb
|
353
|
+
- lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb
|
354
|
+
- lib/action_dispatch/testing/assertion_response.rb
|
269
355
|
- lib/action_dispatch/testing/assertions.rb
|
270
|
-
- lib/action_dispatch/testing/assertions/dom.rb
|
271
356
|
- lib/action_dispatch/testing/assertions/response.rb
|
272
357
|
- lib/action_dispatch/testing/assertions/routing.rb
|
273
|
-
- lib/action_dispatch/testing/assertions/selector.rb
|
274
|
-
- lib/action_dispatch/testing/assertions/tag.rb
|
275
358
|
- lib/action_dispatch/testing/integration.rb
|
359
|
+
- lib/action_dispatch/testing/request_encoder.rb
|
360
|
+
- lib/action_dispatch/testing/test_helpers/page_dump_helper.rb
|
276
361
|
- lib/action_dispatch/testing/test_process.rb
|
277
362
|
- lib/action_dispatch/testing/test_request.rb
|
278
363
|
- lib/action_dispatch/testing/test_response.rb
|
279
364
|
- lib/action_pack.rb
|
280
365
|
- lib/action_pack/gem_version.rb
|
281
366
|
- lib/action_pack/version.rb
|
282
|
-
homepage:
|
367
|
+
homepage: https://rubyonrails.org
|
283
368
|
licenses:
|
284
369
|
- MIT
|
285
|
-
metadata:
|
286
|
-
|
370
|
+
metadata:
|
371
|
+
bug_tracker_uri: https://github.com/rails/rails/issues
|
372
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.2.0.rc1/actionpack/CHANGELOG.md
|
373
|
+
documentation_uri: https://api.rubyonrails.org/v7.2.0.rc1/
|
374
|
+
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
375
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.2.0.rc1/actionpack
|
376
|
+
rubygems_mfa_required: 'true'
|
377
|
+
post_install_message:
|
287
378
|
rdoc_options: []
|
288
379
|
require_paths:
|
289
380
|
- lib
|
@@ -291,7 +382,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
291
382
|
requirements:
|
292
383
|
- - ">="
|
293
384
|
- !ruby/object:Gem::Version
|
294
|
-
version: 1.
|
385
|
+
version: 3.1.0
|
295
386
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
296
387
|
requirements:
|
297
388
|
- - ">="
|
@@ -299,9 +390,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
299
390
|
version: '0'
|
300
391
|
requirements:
|
301
392
|
- none
|
302
|
-
|
303
|
-
|
304
|
-
signing_key:
|
393
|
+
rubygems_version: 3.5.11
|
394
|
+
signing_key:
|
305
395
|
specification_version: 4
|
306
396
|
summary: Web-flow and rendering framework putting the VC in MVC (part of Rails).
|
307
397
|
test_files: []
|
@@ -1,103 +0,0 @@
|
|
1
|
-
module ActionController
|
2
|
-
module Caching
|
3
|
-
# Fragment caching is used for caching various blocks within
|
4
|
-
# views without caching the entire action as a whole. This is
|
5
|
-
# useful when certain elements of an action change frequently or
|
6
|
-
# depend on complicated state while other parts rarely change or
|
7
|
-
# can be shared amongst multiple parties. The caching is done using
|
8
|
-
# the +cache+ helper available in the Action View. See
|
9
|
-
# ActionView::Helpers::CacheHelper for more information.
|
10
|
-
#
|
11
|
-
# While it's strongly recommended that you use key-based cache
|
12
|
-
# expiration (see links in CacheHelper for more information),
|
13
|
-
# it is also possible to manually expire caches. For example:
|
14
|
-
#
|
15
|
-
# expire_fragment('name_of_cache')
|
16
|
-
module Fragments
|
17
|
-
# Given a key (as described in +expire_fragment+), returns
|
18
|
-
# a key suitable for use in reading, writing, or expiring a
|
19
|
-
# cached fragment. All keys are prefixed with <tt>views/</tt> and uses
|
20
|
-
# ActiveSupport::Cache.expand_cache_key for the expansion.
|
21
|
-
def fragment_cache_key(key)
|
22
|
-
ActiveSupport::Cache.expand_cache_key(key.is_a?(Hash) ? url_for(key).split("://").last : key, :views)
|
23
|
-
end
|
24
|
-
|
25
|
-
# Writes +content+ to the location signified by
|
26
|
-
# +key+ (see +expire_fragment+ for acceptable formats).
|
27
|
-
def write_fragment(key, content, options = nil)
|
28
|
-
return content unless cache_configured?
|
29
|
-
|
30
|
-
key = fragment_cache_key(key)
|
31
|
-
instrument_fragment_cache :write_fragment, key do
|
32
|
-
content = content.to_str
|
33
|
-
cache_store.write(key, content, options)
|
34
|
-
end
|
35
|
-
content
|
36
|
-
end
|
37
|
-
|
38
|
-
# Reads a cached fragment from the location signified by +key+
|
39
|
-
# (see +expire_fragment+ for acceptable formats).
|
40
|
-
def read_fragment(key, options = nil)
|
41
|
-
return unless cache_configured?
|
42
|
-
|
43
|
-
key = fragment_cache_key(key)
|
44
|
-
instrument_fragment_cache :read_fragment, key do
|
45
|
-
result = cache_store.read(key, options)
|
46
|
-
result.respond_to?(:html_safe) ? result.html_safe : result
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
# Check if a cached fragment from the location signified by
|
51
|
-
# +key+ exists (see +expire_fragment+ for acceptable formats).
|
52
|
-
def fragment_exist?(key, options = nil)
|
53
|
-
return unless cache_configured?
|
54
|
-
key = fragment_cache_key(key)
|
55
|
-
|
56
|
-
instrument_fragment_cache :exist_fragment?, key do
|
57
|
-
cache_store.exist?(key, options)
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
# Removes fragments from the cache.
|
62
|
-
#
|
63
|
-
# +key+ can take one of three forms:
|
64
|
-
#
|
65
|
-
# * String - This would normally take the form of a path, like
|
66
|
-
# <tt>pages/45/notes</tt>.
|
67
|
-
# * Hash - Treated as an implicit call to +url_for+, like
|
68
|
-
# <tt>{ controller: 'pages', action: 'notes', id: 45}</tt>
|
69
|
-
# * Regexp - Will remove any fragment that matches, so
|
70
|
-
# <tt>%r{pages/\d*/notes}</tt> might remove all notes. Make sure you
|
71
|
-
# don't use anchors in the regex (<tt>^</tt> or <tt>$</tt>) because
|
72
|
-
# the actual filename matched looks like
|
73
|
-
# <tt>./cache/filename/path.cache</tt>. Note: Regexp expiration is
|
74
|
-
# only supported on caches that can iterate over all keys (unlike
|
75
|
-
# memcached).
|
76
|
-
#
|
77
|
-
# +options+ is passed through to the cache store's +delete+
|
78
|
-
# method (or <tt>delete_matched</tt>, for Regexp keys).
|
79
|
-
def expire_fragment(key, options = nil)
|
80
|
-
return unless cache_configured?
|
81
|
-
key = fragment_cache_key(key) unless key.is_a?(Regexp)
|
82
|
-
|
83
|
-
instrument_fragment_cache :expire_fragment, key do
|
84
|
-
if key.is_a?(Regexp)
|
85
|
-
cache_store.delete_matched(key, options)
|
86
|
-
else
|
87
|
-
cache_store.delete(key, options)
|
88
|
-
end
|
89
|
-
end
|
90
|
-
end
|
91
|
-
|
92
|
-
def instrument_fragment_cache(name, key) # :nodoc:
|
93
|
-
payload = {
|
94
|
-
controller: controller_name,
|
95
|
-
action: action_name,
|
96
|
-
key: key
|
97
|
-
}
|
98
|
-
|
99
|
-
ActiveSupport::Notifications.instrument("#{name}.action_controller", payload) { yield }
|
100
|
-
end
|
101
|
-
end
|
102
|
-
end
|
103
|
-
end
|
@@ -1,97 +0,0 @@
|
|
1
|
-
require 'active_support/core_ext/hash/except'
|
2
|
-
require 'active_support/core_ext/hash/slice'
|
3
|
-
|
4
|
-
module ActionController
|
5
|
-
# This module provides a method which will redirect browser to use HTTPS
|
6
|
-
# protocol. This will ensure that user's sensitive information will be
|
7
|
-
# transferred safely over the internet. You _should_ always force browser
|
8
|
-
# to use HTTPS when you're transferring sensitive information such as
|
9
|
-
# user authentication, account information, or credit card information.
|
10
|
-
#
|
11
|
-
# Note that if you are really concerned about your application security,
|
12
|
-
# you might consider using +config.force_ssl+ in your config file instead.
|
13
|
-
# That will ensure all the data transferred via HTTPS protocol and prevent
|
14
|
-
# user from getting session hijacked when accessing the site under unsecured
|
15
|
-
# HTTP protocol.
|
16
|
-
module ForceSSL
|
17
|
-
extend ActiveSupport::Concern
|
18
|
-
include AbstractController::Callbacks
|
19
|
-
|
20
|
-
ACTION_OPTIONS = [:only, :except, :if, :unless]
|
21
|
-
URL_OPTIONS = [:protocol, :host, :domain, :subdomain, :port, :path]
|
22
|
-
REDIRECT_OPTIONS = [:status, :flash, :alert, :notice]
|
23
|
-
|
24
|
-
module ClassMethods
|
25
|
-
# Force the request to this particular controller or specified actions to be
|
26
|
-
# under HTTPS protocol.
|
27
|
-
#
|
28
|
-
# If you need to disable this for any reason (e.g. development) then you can use
|
29
|
-
# an +:if+ or +:unless+ condition.
|
30
|
-
#
|
31
|
-
# class AccountsController < ApplicationController
|
32
|
-
# force_ssl if: :ssl_configured?
|
33
|
-
#
|
34
|
-
# def ssl_configured?
|
35
|
-
# !Rails.env.development?
|
36
|
-
# end
|
37
|
-
# end
|
38
|
-
#
|
39
|
-
# ==== URL Options
|
40
|
-
# You can pass any of the following options to affect the redirect url
|
41
|
-
# * <tt>host</tt> - Redirect to a different host name
|
42
|
-
# * <tt>subdomain</tt> - Redirect to a different subdomain
|
43
|
-
# * <tt>domain</tt> - Redirect to a different domain
|
44
|
-
# * <tt>port</tt> - Redirect to a non-standard port
|
45
|
-
# * <tt>path</tt> - Redirect to a different path
|
46
|
-
#
|
47
|
-
# ==== Redirect Options
|
48
|
-
# You can pass any of the following options to affect the redirect status and response
|
49
|
-
# * <tt>status</tt> - Redirect with a custom status (default is 301 Moved Permanently)
|
50
|
-
# * <tt>flash</tt> - Set a flash message when redirecting
|
51
|
-
# * <tt>alert</tt> - Set an alert message when redirecting
|
52
|
-
# * <tt>notice</tt> - Set a notice message when redirecting
|
53
|
-
#
|
54
|
-
# ==== Action Options
|
55
|
-
# You can pass any of the following options to affect the before_action callback
|
56
|
-
# * <tt>only</tt> - The callback should be run only for this action
|
57
|
-
# * <tt>except</tt> - The callback should be run for all actions except this action
|
58
|
-
# * <tt>if</tt> - A symbol naming an instance method or a proc; the callback
|
59
|
-
# will be called only when it returns a true value.
|
60
|
-
# * <tt>unless</tt> - A symbol naming an instance method or a proc; the callback
|
61
|
-
# will be called only when it returns a false value.
|
62
|
-
def force_ssl(options = {})
|
63
|
-
action_options = options.slice(*ACTION_OPTIONS)
|
64
|
-
redirect_options = options.except(*ACTION_OPTIONS)
|
65
|
-
before_action(action_options) do
|
66
|
-
force_ssl_redirect(redirect_options)
|
67
|
-
end
|
68
|
-
end
|
69
|
-
end
|
70
|
-
|
71
|
-
# Redirect the existing request to use the HTTPS protocol.
|
72
|
-
#
|
73
|
-
# ==== Parameters
|
74
|
-
# * <tt>host_or_options</tt> - Either a host name or any of the url & redirect options
|
75
|
-
# available to the <tt>force_ssl</tt> method.
|
76
|
-
def force_ssl_redirect(host_or_options = nil)
|
77
|
-
unless request.ssl?
|
78
|
-
options = {
|
79
|
-
:protocol => 'https://',
|
80
|
-
:host => request.host,
|
81
|
-
:path => request.fullpath,
|
82
|
-
:status => :moved_permanently
|
83
|
-
}
|
84
|
-
|
85
|
-
if host_or_options.is_a?(Hash)
|
86
|
-
options.merge!(host_or_options)
|
87
|
-
elsif host_or_options
|
88
|
-
options[:host] = host_or_options
|
89
|
-
end
|
90
|
-
|
91
|
-
secure_url = ActionDispatch::Http::URL.url_for(options.slice(*URL_OPTIONS))
|
92
|
-
flash.keep if respond_to?(:flash)
|
93
|
-
redirect_to secure_url, options.slice(*REDIRECT_OPTIONS)
|
94
|
-
end
|
95
|
-
end
|
96
|
-
end
|
97
|
-
end
|
@@ -1,40 +0,0 @@
|
|
1
|
-
|
2
|
-
module ActionController
|
3
|
-
# Adds the ability to prevent public methods on a controller to be called as actions.
|
4
|
-
module HideActions
|
5
|
-
extend ActiveSupport::Concern
|
6
|
-
|
7
|
-
included do
|
8
|
-
class_attribute :hidden_actions
|
9
|
-
self.hidden_actions = Set.new.freeze
|
10
|
-
end
|
11
|
-
|
12
|
-
private
|
13
|
-
|
14
|
-
# Overrides AbstractController::Base#action_method? to return false if the
|
15
|
-
# action name is in the list of hidden actions.
|
16
|
-
def method_for_action(action_name)
|
17
|
-
self.class.visible_action?(action_name) && super
|
18
|
-
end
|
19
|
-
|
20
|
-
module ClassMethods
|
21
|
-
# Sets all of the actions passed in as hidden actions.
|
22
|
-
#
|
23
|
-
# ==== Parameters
|
24
|
-
# * <tt>args</tt> - A list of actions
|
25
|
-
def hide_action(*args)
|
26
|
-
self.hidden_actions = hidden_actions.dup.merge(args.map(&:to_s)).freeze
|
27
|
-
end
|
28
|
-
|
29
|
-
def visible_action?(action_name)
|
30
|
-
not hidden_actions.include?(action_name)
|
31
|
-
end
|
32
|
-
|
33
|
-
# Overrides AbstractController::Base#action_methods to remove any methods
|
34
|
-
# that are listed as hidden methods.
|
35
|
-
def action_methods
|
36
|
-
@action_methods ||= Set.new(super.reject { |name| hidden_actions.include?(name) }).freeze
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|