actionview 7.0.8.1 → 7.2.2.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +60 -425
- data/MIT-LICENSE +1 -1
- data/README.rdoc +1 -1
- data/app/assets/javascripts/rails-ujs.esm.js +686 -0
- data/app/assets/javascripts/rails-ujs.js +630 -0
- data/lib/action_view/base.rb +52 -14
- data/lib/action_view/buffers.rb +106 -8
- data/lib/action_view/cache_expiry.rb +44 -41
- data/lib/action_view/context.rb +1 -1
- data/lib/action_view/dependency_tracker/{ripper_tracker.rb → ruby_tracker.rb} +4 -3
- data/lib/action_view/dependency_tracker.rb +1 -1
- data/lib/action_view/deprecator.rb +7 -0
- data/lib/action_view/digestor.rb +1 -1
- data/lib/action_view/gem_version.rb +3 -3
- data/lib/action_view/helpers/active_model_helper.rb +1 -1
- data/lib/action_view/helpers/asset_tag_helper.rb +151 -55
- data/lib/action_view/helpers/asset_url_helper.rb +6 -5
- data/lib/action_view/helpers/atom_feed_helper.rb +5 -5
- data/lib/action_view/helpers/cache_helper.rb +7 -13
- data/lib/action_view/helpers/capture_helper.rb +30 -10
- data/lib/action_view/helpers/content_exfiltration_prevention_helper.rb +70 -0
- data/lib/action_view/helpers/controller_helper.rb +6 -0
- data/lib/action_view/helpers/csp_helper.rb +2 -2
- data/lib/action_view/helpers/csrf_helper.rb +3 -3
- data/lib/action_view/helpers/date_helper.rb +17 -19
- data/lib/action_view/helpers/debug_helper.rb +3 -3
- data/lib/action_view/helpers/form_helper.rb +248 -214
- data/lib/action_view/helpers/form_options_helper.rb +2 -1
- data/lib/action_view/helpers/form_tag_helper.rb +125 -58
- data/lib/action_view/helpers/javascript_helper.rb +1 -0
- data/lib/action_view/helpers/number_helper.rb +37 -330
- data/lib/action_view/helpers/output_safety_helper.rb +6 -6
- data/lib/action_view/helpers/rendering_helper.rb +1 -1
- data/lib/action_view/helpers/sanitize_helper.rb +51 -21
- data/lib/action_view/helpers/tag_helper.rb +210 -42
- data/lib/action_view/helpers/tags/base.rb +11 -52
- data/lib/action_view/helpers/tags/collection_check_boxes.rb +1 -0
- data/lib/action_view/helpers/tags/collection_radio_buttons.rb +1 -0
- data/lib/action_view/helpers/tags/collection_select.rb +3 -0
- data/lib/action_view/helpers/tags/date_field.rb +1 -1
- data/lib/action_view/helpers/tags/date_select.rb +2 -0
- data/lib/action_view/helpers/tags/datetime_field.rb +14 -6
- data/lib/action_view/helpers/tags/datetime_local_field.rb +11 -2
- data/lib/action_view/helpers/tags/grouped_collection_select.rb +3 -0
- data/lib/action_view/helpers/tags/month_field.rb +1 -1
- data/lib/action_view/helpers/tags/select.rb +3 -0
- data/lib/action_view/helpers/tags/select_renderer.rb +56 -0
- data/lib/action_view/helpers/tags/time_field.rb +1 -1
- data/lib/action_view/helpers/tags/time_zone_select.rb +3 -0
- data/lib/action_view/helpers/tags/week_field.rb +1 -1
- data/lib/action_view/helpers/tags/weekday_select.rb +3 -0
- data/lib/action_view/helpers/tags.rb +2 -0
- data/lib/action_view/helpers/text_helper.rb +157 -85
- data/lib/action_view/helpers/translation_helper.rb +3 -3
- data/lib/action_view/helpers/url_helper.rb +35 -80
- data/lib/action_view/helpers.rb +2 -0
- data/lib/action_view/layouts.rb +8 -8
- data/lib/action_view/log_subscriber.rb +57 -36
- data/lib/action_view/lookup_context.rb +29 -13
- data/lib/action_view/path_registry.rb +57 -0
- data/lib/action_view/path_set.rb +13 -14
- data/lib/action_view/railtie.rb +25 -3
- data/lib/action_view/record_identifier.rb +15 -8
- data/lib/action_view/render_parser/prism_render_parser.rb +127 -0
- data/lib/action_view/render_parser/ripper_render_parser.rb +341 -0
- data/lib/action_view/render_parser.rb +21 -169
- data/lib/action_view/renderer/abstract_renderer.rb +2 -2
- data/lib/action_view/renderer/collection_renderer.rb +10 -2
- data/lib/action_view/renderer/partial_renderer/collection_caching.rb +2 -1
- data/lib/action_view/renderer/partial_renderer.rb +2 -1
- data/lib/action_view/renderer/renderer.rb +34 -38
- data/lib/action_view/renderer/streaming_template_renderer.rb +3 -2
- data/lib/action_view/renderer/template_renderer.rb +3 -2
- data/lib/action_view/rendering.rb +26 -8
- data/lib/action_view/template/error.rb +14 -1
- data/lib/action_view/template/handlers/builder.rb +4 -4
- data/lib/action_view/template/handlers/erb/erubi.rb +23 -27
- data/lib/action_view/template/handlers/erb.rb +73 -1
- data/lib/action_view/template/handlers.rb +1 -1
- data/lib/action_view/template/html.rb +1 -1
- data/lib/action_view/template/raw_file.rb +1 -1
- data/lib/action_view/template/renderable.rb +8 -2
- data/lib/action_view/template/resolver.rb +9 -3
- data/lib/action_view/template/text.rb +1 -1
- data/lib/action_view/template/types.rb +25 -34
- data/lib/action_view/template.rb +278 -55
- data/lib/action_view/template_path.rb +2 -0
- data/lib/action_view/test_case.rb +181 -28
- data/lib/action_view/unbound_template.rb +17 -7
- data/lib/action_view/version.rb +1 -1
- data/lib/action_view/view_paths.rb +15 -24
- data/lib/action_view.rb +4 -1
- metadata +31 -31
- data/lib/action_view/ripper_ast_parser.rb +0 -198
- data/lib/assets/compiled/rails-ujs.js +0 -777
@@ -9,6 +9,9 @@ require "rails-dom-testing"
|
|
9
9
|
|
10
10
|
module ActionView
|
11
11
|
# = Action View Test Case
|
12
|
+
#
|
13
|
+
# Read more about <tt>ActionView::TestCase</tt> in {Testing Rails Applications}[https://guides.rubyonrails.org/testing.html#testing-view-partials]
|
14
|
+
# in the guides.
|
12
15
|
class TestCase < ActiveSupport::TestCase
|
13
16
|
class TestController < ActionController::Base
|
14
17
|
include ActionDispatch::TestProcess
|
@@ -60,6 +63,95 @@ module ActionView
|
|
60
63
|
attr_accessor :controller, :request, :output_buffer, :rendered
|
61
64
|
|
62
65
|
module ClassMethods
|
66
|
+
def inherited(descendant) # :nodoc:
|
67
|
+
super
|
68
|
+
|
69
|
+
descendant_content_class = content_class.dup
|
70
|
+
|
71
|
+
if descendant_content_class.respond_to?(:set_temporary_name)
|
72
|
+
descendant_content_class.set_temporary_name("rendered_content")
|
73
|
+
end
|
74
|
+
|
75
|
+
descendant.content_class = descendant_content_class
|
76
|
+
end
|
77
|
+
|
78
|
+
# Register a callable to parse rendered content for a given template
|
79
|
+
# format.
|
80
|
+
#
|
81
|
+
# Each registered parser will also define a +#rendered.[FORMAT]+ helper
|
82
|
+
# method, where +[FORMAT]+ corresponds to the value of the
|
83
|
+
# +format+ argument.
|
84
|
+
#
|
85
|
+
# By default, ActionView::TestCase defines parsers for:
|
86
|
+
#
|
87
|
+
# * +:html+ - returns an instance of +Nokogiri::XML::Node+
|
88
|
+
# * +:json+ - returns an instance of ActiveSupport::HashWithIndifferentAccess
|
89
|
+
#
|
90
|
+
# These pre-registered parsers also define corresponding helpers:
|
91
|
+
#
|
92
|
+
# * +:html+ - defines +rendered.html+
|
93
|
+
# * +:json+ - defines +rendered.json+
|
94
|
+
#
|
95
|
+
# ==== Parameters
|
96
|
+
#
|
97
|
+
# [+format+]
|
98
|
+
# The name (as a +Symbol+) of the format used to render the content.
|
99
|
+
#
|
100
|
+
# [+callable+]
|
101
|
+
# The parser. A callable object that accepts the rendered string as
|
102
|
+
# its sole argument. Alternatively, the parser can be specified as a
|
103
|
+
# block.
|
104
|
+
#
|
105
|
+
# ==== Examples
|
106
|
+
#
|
107
|
+
# test "renders HTML" do
|
108
|
+
# article = Article.create!(title: "Hello, world")
|
109
|
+
#
|
110
|
+
# render partial: "articles/article", locals: { article: article }
|
111
|
+
#
|
112
|
+
# assert_pattern { rendered.html.at("main h1") => { content: "Hello, world" } }
|
113
|
+
# end
|
114
|
+
#
|
115
|
+
# test "renders JSON" do
|
116
|
+
# article = Article.create!(title: "Hello, world")
|
117
|
+
#
|
118
|
+
# render formats: :json, partial: "articles/article", locals: { article: article }
|
119
|
+
#
|
120
|
+
# assert_pattern { rendered.json => { title: "Hello, world" } }
|
121
|
+
# end
|
122
|
+
#
|
123
|
+
# To parse the rendered content into RSS, register a call to +RSS::Parser.parse+:
|
124
|
+
#
|
125
|
+
# register_parser :rss, -> rendered { RSS::Parser.parse(rendered) }
|
126
|
+
#
|
127
|
+
# test "renders RSS" do
|
128
|
+
# article = Article.create!(title: "Hello, world")
|
129
|
+
#
|
130
|
+
# render formats: :rss, partial: article
|
131
|
+
#
|
132
|
+
# assert_equal "Hello, world", rendered.rss.items.last.title
|
133
|
+
# end
|
134
|
+
#
|
135
|
+
# To parse the rendered content into a +Capybara::Simple::Node+,
|
136
|
+
# re-register an +:html+ parser with a call to +Capybara.string+:
|
137
|
+
#
|
138
|
+
# register_parser :html, -> rendered { Capybara.string(rendered) }
|
139
|
+
#
|
140
|
+
# test "renders HTML" do
|
141
|
+
# article = Article.create!(title: "Hello, world")
|
142
|
+
#
|
143
|
+
# render partial: article
|
144
|
+
#
|
145
|
+
# rendered.html.assert_css "h1", text: "Hello, world"
|
146
|
+
# end
|
147
|
+
#
|
148
|
+
def register_parser(format, callable = nil, &block)
|
149
|
+
parser = callable || block || :itself.to_proc
|
150
|
+
content_class.redefine_method(format) do
|
151
|
+
parser.call(to_s)
|
152
|
+
end
|
153
|
+
end
|
154
|
+
|
63
155
|
def tests(helper_class)
|
64
156
|
case helper_class
|
65
157
|
when String, Symbol
|
@@ -79,10 +171,9 @@ module ActionView
|
|
79
171
|
# Almost a duplicate from ActionController::Helpers
|
80
172
|
methods.flatten.each do |method|
|
81
173
|
_helpers_for_modification.module_eval <<~end_eval, __FILE__, __LINE__ + 1
|
82
|
-
def #{method}(
|
83
|
-
_test_case.send(:'#{method}',
|
84
|
-
end
|
85
|
-
ruby2_keywords(:'#{method}')
|
174
|
+
def #{method}(...) # def current_user(...)
|
175
|
+
_test_case.send(:'#{method}', ...) # _test_case.send(:'current_user', ...)
|
176
|
+
end # end
|
86
177
|
end_eval
|
87
178
|
end
|
88
179
|
end
|
@@ -105,15 +196,34 @@ module ActionView
|
|
105
196
|
end
|
106
197
|
end
|
107
198
|
|
199
|
+
included do
|
200
|
+
class_attribute :content_class, instance_accessor: false, default: RenderedViewContent
|
201
|
+
|
202
|
+
setup :setup_with_controller
|
203
|
+
|
204
|
+
register_parser :html, -> rendered { Rails::Dom::Testing.html_document_fragment.parse(rendered) }
|
205
|
+
register_parser :json, -> rendered { JSON.parse(rendered, object_class: ActiveSupport::HashWithIndifferentAccess) }
|
206
|
+
|
207
|
+
ActiveSupport.run_load_hooks(:action_view_test_case, self)
|
208
|
+
|
209
|
+
helper do
|
210
|
+
def protect_against_forgery?
|
211
|
+
false
|
212
|
+
end
|
213
|
+
|
214
|
+
def _test_case
|
215
|
+
controller._test_case
|
216
|
+
end
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
108
220
|
def setup_with_controller
|
109
221
|
controller_class = Class.new(ActionView::TestCase::TestController)
|
110
222
|
@controller = controller_class.new
|
111
223
|
@request = @controller.request
|
112
224
|
@view_flow = ActionView::OutputFlow.new
|
113
|
-
|
114
|
-
|
115
|
-
@output_buffer = ActiveSupport::SafeBuffer.new ""
|
116
|
-
@rendered = +""
|
225
|
+
@output_buffer = ActionView::OutputBuffer.new
|
226
|
+
@rendered = self.class.content_class.new(+"")
|
117
227
|
|
118
228
|
test_case_instance = self
|
119
229
|
controller_class.define_method(:_test_case) { test_case_instance }
|
@@ -133,10 +243,64 @@ module ActionView
|
|
133
243
|
@_rendered_views ||= RenderedViewsCollection.new
|
134
244
|
end
|
135
245
|
|
246
|
+
##
|
247
|
+
# :method: rendered
|
248
|
+
#
|
249
|
+
# Returns the content rendered by the last +render+ call.
|
250
|
+
#
|
251
|
+
# The returned object behaves like a string but also exposes a number of methods
|
252
|
+
# that allows you to parse the content string in formats registered using
|
253
|
+
# <tt>.register_parser</tt>.
|
254
|
+
#
|
255
|
+
# By default includes the following parsers:
|
256
|
+
#
|
257
|
+
# +.html+
|
258
|
+
#
|
259
|
+
# Parse the <tt>rendered</tt> content String into HTML. By default, this means
|
260
|
+
# a <tt>Nokogiri::XML::Node</tt>.
|
261
|
+
#
|
262
|
+
# test "renders HTML" do
|
263
|
+
# article = Article.create!(title: "Hello, world")
|
264
|
+
#
|
265
|
+
# render partial: "articles/article", locals: { article: article }
|
266
|
+
#
|
267
|
+
# assert_pattern { rendered.html.at("main h1") => { content: "Hello, world" } }
|
268
|
+
# end
|
269
|
+
#
|
270
|
+
# To parse the rendered content into a <tt>Capybara::Simple::Node</tt>,
|
271
|
+
# re-register an <tt>:html</tt> parser with a call to
|
272
|
+
# <tt>Capybara.string</tt>:
|
273
|
+
#
|
274
|
+
# register_parser :html, -> rendered { Capybara.string(rendered) }
|
275
|
+
#
|
276
|
+
# test "renders HTML" do
|
277
|
+
# article = Article.create!(title: "Hello, world")
|
278
|
+
#
|
279
|
+
# render partial: article
|
280
|
+
#
|
281
|
+
# rendered.html.assert_css "h1", text: "Hello, world"
|
282
|
+
# end
|
283
|
+
#
|
284
|
+
# +.json+
|
285
|
+
#
|
286
|
+
# Parse the <tt>rendered</tt> content String into JSON. By default, this means
|
287
|
+
# a <tt>ActiveSupport::HashWithIndifferentAccess</tt>.
|
288
|
+
#
|
289
|
+
# test "renders JSON" do
|
290
|
+
# article = Article.create!(title: "Hello, world")
|
291
|
+
#
|
292
|
+
# render formats: :json, partial: "articles/article", locals: { article: article }
|
293
|
+
#
|
294
|
+
# assert_pattern { rendered.json => { title: "Hello, world" } }
|
295
|
+
# end
|
296
|
+
|
136
297
|
def _routes
|
137
298
|
@controller._routes if @controller.respond_to?(:_routes)
|
138
299
|
end
|
139
300
|
|
301
|
+
class RenderedViewContent < String # :nodoc:
|
302
|
+
end
|
303
|
+
|
140
304
|
# Need to experiment if this priority is the best one: rendered => output_buffer
|
141
305
|
class RenderedViewsCollection
|
142
306
|
def initialize
|
@@ -163,25 +327,10 @@ module ActionView
|
|
163
327
|
end
|
164
328
|
end
|
165
329
|
|
166
|
-
included do
|
167
|
-
setup :setup_with_controller
|
168
|
-
ActiveSupport.run_load_hooks(:action_view_test_case, self)
|
169
|
-
|
170
|
-
helper do
|
171
|
-
def protect_against_forgery?
|
172
|
-
false
|
173
|
-
end
|
174
|
-
|
175
|
-
def _test_case
|
176
|
-
controller._test_case
|
177
|
-
end
|
178
|
-
end
|
179
|
-
end
|
180
|
-
|
181
330
|
private
|
182
331
|
# Need to experiment if this priority is the best one: rendered => output_buffer
|
183
332
|
def document_root_element
|
184
|
-
|
333
|
+
Rails::Dom::Testing.html_document.parse(@rendered.blank? ? @output_buffer.to_str : @rendered).root
|
185
334
|
end
|
186
335
|
|
187
336
|
module Locals
|
@@ -227,6 +376,10 @@ module ActionView
|
|
227
376
|
:@_result,
|
228
377
|
:@_routes,
|
229
378
|
:@controller,
|
379
|
+
:@_controller,
|
380
|
+
:@_request,
|
381
|
+
:@_config,
|
382
|
+
:@_default_form_builder,
|
230
383
|
:@_layouts,
|
231
384
|
:@_files,
|
232
385
|
:@_rendered_views,
|
@@ -245,7 +398,7 @@ module ActionView
|
|
245
398
|
:@view_context_class,
|
246
399
|
:@view_flow,
|
247
400
|
:@_subscribers,
|
248
|
-
:@html_document
|
401
|
+
:@html_document,
|
249
402
|
]
|
250
403
|
|
251
404
|
def _user_defined_ivars
|
@@ -262,7 +415,7 @@ module ActionView
|
|
262
415
|
end]
|
263
416
|
end
|
264
417
|
|
265
|
-
def method_missing(selector,
|
418
|
+
def method_missing(selector, ...)
|
266
419
|
begin
|
267
420
|
routes = @controller.respond_to?(:_routes) && @controller._routes
|
268
421
|
rescue
|
@@ -272,7 +425,7 @@ module ActionView
|
|
272
425
|
if routes &&
|
273
426
|
(routes.named_routes.route_defined?(selector) ||
|
274
427
|
routes.mounted_helpers.method_defined?(selector))
|
275
|
-
@controller.__send__(selector,
|
428
|
+
@controller.__send__(selector, ...)
|
276
429
|
else
|
277
430
|
super
|
278
431
|
end
|
@@ -280,7 +433,7 @@ module ActionView
|
|
280
433
|
|
281
434
|
def respond_to_missing?(name, include_private = false)
|
282
435
|
begin
|
283
|
-
routes =
|
436
|
+
routes = @controller.respond_to?(:_routes) && @controller._routes
|
284
437
|
rescue
|
285
438
|
# Don't call routes, if there is an error on _routes call
|
286
439
|
end
|
@@ -18,21 +18,31 @@ module ActionView
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def bind_locals(locals)
|
21
|
-
|
22
|
-
template
|
23
|
-
else
|
21
|
+
unless template = @templates[locals]
|
24
22
|
@write_lock.synchronize do
|
25
23
|
normalized_locals = normalize_locals(locals)
|
26
24
|
|
27
25
|
# We need ||=, both to dedup on the normalized locals and to check
|
28
26
|
# while holding the lock.
|
29
|
-
@templates[normalized_locals] ||= build_template(normalized_locals)
|
27
|
+
template = (@templates[normalized_locals] ||= build_template(normalized_locals))
|
30
28
|
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
if template.strict_locals?
|
30
|
+
# Under strict locals, we only need one template.
|
31
|
+
# This replaces the @templates Concurrent::Map with a hash which
|
32
|
+
# returns this template for every key.
|
33
|
+
@templates = Hash.new(template).freeze
|
34
|
+
else
|
35
|
+
# This may have already been assigned, but we've already de-dup'd so
|
36
|
+
# reassignment is fine.
|
37
|
+
@templates[locals.dup] = template
|
38
|
+
end
|
34
39
|
end
|
35
40
|
end
|
41
|
+
template
|
42
|
+
end
|
43
|
+
|
44
|
+
def built_templates # :nodoc:
|
45
|
+
@templates.values
|
36
46
|
end
|
37
47
|
|
38
48
|
private
|
data/lib/action_view/version.rb
CHANGED
@@ -5,7 +5,7 @@ module ActionView
|
|
5
5
|
extend ActiveSupport::Concern
|
6
6
|
|
7
7
|
included do
|
8
|
-
|
8
|
+
ActionView::PathRegistry.set_view_paths(self, ActionView::PathSet.new.freeze)
|
9
9
|
end
|
10
10
|
|
11
11
|
delegate :template_exists?, :any_templates?, :view_paths, :formats, :formats=,
|
@@ -13,11 +13,11 @@ module ActionView
|
|
13
13
|
|
14
14
|
module ClassMethods
|
15
15
|
def _view_paths
|
16
|
-
|
16
|
+
ActionView::PathRegistry.get_view_paths(self)
|
17
17
|
end
|
18
18
|
|
19
19
|
def _view_paths=(paths)
|
20
|
-
|
20
|
+
ActionView::PathRegistry.set_view_paths(self, paths)
|
21
21
|
end
|
22
22
|
|
23
23
|
def _prefixes # :nodoc:
|
@@ -28,6 +28,13 @@ module ActionView
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
+
def _build_view_paths(paths) # :nodoc:
|
32
|
+
return paths if ActionView::PathSet === paths
|
33
|
+
|
34
|
+
paths = ActionView::PathRegistry.cast_file_system_resolvers(paths)
|
35
|
+
ActionView::PathSet.new(paths)
|
36
|
+
end
|
37
|
+
|
31
38
|
# Append a path to the list of view paths for this controller.
|
32
39
|
#
|
33
40
|
# ==== Parameters
|
@@ -35,7 +42,7 @@ module ActionView
|
|
35
42
|
# the default view path. You may also provide a custom view path
|
36
43
|
# (see ActionView::PathSet for more information)
|
37
44
|
def append_view_path(path)
|
38
|
-
self._view_paths = view_paths +
|
45
|
+
self._view_paths = view_paths + _build_view_paths(path)
|
39
46
|
end
|
40
47
|
|
41
48
|
# Prepend a path to the list of view paths for this controller.
|
@@ -45,7 +52,7 @@ module ActionView
|
|
45
52
|
# the default view path. You may also provide a custom view path
|
46
53
|
# (see ActionView::PathSet for more information)
|
47
54
|
def prepend_view_path(path)
|
48
|
-
self._view_paths =
|
55
|
+
self._view_paths = _build_view_paths(path) + view_paths
|
49
56
|
end
|
50
57
|
|
51
58
|
# A list of all of the default view paths for this controller.
|
@@ -59,7 +66,7 @@ module ActionView
|
|
59
66
|
# * <tt>paths</tt> - If a PathSet is provided, use that;
|
60
67
|
# otherwise, process the parameter into a PathSet.
|
61
68
|
def view_paths=(paths)
|
62
|
-
self._view_paths =
|
69
|
+
self._view_paths = _build_view_paths(paths)
|
63
70
|
end
|
64
71
|
|
65
72
|
private
|
@@ -70,22 +77,6 @@ module ActionView
|
|
70
77
|
end
|
71
78
|
end
|
72
79
|
|
73
|
-
# :stopdoc:
|
74
|
-
@all_view_paths = {}
|
75
|
-
|
76
|
-
def self.get_view_paths(klass)
|
77
|
-
@all_view_paths[klass] || get_view_paths(klass.superclass)
|
78
|
-
end
|
79
|
-
|
80
|
-
def self.set_view_paths(klass, paths)
|
81
|
-
@all_view_paths[klass] = paths
|
82
|
-
end
|
83
|
-
|
84
|
-
def self.all_view_paths
|
85
|
-
@all_view_paths.values.uniq
|
86
|
-
end
|
87
|
-
# :startdoc:
|
88
|
-
|
89
80
|
# The prefixes used in render "foo" shortcuts.
|
90
81
|
def _prefixes # :nodoc:
|
91
82
|
self.class._prefixes
|
@@ -110,7 +101,7 @@ module ActionView
|
|
110
101
|
# the default view path. You may also provide a custom view path
|
111
102
|
# (see ActionView::PathSet for more information)
|
112
103
|
def append_view_path(path)
|
113
|
-
lookup_context.
|
104
|
+
lookup_context.append_view_paths(self.class._build_view_paths(path))
|
114
105
|
end
|
115
106
|
|
116
107
|
# Prepend a path to the list of view paths for the current LookupContext.
|
@@ -120,7 +111,7 @@ module ActionView
|
|
120
111
|
# the default view path. You may also provide a custom view path
|
121
112
|
# (see ActionView::PathSet for more information)
|
122
113
|
def prepend_view_path(path)
|
123
|
-
lookup_context.
|
114
|
+
lookup_context.prepend_view_paths(self.class._build_view_paths(path))
|
124
115
|
end
|
125
116
|
end
|
126
117
|
end
|
data/lib/action_view.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
#--
|
4
|
-
# Copyright (c)
|
4
|
+
# Copyright (c) David Heinemeier Hansson
|
5
5
|
#
|
6
6
|
# Permission is hereby granted, free of charge, to any person obtaining
|
7
7
|
# a copy of this software and associated documentation files (the
|
@@ -26,7 +26,9 @@
|
|
26
26
|
require "active_support"
|
27
27
|
require "active_support/rails"
|
28
28
|
require "action_view/version"
|
29
|
+
require "action_view/deprecator"
|
29
30
|
|
31
|
+
# :include: ../README.rdoc
|
30
32
|
module ActionView
|
31
33
|
extend ActiveSupport::Autoload
|
32
34
|
|
@@ -39,6 +41,7 @@ module ActionView
|
|
39
41
|
autoload :Helpers
|
40
42
|
autoload :LookupContext
|
41
43
|
autoload :Layouts
|
44
|
+
autoload :PathRegistry
|
42
45
|
autoload :PathSet
|
43
46
|
autoload :RecordIdentifier
|
44
47
|
autoload :Rendering
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: actionview
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.2.2.1
|
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: 2024-
|
11
|
+
date: 2024-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 7.
|
19
|
+
version: 7.2.2.1
|
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: 7.
|
26
|
+
version: 7.2.2.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: builder
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,76 +44,70 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '1.
|
47
|
+
version: '1.11'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '1.
|
54
|
+
version: '1.11'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rails-html-sanitizer
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '1.
|
62
|
-
- - ">="
|
63
|
-
- !ruby/object:Gem::Version
|
64
|
-
version: 1.2.0
|
61
|
+
version: '1.6'
|
65
62
|
type: :runtime
|
66
63
|
prerelease: false
|
67
64
|
version_requirements: !ruby/object:Gem::Requirement
|
68
65
|
requirements:
|
69
66
|
- - "~>"
|
70
67
|
- !ruby/object:Gem::Version
|
71
|
-
version: '1.
|
72
|
-
- - ">="
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: 1.2.0
|
68
|
+
version: '1.6'
|
75
69
|
- !ruby/object:Gem::Dependency
|
76
70
|
name: rails-dom-testing
|
77
71
|
requirement: !ruby/object:Gem::Requirement
|
78
72
|
requirements:
|
79
73
|
- - "~>"
|
80
74
|
- !ruby/object:Gem::Version
|
81
|
-
version: '2.
|
75
|
+
version: '2.2'
|
82
76
|
type: :runtime
|
83
77
|
prerelease: false
|
84
78
|
version_requirements: !ruby/object:Gem::Requirement
|
85
79
|
requirements:
|
86
80
|
- - "~>"
|
87
81
|
- !ruby/object:Gem::Version
|
88
|
-
version: '2.
|
82
|
+
version: '2.2'
|
89
83
|
- !ruby/object:Gem::Dependency
|
90
84
|
name: actionpack
|
91
85
|
requirement: !ruby/object:Gem::Requirement
|
92
86
|
requirements:
|
93
87
|
- - '='
|
94
88
|
- !ruby/object:Gem::Version
|
95
|
-
version: 7.
|
89
|
+
version: 7.2.2.1
|
96
90
|
type: :development
|
97
91
|
prerelease: false
|
98
92
|
version_requirements: !ruby/object:Gem::Requirement
|
99
93
|
requirements:
|
100
94
|
- - '='
|
101
95
|
- !ruby/object:Gem::Version
|
102
|
-
version: 7.
|
96
|
+
version: 7.2.2.1
|
103
97
|
- !ruby/object:Gem::Dependency
|
104
98
|
name: activemodel
|
105
99
|
requirement: !ruby/object:Gem::Requirement
|
106
100
|
requirements:
|
107
101
|
- - '='
|
108
102
|
- !ruby/object:Gem::Version
|
109
|
-
version: 7.
|
103
|
+
version: 7.2.2.1
|
110
104
|
type: :development
|
111
105
|
prerelease: false
|
112
106
|
version_requirements: !ruby/object:Gem::Requirement
|
113
107
|
requirements:
|
114
108
|
- - '='
|
115
109
|
- !ruby/object:Gem::Version
|
116
|
-
version: 7.
|
110
|
+
version: 7.2.2.1
|
117
111
|
description: Simple, battle-tested conventions and helpers for building web pages.
|
118
112
|
email: david@loudthinking.com
|
119
113
|
executables: []
|
@@ -123,6 +117,8 @@ files:
|
|
123
117
|
- CHANGELOG.md
|
124
118
|
- MIT-LICENSE
|
125
119
|
- README.rdoc
|
120
|
+
- app/assets/javascripts/rails-ujs.esm.js
|
121
|
+
- app/assets/javascripts/rails-ujs.js
|
126
122
|
- lib/action_view.rb
|
127
123
|
- lib/action_view/base.rb
|
128
124
|
- lib/action_view/buffers.rb
|
@@ -130,7 +126,8 @@ files:
|
|
130
126
|
- lib/action_view/context.rb
|
131
127
|
- lib/action_view/dependency_tracker.rb
|
132
128
|
- lib/action_view/dependency_tracker/erb_tracker.rb
|
133
|
-
- lib/action_view/dependency_tracker/
|
129
|
+
- lib/action_view/dependency_tracker/ruby_tracker.rb
|
130
|
+
- lib/action_view/deprecator.rb
|
134
131
|
- lib/action_view/digestor.rb
|
135
132
|
- lib/action_view/flows.rb
|
136
133
|
- lib/action_view/gem_version.rb
|
@@ -141,6 +138,7 @@ files:
|
|
141
138
|
- lib/action_view/helpers/atom_feed_helper.rb
|
142
139
|
- lib/action_view/helpers/cache_helper.rb
|
143
140
|
- lib/action_view/helpers/capture_helper.rb
|
141
|
+
- lib/action_view/helpers/content_exfiltration_prevention_helper.rb
|
144
142
|
- lib/action_view/helpers/controller_helper.rb
|
145
143
|
- lib/action_view/helpers/csp_helper.rb
|
146
144
|
- lib/action_view/helpers/csrf_helper.rb
|
@@ -182,6 +180,7 @@ files:
|
|
182
180
|
- lib/action_view/helpers/tags/range_field.rb
|
183
181
|
- lib/action_view/helpers/tags/search_field.rb
|
184
182
|
- lib/action_view/helpers/tags/select.rb
|
183
|
+
- lib/action_view/helpers/tags/select_renderer.rb
|
185
184
|
- lib/action_view/helpers/tags/tel_field.rb
|
186
185
|
- lib/action_view/helpers/tags/text_area.rb
|
187
186
|
- lib/action_view/helpers/tags/text_field.rb
|
@@ -200,10 +199,13 @@ files:
|
|
200
199
|
- lib/action_view/log_subscriber.rb
|
201
200
|
- lib/action_view/lookup_context.rb
|
202
201
|
- lib/action_view/model_naming.rb
|
202
|
+
- lib/action_view/path_registry.rb
|
203
203
|
- lib/action_view/path_set.rb
|
204
204
|
- lib/action_view/railtie.rb
|
205
205
|
- lib/action_view/record_identifier.rb
|
206
206
|
- lib/action_view/render_parser.rb
|
207
|
+
- lib/action_view/render_parser/prism_render_parser.rb
|
208
|
+
- lib/action_view/render_parser/ripper_render_parser.rb
|
207
209
|
- lib/action_view/renderer/abstract_renderer.rb
|
208
210
|
- lib/action_view/renderer/collection_renderer.rb
|
209
211
|
- lib/action_view/renderer/object_renderer.rb
|
@@ -213,7 +215,6 @@ files:
|
|
213
215
|
- lib/action_view/renderer/streaming_template_renderer.rb
|
214
216
|
- lib/action_view/renderer/template_renderer.rb
|
215
217
|
- lib/action_view/rendering.rb
|
216
|
-
- lib/action_view/ripper_ast_parser.rb
|
217
218
|
- lib/action_view/routing_url_for.rb
|
218
219
|
- lib/action_view/tasks/cache_digests.rake
|
219
220
|
- lib/action_view/template.rb
|
@@ -240,18 +241,17 @@ files:
|
|
240
241
|
- lib/action_view/unbound_template.rb
|
241
242
|
- lib/action_view/version.rb
|
242
243
|
- lib/action_view/view_paths.rb
|
243
|
-
- lib/assets/compiled/rails-ujs.js
|
244
244
|
homepage: https://rubyonrails.org
|
245
245
|
licenses:
|
246
246
|
- MIT
|
247
247
|
metadata:
|
248
248
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
249
|
-
changelog_uri: https://github.com/rails/rails/blob/v7.
|
250
|
-
documentation_uri: https://api.rubyonrails.org/v7.
|
249
|
+
changelog_uri: https://github.com/rails/rails/blob/v7.2.2.1/actionview/CHANGELOG.md
|
250
|
+
documentation_uri: https://api.rubyonrails.org/v7.2.2.1/
|
251
251
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
252
|
-
source_code_uri: https://github.com/rails/rails/tree/v7.
|
252
|
+
source_code_uri: https://github.com/rails/rails/tree/v7.2.2.1/actionview
|
253
253
|
rubygems_mfa_required: 'true'
|
254
|
-
post_install_message:
|
254
|
+
post_install_message:
|
255
255
|
rdoc_options: []
|
256
256
|
require_paths:
|
257
257
|
- lib
|
@@ -259,7 +259,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
259
259
|
requirements:
|
260
260
|
- - ">="
|
261
261
|
- !ruby/object:Gem::Version
|
262
|
-
version:
|
262
|
+
version: 3.1.0
|
263
263
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
264
264
|
requirements:
|
265
265
|
- - ">="
|
@@ -267,8 +267,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
267
267
|
version: '0'
|
268
268
|
requirements:
|
269
269
|
- none
|
270
|
-
rubygems_version: 3.
|
271
|
-
signing_key:
|
270
|
+
rubygems_version: 3.5.22
|
271
|
+
signing_key:
|
272
272
|
specification_version: 4
|
273
273
|
summary: Rendering framework putting the V in MVC (part of Rails).
|
274
274
|
test_files: []
|