actionview 6.0.3.3 → 6.1.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of actionview might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CHANGELOG.md +177 -208
- data/MIT-LICENSE +1 -1
- data/lib/action_view.rb +4 -1
- data/lib/action_view/base.rb +19 -50
- data/lib/action_view/cache_expiry.rb +1 -2
- data/lib/action_view/dependency_tracker.rb +10 -4
- data/lib/action_view/digestor.rb +3 -2
- data/lib/action_view/gem_version.rb +3 -3
- data/lib/action_view/helpers/asset_tag_helper.rb +55 -15
- data/lib/action_view/helpers/asset_url_helper.rb +6 -4
- data/lib/action_view/helpers/atom_feed_helper.rb +2 -1
- data/lib/action_view/helpers/cache_helper.rb +10 -16
- data/lib/action_view/helpers/date_helper.rb +4 -4
- data/lib/action_view/helpers/form_helper.rb +66 -30
- data/lib/action_view/helpers/form_options_helper.rb +7 -16
- data/lib/action_view/helpers/form_tag_helper.rb +7 -7
- data/lib/action_view/helpers/javascript_helper.rb +3 -3
- data/lib/action_view/helpers/number_helper.rb +6 -6
- data/lib/action_view/helpers/rendering_helper.rb +11 -3
- data/lib/action_view/helpers/sanitize_helper.rb +2 -2
- data/lib/action_view/helpers/tag_helper.rb +92 -17
- data/lib/action_view/helpers/tags/base.rb +9 -5
- data/lib/action_view/helpers/tags/date_field.rb +1 -1
- data/lib/action_view/helpers/tags/date_select.rb +2 -2
- data/lib/action_view/helpers/tags/datetime_local_field.rb +1 -1
- data/lib/action_view/helpers/tags/label.rb +4 -0
- data/lib/action_view/helpers/tags/month_field.rb +1 -1
- data/lib/action_view/helpers/tags/select.rb +1 -1
- data/lib/action_view/helpers/tags/time_field.rb +1 -1
- data/lib/action_view/helpers/tags/week_field.rb +1 -1
- data/lib/action_view/helpers/text_helper.rb +1 -1
- data/lib/action_view/helpers/translation_helper.rb +87 -51
- data/lib/action_view/helpers/url_helper.rb +107 -13
- data/lib/action_view/layouts.rb +3 -2
- data/lib/action_view/log_subscriber.rb +26 -10
- data/lib/action_view/lookup_context.rb +3 -18
- data/lib/action_view/path_set.rb +0 -3
- data/lib/action_view/railtie.rb +39 -46
- data/lib/action_view/renderer/abstract_renderer.rb +93 -14
- data/lib/action_view/renderer/collection_renderer.rb +196 -0
- data/lib/action_view/renderer/object_renderer.rb +34 -0
- data/lib/action_view/renderer/partial_renderer.rb +20 -282
- data/lib/action_view/renderer/partial_renderer/collection_caching.rb +25 -26
- data/lib/action_view/renderer/renderer.rb +44 -1
- data/lib/action_view/renderer/streaming_template_renderer.rb +5 -1
- data/lib/action_view/renderer/template_renderer.rb +15 -12
- data/lib/action_view/rendering.rb +3 -1
- data/lib/action_view/routing_url_for.rb +1 -1
- data/lib/action_view/template.rb +9 -49
- data/lib/action_view/template/handlers.rb +0 -26
- data/lib/action_view/template/handlers/erb.rb +10 -14
- data/lib/action_view/template/handlers/erb/erubi.rb +9 -7
- data/lib/action_view/template/html.rb +1 -11
- data/lib/action_view/template/raw_file.rb +0 -3
- data/lib/action_view/template/renderable.rb +24 -0
- data/lib/action_view/template/resolver.rb +82 -40
- data/lib/action_view/template/text.rb +0 -3
- data/lib/action_view/test_case.rb +18 -25
- data/lib/action_view/testing/resolvers.rb +10 -31
- data/lib/action_view/unbound_template.rb +3 -3
- data/lib/action_view/view_paths.rb +34 -36
- metadata +18 -15
@@ -8,12 +8,8 @@ module ActionView #:nodoc:
|
|
8
8
|
# useful for testing extensions that have no way of knowing what the file
|
9
9
|
# system will look like at runtime.
|
10
10
|
class FixtureResolver < OptimizedFileSystemResolver
|
11
|
-
def initialize(hash = {}
|
11
|
+
def initialize(hash = {})
|
12
12
|
super("")
|
13
|
-
if pattern
|
14
|
-
ActiveSupport::Deprecation.warn "Specifying a custom path for #{self.class} is deprecated. Implement a custom Resolver subclass instead."
|
15
|
-
@pattern = pattern
|
16
|
-
end
|
17
13
|
@hash = hash
|
18
14
|
@path = ""
|
19
15
|
end
|
@@ -27,34 +23,17 @@ module ActionView #:nodoc:
|
|
27
23
|
end
|
28
24
|
|
29
25
|
private
|
30
|
-
def
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
end.map do |_path, source|
|
36
|
-
handler, format, variant = extract_handler_and_format_and_variant(_path)
|
37
|
-
|
38
|
-
Template.new(source, _path, handler,
|
39
|
-
virtual_path: path.virtual,
|
40
|
-
format: format,
|
41
|
-
variant: variant,
|
42
|
-
locals: locals
|
43
|
-
)
|
44
|
-
end.sort_by do |t|
|
45
|
-
match = ("/" + t.identifier).match(regex)
|
46
|
-
EXTENSIONS.keys.reverse.map do |ext|
|
47
|
-
if ext == :variants && exts[ext] == :any
|
48
|
-
match[ext].nil? ? 0 : 1
|
49
|
-
elsif match[ext].nil?
|
50
|
-
exts[ext].length
|
51
|
-
else
|
52
|
-
found = match[ext].to_sym
|
53
|
-
exts[ext].index(found)
|
54
|
-
end
|
55
|
-
end
|
26
|
+
def find_candidate_template_paths(path)
|
27
|
+
@hash.keys.select do |fixture|
|
28
|
+
fixture.start_with?(path.virtual)
|
29
|
+
end.map do |fixture|
|
30
|
+
"/#{fixture}"
|
56
31
|
end
|
57
32
|
end
|
33
|
+
|
34
|
+
def source_for_template(template)
|
35
|
+
@hash[template[1..template.size]]
|
36
|
+
end
|
58
37
|
end
|
59
38
|
|
60
39
|
class NullResolver < PathResolver
|
@@ -4,9 +4,9 @@ require "concurrent/map"
|
|
4
4
|
|
5
5
|
module ActionView
|
6
6
|
class UnboundTemplate
|
7
|
-
def initialize(source,
|
7
|
+
def initialize(source, identifier, handler, options)
|
8
8
|
@source = source
|
9
|
-
@
|
9
|
+
@identifier = identifier
|
10
10
|
@handler = handler
|
11
11
|
@options = options
|
12
12
|
|
@@ -22,7 +22,7 @@ module ActionView
|
|
22
22
|
options = @options.merge(locals: locals)
|
23
23
|
Template.new(
|
24
24
|
@source,
|
25
|
-
@
|
25
|
+
@identifier,
|
26
26
|
@handler,
|
27
27
|
**options
|
28
28
|
)
|
@@ -28,6 +28,40 @@ module ActionView
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
+
# Append a path to the list of view paths for this controller.
|
32
|
+
#
|
33
|
+
# ==== Parameters
|
34
|
+
# * <tt>path</tt> - If a String is provided, it gets converted into
|
35
|
+
# the default view path. You may also provide a custom view path
|
36
|
+
# (see ActionView::PathSet for more information)
|
37
|
+
def append_view_path(path)
|
38
|
+
self._view_paths = view_paths + Array(path)
|
39
|
+
end
|
40
|
+
|
41
|
+
# Prepend a path to the list of view paths for this controller.
|
42
|
+
#
|
43
|
+
# ==== Parameters
|
44
|
+
# * <tt>path</tt> - If a String is provided, it gets converted into
|
45
|
+
# the default view path. You may also provide a custom view path
|
46
|
+
# (see ActionView::PathSet for more information)
|
47
|
+
def prepend_view_path(path)
|
48
|
+
self._view_paths = ActionView::PathSet.new(Array(path) + view_paths)
|
49
|
+
end
|
50
|
+
|
51
|
+
# A list of all of the default view paths for this controller.
|
52
|
+
def view_paths
|
53
|
+
_view_paths
|
54
|
+
end
|
55
|
+
|
56
|
+
# Set the view paths.
|
57
|
+
#
|
58
|
+
# ==== Parameters
|
59
|
+
# * <tt>paths</tt> - If a PathSet is provided, use that;
|
60
|
+
# otherwise, process the parameter into a PathSet.
|
61
|
+
def view_paths=(paths)
|
62
|
+
self._view_paths = ActionView::PathSet.new(Array(paths))
|
63
|
+
end
|
64
|
+
|
31
65
|
private
|
32
66
|
# Override this method in your controller if you want to change paths prefixes for finding views.
|
33
67
|
# Prefixes defined here will still be added to parents' <tt>._prefixes</tt>.
|
@@ -88,41 +122,5 @@ module ActionView
|
|
88
122
|
def prepend_view_path(path)
|
89
123
|
lookup_context.view_paths.unshift(*path)
|
90
124
|
end
|
91
|
-
|
92
|
-
module ClassMethods
|
93
|
-
# Append a path to the list of view paths for this controller.
|
94
|
-
#
|
95
|
-
# ==== Parameters
|
96
|
-
# * <tt>path</tt> - If a String is provided, it gets converted into
|
97
|
-
# the default view path. You may also provide a custom view path
|
98
|
-
# (see ActionView::PathSet for more information)
|
99
|
-
def append_view_path(path)
|
100
|
-
self._view_paths = view_paths + Array(path)
|
101
|
-
end
|
102
|
-
|
103
|
-
# Prepend a path to the list of view paths for this controller.
|
104
|
-
#
|
105
|
-
# ==== Parameters
|
106
|
-
# * <tt>path</tt> - If a String is provided, it gets converted into
|
107
|
-
# the default view path. You may also provide a custom view path
|
108
|
-
# (see ActionView::PathSet for more information)
|
109
|
-
def prepend_view_path(path)
|
110
|
-
self._view_paths = ActionView::PathSet.new(Array(path) + view_paths)
|
111
|
-
end
|
112
|
-
|
113
|
-
# A list of all of the default view paths for this controller.
|
114
|
-
def view_paths
|
115
|
-
_view_paths
|
116
|
-
end
|
117
|
-
|
118
|
-
# Set the view paths.
|
119
|
-
#
|
120
|
-
# ==== Parameters
|
121
|
-
# * <tt>paths</tt> - If a PathSet is provided, use that;
|
122
|
-
# otherwise, process the parameter into a PathSet.
|
123
|
-
def view_paths=(paths)
|
124
|
-
self._view_paths = ActionView::PathSet.new(Array(paths))
|
125
|
-
end
|
126
|
-
end
|
127
125
|
end
|
128
126
|
end
|
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: 6.
|
4
|
+
version: 6.1.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:
|
11
|
+
date: 2021-01-07 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: 6.
|
19
|
+
version: 6.1.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: 6.
|
26
|
+
version: 6.1.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: builder
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -92,28 +92,28 @@ dependencies:
|
|
92
92
|
requirements:
|
93
93
|
- - '='
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: 6.
|
95
|
+
version: 6.1.1
|
96
96
|
type: :development
|
97
97
|
prerelease: false
|
98
98
|
version_requirements: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
100
|
- - '='
|
101
101
|
- !ruby/object:Gem::Version
|
102
|
-
version: 6.
|
102
|
+
version: 6.1.1
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
104
|
name: activemodel
|
105
105
|
requirement: !ruby/object:Gem::Requirement
|
106
106
|
requirements:
|
107
107
|
- - '='
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: 6.
|
109
|
+
version: 6.1.1
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
114
|
- - '='
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version: 6.
|
116
|
+
version: 6.1.1
|
117
117
|
description: Simple, battle-tested conventions and helpers for building web pages.
|
118
118
|
email: david@loudthinking.com
|
119
119
|
executables: []
|
@@ -201,6 +201,8 @@ files:
|
|
201
201
|
- lib/action_view/railtie.rb
|
202
202
|
- lib/action_view/record_identifier.rb
|
203
203
|
- lib/action_view/renderer/abstract_renderer.rb
|
204
|
+
- lib/action_view/renderer/collection_renderer.rb
|
205
|
+
- lib/action_view/renderer/object_renderer.rb
|
204
206
|
- lib/action_view/renderer/partial_renderer.rb
|
205
207
|
- lib/action_view/renderer/partial_renderer/collection_caching.rb
|
206
208
|
- lib/action_view/renderer/renderer.rb
|
@@ -220,6 +222,7 @@ files:
|
|
220
222
|
- lib/action_view/template/html.rb
|
221
223
|
- lib/action_view/template/inline.rb
|
222
224
|
- lib/action_view/template/raw_file.rb
|
225
|
+
- lib/action_view/template/renderable.rb
|
223
226
|
- lib/action_view/template/resolver.rb
|
224
227
|
- lib/action_view/template/sources.rb
|
225
228
|
- lib/action_view/template/sources/file.rb
|
@@ -236,11 +239,11 @@ licenses:
|
|
236
239
|
- MIT
|
237
240
|
metadata:
|
238
241
|
bug_tracker_uri: https://github.com/rails/rails/issues
|
239
|
-
changelog_uri: https://github.com/rails/rails/blob/v6.
|
240
|
-
documentation_uri: https://api.rubyonrails.org/v6.
|
242
|
+
changelog_uri: https://github.com/rails/rails/blob/v6.1.1/actionview/CHANGELOG.md
|
243
|
+
documentation_uri: https://api.rubyonrails.org/v6.1.1/
|
241
244
|
mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
|
242
|
-
source_code_uri: https://github.com/rails/rails/tree/v6.
|
243
|
-
post_install_message:
|
245
|
+
source_code_uri: https://github.com/rails/rails/tree/v6.1.1/actionview
|
246
|
+
post_install_message:
|
244
247
|
rdoc_options: []
|
245
248
|
require_paths:
|
246
249
|
- lib
|
@@ -256,8 +259,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
256
259
|
version: '0'
|
257
260
|
requirements:
|
258
261
|
- none
|
259
|
-
rubygems_version: 3.
|
260
|
-
signing_key:
|
262
|
+
rubygems_version: 3.2.3
|
263
|
+
signing_key:
|
261
264
|
specification_version: 4
|
262
265
|
summary: Rendering framework putting the V in MVC (part of Rails).
|
263
266
|
test_files: []
|