actionview 7.0.8.6 → 7.1.0.beta1

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.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +235 -387
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +1 -1
  5. data/app/assets/javascripts/rails-ujs.esm.js +668 -0
  6. data/app/assets/javascripts/rails-ujs.js +606 -0
  7. data/lib/action_view/base.rb +28 -7
  8. data/lib/action_view/buffers.rb +106 -8
  9. data/lib/action_view/cache_expiry.rb +40 -43
  10. data/lib/action_view/context.rb +1 -1
  11. data/lib/action_view/deprecator.rb +7 -0
  12. data/lib/action_view/digestor.rb +1 -1
  13. data/lib/action_view/gem_version.rb +4 -4
  14. data/lib/action_view/helpers/active_model_helper.rb +1 -1
  15. data/lib/action_view/helpers/asset_tag_helper.rb +130 -46
  16. data/lib/action_view/helpers/asset_url_helper.rb +6 -5
  17. data/lib/action_view/helpers/atom_feed_helper.rb +5 -5
  18. data/lib/action_view/helpers/cache_helper.rb +3 -9
  19. data/lib/action_view/helpers/capture_helper.rb +24 -10
  20. data/lib/action_view/helpers/content_exfiltration_prevention_helper.rb +70 -0
  21. data/lib/action_view/helpers/controller_helper.rb +6 -0
  22. data/lib/action_view/helpers/csp_helper.rb +2 -2
  23. data/lib/action_view/helpers/csrf_helper.rb +2 -2
  24. data/lib/action_view/helpers/date_helper.rb +17 -19
  25. data/lib/action_view/helpers/debug_helper.rb +3 -3
  26. data/lib/action_view/helpers/form_helper.rb +43 -18
  27. data/lib/action_view/helpers/form_options_helper.rb +2 -1
  28. data/lib/action_view/helpers/form_tag_helper.rb +43 -9
  29. data/lib/action_view/helpers/javascript_helper.rb +1 -0
  30. data/lib/action_view/helpers/number_helper.rb +2 -1
  31. data/lib/action_view/helpers/output_safety_helper.rb +2 -2
  32. data/lib/action_view/helpers/rendering_helper.rb +1 -1
  33. data/lib/action_view/helpers/sanitize_helper.rb +33 -14
  34. data/lib/action_view/helpers/tag_helper.rb +5 -27
  35. data/lib/action_view/helpers/tags/base.rb +11 -52
  36. data/lib/action_view/helpers/tags/collection_check_boxes.rb +1 -0
  37. data/lib/action_view/helpers/tags/collection_radio_buttons.rb +1 -0
  38. data/lib/action_view/helpers/tags/collection_select.rb +3 -0
  39. data/lib/action_view/helpers/tags/date_field.rb +1 -1
  40. data/lib/action_view/helpers/tags/date_select.rb +2 -0
  41. data/lib/action_view/helpers/tags/datetime_field.rb +14 -6
  42. data/lib/action_view/helpers/tags/datetime_local_field.rb +11 -2
  43. data/lib/action_view/helpers/tags/grouped_collection_select.rb +3 -0
  44. data/lib/action_view/helpers/tags/month_field.rb +1 -1
  45. data/lib/action_view/helpers/tags/select.rb +3 -0
  46. data/lib/action_view/helpers/tags/select_renderer.rb +56 -0
  47. data/lib/action_view/helpers/tags/time_field.rb +1 -1
  48. data/lib/action_view/helpers/tags/time_zone_select.rb +3 -0
  49. data/lib/action_view/helpers/tags/week_field.rb +1 -1
  50. data/lib/action_view/helpers/tags/weekday_select.rb +3 -0
  51. data/lib/action_view/helpers/tags.rb +2 -0
  52. data/lib/action_view/helpers/text_helper.rb +32 -16
  53. data/lib/action_view/helpers/translation_helper.rb +3 -3
  54. data/lib/action_view/helpers/url_helper.rb +41 -14
  55. data/lib/action_view/helpers.rb +2 -0
  56. data/lib/action_view/layouts.rb +4 -2
  57. data/lib/action_view/log_subscriber.rb +49 -32
  58. data/lib/action_view/lookup_context.rb +29 -13
  59. data/lib/action_view/path_registry.rb +57 -0
  60. data/lib/action_view/path_set.rb +13 -14
  61. data/lib/action_view/railtie.rb +26 -3
  62. data/lib/action_view/record_identifier.rb +15 -8
  63. data/lib/action_view/renderer/abstract_renderer.rb +1 -1
  64. data/lib/action_view/renderer/collection_renderer.rb +9 -1
  65. data/lib/action_view/renderer/partial_renderer/collection_caching.rb +2 -1
  66. data/lib/action_view/renderer/partial_renderer.rb +2 -1
  67. data/lib/action_view/renderer/renderer.rb +2 -0
  68. data/lib/action_view/renderer/streaming_template_renderer.rb +3 -2
  69. data/lib/action_view/renderer/template_renderer.rb +3 -2
  70. data/lib/action_view/rendering.rb +22 -4
  71. data/lib/action_view/ripper_ast_parser.rb +6 -6
  72. data/lib/action_view/template/error.rb +14 -1
  73. data/lib/action_view/template/handlers/builder.rb +4 -4
  74. data/lib/action_view/template/handlers/erb/erubi.rb +23 -27
  75. data/lib/action_view/template/handlers/erb.rb +73 -1
  76. data/lib/action_view/template/handlers.rb +1 -1
  77. data/lib/action_view/template/html.rb +1 -1
  78. data/lib/action_view/template/raw_file.rb +1 -1
  79. data/lib/action_view/template/renderable.rb +1 -1
  80. data/lib/action_view/template/resolver.rb +10 -2
  81. data/lib/action_view/template/text.rb +1 -1
  82. data/lib/action_view/template/types.rb +25 -34
  83. data/lib/action_view/template.rb +179 -52
  84. data/lib/action_view/template_path.rb +2 -0
  85. data/lib/action_view/test_case.rb +8 -5
  86. data/lib/action_view/unbound_template.rb +15 -5
  87. data/lib/action_view/version.rb +1 -1
  88. data/lib/action_view/view_paths.rb +15 -24
  89. data/lib/action_view.rb +4 -1
  90. metadata +29 -29
