actionview 4.2.11.1 → 6.0.4

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.

Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +201 -192
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +9 -8
  5. data/lib/action_view/base.rb +144 -37
  6. data/lib/action_view/buffers.rb +18 -1
  7. data/lib/action_view/cache_expiry.rb +53 -0
  8. data/lib/action_view/context.rb +8 -12
  9. data/lib/action_view/dependency_tracker.rb +54 -20
  10. data/lib/action_view/digestor.rb +88 -85
  11. data/lib/action_view/flows.rb +11 -12
  12. data/lib/action_view/gem_version.rb +6 -4
  13. data/lib/action_view/helpers/active_model_helper.rb +16 -11
  14. data/lib/action_view/helpers/asset_tag_helper.rb +241 -82
  15. data/lib/action_view/helpers/asset_url_helper.rb +171 -67
  16. data/lib/action_view/helpers/atom_feed_helper.rb +19 -17
  17. data/lib/action_view/helpers/cache_helper.rb +112 -42
  18. data/lib/action_view/helpers/capture_helper.rb +20 -13
  19. data/lib/action_view/helpers/controller_helper.rb +15 -4
  20. data/lib/action_view/helpers/csp_helper.rb +26 -0
  21. data/lib/action_view/helpers/csrf_helper.rb +8 -6
  22. data/lib/action_view/helpers/date_helper.rb +230 -129
  23. data/lib/action_view/helpers/debug_helper.rb +7 -6
  24. data/lib/action_view/helpers/form_helper.rb +755 -129
  25. data/lib/action_view/helpers/form_options_helper.rb +130 -75
  26. data/lib/action_view/helpers/form_tag_helper.rb +116 -71
  27. data/lib/action_view/helpers/javascript_helper.rb +30 -14
  28. data/lib/action_view/helpers/number_helper.rb +84 -59
  29. data/lib/action_view/helpers/output_safety_helper.rb +36 -4
  30. data/lib/action_view/helpers/rendering_helper.rb +11 -8
  31. data/lib/action_view/helpers/sanitize_helper.rb +30 -31
  32. data/lib/action_view/helpers/tag_helper.rb +201 -75
  33. data/lib/action_view/helpers/tags/base.rb +138 -98
  34. data/lib/action_view/helpers/tags/check_box.rb +20 -19
  35. data/lib/action_view/helpers/tags/checkable.rb +4 -2
  36. data/lib/action_view/helpers/tags/collection_check_boxes.rb +12 -34
  37. data/lib/action_view/helpers/tags/collection_helpers.rb +69 -36
  38. data/lib/action_view/helpers/tags/collection_radio_buttons.rb +6 -12
  39. data/lib/action_view/helpers/tags/collection_select.rb +4 -2
  40. data/lib/action_view/helpers/tags/color_field.rb +4 -3
  41. data/lib/action_view/helpers/tags/date_field.rb +2 -1
  42. data/lib/action_view/helpers/tags/date_select.rb +37 -36
  43. data/lib/action_view/helpers/tags/datetime_field.rb +4 -3
  44. data/lib/action_view/helpers/tags/datetime_local_field.rb +2 -1
  45. data/lib/action_view/helpers/tags/datetime_select.rb +2 -0
  46. data/lib/action_view/helpers/tags/email_field.rb +2 -0
  47. data/lib/action_view/helpers/tags/file_field.rb +2 -0
  48. data/lib/action_view/helpers/tags/grouped_collection_select.rb +4 -2
  49. data/lib/action_view/helpers/tags/hidden_field.rb +2 -0
  50. data/lib/action_view/helpers/tags/label.rb +3 -2
  51. data/lib/action_view/helpers/tags/month_field.rb +2 -1
  52. data/lib/action_view/helpers/tags/number_field.rb +2 -0
  53. data/lib/action_view/helpers/tags/password_field.rb +3 -1
  54. data/lib/action_view/helpers/tags/placeholderable.rb +3 -1
  55. data/lib/action_view/helpers/tags/radio_button.rb +7 -6
  56. data/lib/action_view/helpers/tags/range_field.rb +2 -0
  57. data/lib/action_view/helpers/tags/search_field.rb +14 -9
  58. data/lib/action_view/helpers/tags/select.rb +11 -10
  59. data/lib/action_view/helpers/tags/tel_field.rb +2 -0
  60. data/lib/action_view/helpers/tags/text_area.rb +4 -2
  61. data/lib/action_view/helpers/tags/text_field.rb +8 -8
  62. data/lib/action_view/helpers/tags/time_field.rb +2 -1
  63. data/lib/action_view/helpers/tags/time_select.rb +2 -0
  64. data/lib/action_view/helpers/tags/time_zone_select.rb +3 -1
  65. data/lib/action_view/helpers/tags/translator.rb +15 -16
  66. data/lib/action_view/helpers/tags/url_field.rb +2 -0
  67. data/lib/action_view/helpers/tags/week_field.rb +2 -1
  68. data/lib/action_view/helpers/tags.rb +3 -1
  69. data/lib/action_view/helpers/text_helper.rb +56 -38
  70. data/lib/action_view/helpers/translation_helper.rb +91 -47
  71. data/lib/action_view/helpers/url_helper.rb +160 -105
  72. data/lib/action_view/helpers.rb +5 -3
  73. data/lib/action_view/layouts.rb +65 -61
  74. data/lib/action_view/log_subscriber.rb +61 -10
  75. data/lib/action_view/lookup_context.rb +147 -89
  76. data/lib/action_view/model_naming.rb +3 -1
  77. data/lib/action_view/path_set.rb +28 -23
  78. data/lib/action_view/railtie.rb +62 -6
  79. data/lib/action_view/record_identifier.rb +53 -26
  80. data/lib/action_view/renderer/abstract_renderer.rb +71 -13
  81. data/lib/action_view/renderer/partial_renderer/collection_caching.rb +103 -0
  82. data/lib/action_view/renderer/partial_renderer.rb +239 -225
  83. data/lib/action_view/renderer/renderer.rb +22 -8
  84. data/lib/action_view/renderer/streaming_template_renderer.rb +54 -54
  85. data/lib/action_view/renderer/template_renderer.rb +79 -73
  86. data/lib/action_view/rendering.rb +68 -44
  87. data/lib/action_view/routing_url_for.rb +33 -22
  88. data/lib/action_view/tasks/cache_digests.rake +25 -0
  89. data/lib/action_view/template/error.rb +44 -29
  90. data/lib/action_view/template/handlers/builder.rb +12 -13
  91. data/lib/action_view/template/handlers/erb/erubi.rb +87 -0
  92. data/lib/action_view/template/handlers/erb.rb +24 -86
  93. data/lib/action_view/template/handlers/html.rb +11 -0
  94. data/lib/action_view/template/handlers/raw.rb +4 -4
  95. data/lib/action_view/template/handlers.rb +38 -8
  96. data/lib/action_view/template/html.rb +19 -10
  97. data/lib/action_view/template/inline.rb +22 -0
  98. data/lib/action_view/template/raw_file.rb +28 -0
  99. data/lib/action_view/template/resolver.rb +217 -193
  100. data/lib/action_view/template/sources/file.rb +17 -0
  101. data/lib/action_view/template/sources.rb +13 -0
  102. data/lib/action_view/template/text.rb +11 -10
  103. data/lib/action_view/template/types.rb +18 -18
  104. data/lib/action_view/template.rb +146 -90
  105. data/lib/action_view/test_case.rb +52 -32
  106. data/lib/action_view/testing/resolvers.rb +46 -34
  107. data/lib/action_view/unbound_template.rb +31 -0
  108. data/lib/action_view/version.rb +3 -1
  109. data/lib/action_view/view_paths.rb +48 -31
  110. data/lib/action_view.rb +11 -8
  111. data/lib/assets/compiled/rails-ujs.js +746 -0
  112. metadata +38 -29
  113. data/lib/action_view/helpers/record_tag_helper.rb +0 -108
  114. data/lib/action_view/tasks/dependencies.rake +0 -23
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: 4.2.11.1
4
+ version: 6.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-11 00:00:00.000000000 Z
11
+ date: 2021-06-15 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: 4.2.11.1
19
+ version: 6.0.4
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: 4.2.11.1
26
+ version: 6.0.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: builder
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -39,87 +39,81 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: '3.1'
41
41
  - !ruby/object:Gem::Dependency
42
- name: erubis
42
+ name: erubi
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 2.7.0
47
+ version: '1.4'
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: 2.7.0
54
+ version: '1.4'
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.0'
61
+ version: '1.1'
62
62
  - - ">="
63
63
  - !ruby/object:Gem::Version
64
- version: 1.0.3
64
+ version: 1.2.0
65
65
  type: :runtime
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
68
68
  requirements:
69
69
  - - "~>"
70
70
  - !ruby/object:Gem::Version
71
- version: '1.0'
71
+ version: '1.1'
72
72
  - - ">="
73
73
  - !ruby/object:Gem::Version
74
- version: 1.0.3
74
+ version: 1.2.0
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: rails-dom-testing
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: '1.0'
82
- - - ">="
83
- - !ruby/object:Gem::Version
84
- version: 1.0.5
81
+ version: '2.0'
85
82
  type: :runtime
86
83
  prerelease: false
87
84
  version_requirements: !ruby/object:Gem::Requirement
88
85
  requirements:
89
86
  - - "~>"
90
87
  - !ruby/object:Gem::Version
91
- version: '1.0'
92
- - - ">="
93
- - !ruby/object:Gem::Version
94
- version: 1.0.5
88
+ version: '2.0'
95
89
  - !ruby/object:Gem::Dependency