@@ -5,7 +5,7 @@ module ActionView
5
5
  extend ActiveSupport::Concern
6
6
 
7
7
  included do
8
- ViewPaths.set_view_paths(self, ActionView::PathSet.new.freeze)
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
- ViewPaths.get_view_paths(self)
16
+ ActionView::PathRegistry.get_view_paths(self)
17
17
  end
18
18
 
19
19
  def _view_paths=(paths)
20
- ViewPaths.set_view_paths(self, paths)
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 + Array(path)
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 = ActionView::PathSet.new(Array(path) + 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 = ActionView::PathSet.new(Array(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.view_paths.push(*path)
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.view_paths.unshift(*path)
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) 2004-2022 David Heinemeier Hansson
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: actionview/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.0.8.6
4
+ version: 7.1.0.beta1
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-10-23 00:00:00.000000000 Z
11
+ date: 2023-09-13 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.0.8.6
19
+ version: 7.1.0.beta1
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.0.8.6
26
+ version: 7.1.0.beta1
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.4'
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.4'
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.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.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.0'
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.0'
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.0.8.6
89
+ version: 7.1.0.beta1
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.0.8.6
96
+ version: 7.1.0.beta1
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.0.8.6
103
+ version: 7.1.0.beta1
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.0.8.6
110
+ version: 7.1.0.beta1
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
@@ -131,6 +127,7 @@ files:
131
127
  - lib/action_view/dependency_tracker.rb
132
128
  - lib/action_view/dependency_tracker/erb_tracker.rb
133
129
  - lib/action_view/dependency_tracker/ripper_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,6 +199,7 @@ 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
@@ -246,12 +246,12 @@ 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.0.8.6/actionview/CHANGELOG.md
250
- documentation_uri: https://api.rubyonrails.org/v7.0.8.6/
249
+ changelog_uri: https://github.com/rails/rails/blob/v7.1.0.beta1/actionview/CHANGELOG.md
250
+ documentation_uri: https://api.rubyonrails.org/v7.1.0.beta1/
251
251
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
252
- source_code_uri: https://github.com/rails/rails/tree/v7.0.8.6/actionview
252
+ source_code_uri: https://github.com/rails/rails/tree/v7.1.0.beta1/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
@@ -262,13 +262,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
262
262
  version: 2.7.0
263
263
  required_rubygems_version: !ruby/object:Gem::Requirement
264
264
  requirements:
265
- - - ">="
265
+ - - ">"
266
266
  - !ruby/object:Gem::Version
267
- version: '0'
267
+ version: 1.3.1
268
268
  requirements:
269
269
  - none
270
- rubygems_version: 3.5.16
271
- signing_key:
270
+ rubygems_version: 3.4.18
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: []