96
90
  name: actionpack
97
91
  requirement: !ruby/object:Gem::Requirement
98
92
  requirements:
99
93
  - - '='
100
94
  - !ruby/object:Gem::Version
101
- version: 4.2.11.1
95
+ version: 6.0.4
102
96
  type: :development
103
97
  prerelease: false
104
98
  version_requirements: !ruby/object:Gem::Requirement
105
99
  requirements:
106
100
  - - '='
107
101
  - !ruby/object:Gem::Version
108
- version: 4.2.11.1
102
+ version: 6.0.4
109
103
  - !ruby/object:Gem::Dependency
110
104
  name: activemodel
111
105
  requirement: !ruby/object:Gem::Requirement
112
106
  requirements:
113
107
  - - '='
114
108
  - !ruby/object:Gem::Version
115
- version: 4.2.11.1
109
+ version: 6.0.4
116
110
  type: :development
117
111
  prerelease: false
118
112
  version_requirements: !ruby/object:Gem::Requirement
119
113
  requirements:
120
114
  - - '='
121
115
  - !ruby/object:Gem::Version
122
- version: 4.2.11.1
116
+ version: 6.0.4
123
117
  description: Simple, battle-tested conventions and helpers for building web pages.
124
118
  email: david@loudthinking.com
125
119
  executables: []
@@ -132,6 +126,7 @@ files:
132
126
  - lib/action_view.rb
133
127
  - lib/action_view/base.rb
134
128
  - lib/action_view/buffers.rb
129
+ - lib/action_view/cache_expiry.rb
135
130
  - lib/action_view/context.rb
136
131
  - lib/action_view/dependency_tracker.rb
137
132
  - lib/action_view/digestor.rb
@@ -145,6 +140,7 @@ files:
145
140
  - lib/action_view/helpers/cache_helper.rb
146
141
  - lib/action_view/helpers/capture_helper.rb
147
142
  - lib/action_view/helpers/controller_helper.rb
143
+ - lib/action_view/helpers/csp_helper.rb
148
144
  - lib/action_view/helpers/csrf_helper.rb
149
145
  - lib/action_view/helpers/date_helper.rb
150
146
  - lib/action_view/helpers/debug_helper.rb
@@ -154,7 +150,6 @@ files:
154
150
  - lib/action_view/helpers/javascript_helper.rb
155
151
  - lib/action_view/helpers/number_helper.rb
156
152
  - lib/action_view/helpers/output_safety_helper.rb
157
- - lib/action_view/helpers/record_tag_helper.rb
158
153
  - lib/action_view/helpers/rendering_helper.rb
159
154
  - lib/action_view/helpers/sanitize_helper.rb
160
155
  - lib/action_view/helpers/tag_helper.rb
@@ -207,30 +202,44 @@ files:
207
202
  - lib/action_view/record_identifier.rb
208
203
  - lib/action_view/renderer/abstract_renderer.rb
209
204
  - lib/action_view/renderer/partial_renderer.rb
205
+ - lib/action_view/renderer/partial_renderer/collection_caching.rb
210
206
  - lib/action_view/renderer/renderer.rb
211
207
  - lib/action_view/renderer/streaming_template_renderer.rb
212
208
  - lib/action_view/renderer/template_renderer.rb
213
209
  - lib/action_view/rendering.rb
214
210
  - lib/action_view/routing_url_for.rb
215
- - lib/action_view/tasks/dependencies.rake
211
+ - lib/action_view/tasks/cache_digests.rake
216
212
  - lib/action_view/template.rb
217
213
  - lib/action_view/template/error.rb
218
214
  - lib/action_view/template/handlers.rb
219
215
  - lib/action_view/template/handlers/builder.rb
220
216
  - lib/action_view/template/handlers/erb.rb
217
+ - lib/action_view/template/handlers/erb/erubi.rb
218
+ - lib/action_view/template/handlers/html.rb
221
219
  - lib/action_view/template/handlers/raw.rb
222
220
  - lib/action_view/template/html.rb
221
+ - lib/action_view/template/inline.rb
222
+ - lib/action_view/template/raw_file.rb
223
223
  - lib/action_view/template/resolver.rb
224
+ - lib/action_view/template/sources.rb
225
+ - lib/action_view/template/sources/file.rb
224
226
  - lib/action_view/template/text.rb
225
227
  - lib/action_view/template/types.rb
226
228
  - lib/action_view/test_case.rb
227
229
  - lib/action_view/testing/resolvers.rb
230
+ - lib/action_view/unbound_template.rb
228
231
  - lib/action_view/version.rb
229
232
  - lib/action_view/view_paths.rb
230
- homepage: http://www.rubyonrails.org
233
+ - lib/assets/compiled/rails-ujs.js
234
+ homepage: https://rubyonrails.org
231
235
  licenses:
232
236
  - MIT
233
- metadata: {}
237
+ metadata:
238
+ bug_tracker_uri: https://github.com/rails/rails/issues
239
+ changelog_uri: https://github.com/rails/rails/blob/v6.0.4/actionview/CHANGELOG.md
240
+ documentation_uri: https://api.rubyonrails.org/v6.0.4/
241
+ mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
242
+ source_code_uri: https://github.com/rails/rails/tree/v6.0.4/actionview
234
243
  post_install_message:
235
244
  rdoc_options: []
236
245
  require_paths:
@@ -239,7 +248,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
239
248
  requirements:
240
249
  - - ">="
241
250
  - !ruby/object:Gem::Version
242
- version: 1.9.3
251
+ version: 2.5.0
243
252
  required_rubygems_version: !ruby/object:Gem::Requirement
244
253
  requirements:
245
254
  - - ">="
@@ -247,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
247
256
  version: '0'
248
257
  requirements:
249
258
  - none
250
- rubygems_version: 3.0.1
259
+ rubygems_version: 3.1.2
251
260
  signing_key:
252
261
  specification_version: 4
253
262
  summary: Rendering framework putting the V in MVC (part of Rails).
@@ -1,108 +0,0 @@
1
- require 'action_view/record_identifier'
2
-
3
- module ActionView
4
- # = Action View Record Tag Helpers
5
- module Helpers
6
- module RecordTagHelper
7
- include ActionView::RecordIdentifier
8
-
9
- # Produces a wrapper DIV element with id and class parameters that
10
- # relate to the specified Active Record object. Usage example:
11
- #
12
- # <%= div_for(@person, class: "foo") do %>
13
- # <%= @person.name %>
14
- # <% end %>
15
- #
16
- # produces:
17
- #
18
- # <div id="person_123" class="person foo"> Joe Bloggs </div>
19
- #
20
- # You can also pass an array of Active Record objects, which will then
21
- # get iterated over and yield each record as an argument for the block.
22
- # For example:
23
- #
24
- # <%= div_for(@people, class: "foo") do |person| %>
25
- # <%= person.name %>
26
- # <% end %>
27
- #
28
- # produces:
29
- #
30
- # <div id="person_123" class="person foo"> Joe Bloggs </div>
31
- # <div id="person_124" class="person foo"> Jane Bloggs </div>
32
- #
33
- def div_for(record, *args, &block)
34
- content_tag_for(:div, record, *args, &block)
35
- end
36
-
37
- # content_tag_for creates an HTML element with id and class parameters
38
- # that relate to the specified Active Record object. For example:
39
- #
40
- # <%= content_tag_for(:tr, @person) do %>
41
- # <td><%= @person.first_name %></td>
42
- # <td><%= @person.last_name %></td>
43
- # <% end %>
44
- #
45
- # would produce the following HTML (assuming @person is an instance of
46
- # a Person object, with an id value of 123):
47
- #
48
- # <tr id="person_123" class="person">....</tr>
49
- #
50
- # If you require the HTML id attribute to have a prefix, you can specify it:
51
- #
52
- # <%= content_tag_for(:tr, @person, :foo) do %> ...
53
- #
54
- # produces:
55
- #
56
- # <tr id="foo_person_123" class="person">...
57
- #
58
- # You can also pass an array of objects which this method will loop through
59
- # and yield the current object to the supplied block, reducing the need for
60
- # having to iterate through the object (using <tt>each</tt>) beforehand.
61
- # For example (assuming @people is an array of Person objects):
62
- #
63
- # <%= content_tag_for(:tr, @people) do |person| %>
64
- # <td><%= person.first_name %></td>
65
- # <td><%= person.last_name %></td>
66
- # <% end %>
67
- #
68
- # produces:
69
- #
70
- # <tr id="person_123" class="person">...</tr>
71
- # <tr id="person_124" class="person">...</tr>
72
- #
73
- # content_tag_for also accepts a hash of options, which will be converted to
74
- # additional HTML attributes. If you specify a <tt>:class</tt> value, it will be combined
75
- # with the default class name for your object. For example:
76
- #
77
- # <%= content_tag_for(:li, @person, class: "bar") %>...
78
- #
79
- # produces:
80
- #
81
- # <li id="person_123" class="person bar">...
82
- #
83
- def content_tag_for(tag_name, single_or_multiple_records, prefix = nil, options = nil, &block)
84
- options, prefix = prefix, nil if prefix.is_a?(Hash)
85
-
86
- Array(single_or_multiple_records).map do |single_record|
87
- content_tag_for_single_record(tag_name, single_record, prefix, options, &block)
88
- end.join("\n").html_safe
89
- end
90
-
91
- private
92
-
93
- # Called by <tt>content_tag_for</tt> internally to render a content tag
94
- # for each record.
95
- def content_tag_for_single_record(tag_name, record, prefix, options, &block)
96
- options = options ? options.dup : {}
97
- options[:class] = [ dom_class(record, prefix), options[:class] ].compact
98
- options[:id] = dom_id(record, prefix)
99
-
100
- if block_given?
101
- content_tag(tag_name, capture(record, &block), options)
102
- else
103
- content_tag(tag_name, "", options)
104
- end
105
- end
106
- end
107
- end
108
- end
@@ -1,23 +0,0 @@
1
- namespace :cache_digests do
2
- desc 'Lookup nested dependencies for TEMPLATE (like messages/show or comments/_comment.html)'
3
- task :nested_dependencies => :environment do
4
- abort 'You must provide TEMPLATE for the task to run' unless ENV['TEMPLATE'].present?
5
- puts JSON.pretty_generate ActionView::Digestor.new(name: CacheDigests.template_name, finder: CacheDigests.finder).nested_dependencies
6
- end
7
-
8
- desc 'Lookup first-level dependencies for TEMPLATE (like messages/show or comments/_comment.html)'
9
- task :dependencies => :environment do
10
- abort 'You must provide TEMPLATE for the task to run' unless ENV['TEMPLATE'].present?
11
- puts JSON.pretty_generate ActionView::Digestor.new(name: CacheDigests.template_name, finder: CacheDigests.finder).dependencies
12
- end
13
-
14
- class CacheDigests
15
- def self.template_name
16
- ENV['TEMPLATE'].split('.', 2).first
17
- end
18
-
19
- def self.finder
20
- ApplicationController.new.lookup_context
21
- end
22
- end
23
- end