actionview 7.1.4 → 7.2.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1e499333fb2ea016310a5740e8eb185601d196aab1df2123fe53943a9be2b995
4
- data.tar.gz: e403e031c7c4c8e2f5ad7a34ba96f7c4ec7dc47a8517431a845b9796f808a23d
3
+ metadata.gz: e667c2e3d2154547c2f51d406d07515af42cc9074e21e8179fdab642126821e4
4
+ data.tar.gz: 26339190cf4ab15b06913451c1ea6a750d5399ba4f7963cdc55b7f59db818ada
5
5
  SHA512:
6
- metadata.gz: c26f521ba261d70f54f246ee7484a28ce3d94824efc7c9e58114fc2edcd71a1b278b0ac5704fe3c3a465c6077eabd35e10963d950dc064ddab98aaef4968b182
7
- data.tar.gz: 36070331e026d4f6e5850dbdea75ec8303dbff52eafaef46cbd00e58cd3902fa39bb961b4425963f4a178d00ac0c094ce73fa1458fee96c85a653800a748f23b
6
+ metadata.gz: b7e494e368f95c7b398f30d88d15bcc9a6aa3cc033cd339c432447959ebf7cff2090c11bece1360303414228100a1a72a29c95aa7044ccd6861547693785f711
7
+ data.tar.gz: 732c61233f0a1c25291232981ef399afca94c0ebff7a8215b1f810696e24e8a72fa49afc2c65ce1bac92967bff1fe2aa4802c8c2bbd9cfaefd0cc8fbc8798210
data/CHANGELOG.md CHANGED
@@ -1,68 +1,54 @@
1
- ## Rails 7.1.4 (August 22, 2024) ##
1
+ ## Rails 7.2.0.beta1 (May 29, 2024) ##
2
2
 
3
- * Action View Test Case `rendered` memoization.
3
+ * Add queries count to template rendering instrumentation.
4
4
 
5
- *Sean Doyle*
6
-
7
- * Restore the ability for templates to return any kind of object and not just strings
8
-
9
- *Jean Boussier*
10
-
11
- * Fix threading issue with strict locals.
12
-
13
- *Robert Fletcher*
14
-
15
-
16
- ## Rails 7.1.3.4 (June 04, 2024) ##
17
-
18
- * No changes.
19
-
20
-
21
- ## Rails 7.1.3.3 (May 16, 2024) ##
22
-
23
- * No changes.
24
-
25
-
26
- ## Rails 7.1.3.2 (February 21, 2024) ##
27
-
28
- * No changes.
5
+ ```
6
+ # Before
7
+ Completed 200 OK in 3804ms (Views: 41.0ms | ActiveRecord: 33.5ms | Allocations: 112788)
29
8
 
9
+ # After
10
+ Completed 200 OK in 3804ms (Views: 41.0ms | ActiveRecord: 33.5ms (2 queries, 1 cached) | Allocations: 112788)
11
+ ```
30
12
 
31
- ## Rails 7.1.3.1 (February 21, 2024) ##
13
+ *fatkodima*
32
14
 
33
- * No changes.
15
+ * Raise `ArgumentError` if `:renderable` object does not respond to `#render_in`.
34
16
 
17
+ *Sean Doyle*
35
18
 
36
- ## Rails 7.1.3 (January 16, 2024) ##
19
+ * Add the `nonce: true` option for `stylesheet_link_tag` helper to support automatic nonce generation for Content Security Policy.
37
20
 
38
- * Better handle SyntaxError in Action View.
21
+ Works the same way as `javascript_include_tag nonce: true` does.
39
22
 
40
- *Mario Caropreso*
23
+ *Akhil G Krishnan*, *AJ Esler*
41
24
 
42
- * Fix `word_wrap` with empty string.
25
+ * Parse `ActionView::TestCase#rendered` HTML content as `Nokogiri::XML::DocumentFragment` instead of `Nokogiri::XML::Document`.
43
26
 
44
- *Jonathan Hefner*
27
+ *Sean Doyle*
45
28
 
46
29
  * Rename `ActionView::TestCase::Behavior::Content` to `ActionView::TestCase::Behavior::RenderedViewContent`.
47
30
 
48
- Make `RenderedViewContent` inherit from `String`. Make private API with `:nodoc:`.
31
+ Make `RenderedViewContent` inherit from `String`. Make private API with `:nodoc:`
49
32
 
50
33
  *Sean Doyle*
51
34
 
52
- * Fix detection of required strict locals.
35
+ * Deprecate passing `nil` as value for the `model:` argument to the `form_with` method.
53
36
 
54
- Further fix `render @collection` compatibility with strict locals
37
+ *Collin Jilbert*
55
38
 
56
- *Jean Boussier*
39
+ * Alias `field_set_tag` helper to `fieldset_tag` to match `<fieldset>` element.
40
+
41
+ *Sean Doyle*
57
42
 
43
+ * Deprecate passing content to void elements when using `tag.br` type tag builders.
58
44
 
59
- ## Rails 7.1.2 (November 10, 2023) ##
45
+ *Hartley McGuire*
60
46
 
61
47
  * Fix the `number_to_human_size` view helper to correctly work with negative numbers.
62
48
 
63
49
  *Earlopain*
64
50
 
65
- * Automatically discard the implicit locals injected by collection rendering for template that can't accept them
51
+ * Automatically discard the implicit locals injected by collection rendering for template that can't accept them.
66
52
 
67
53
  When rendering a collection, two implicit variables are injected, which breaks templates with strict locals.
68
54
 
@@ -70,20 +56,17 @@
70
56
 
71
57
  *Yasha Krasnou*, *Jean Boussier*
72
58
 
73
- * Fix `@rails/ujs` calling `start()` an extra time when using bundlers
59
+ * Fix `@rails/ujs` calling `start()` an extra time when using bundlers.
74
60
 
75
61
  *Hartley McGuire*, *Ryunosuke Sato*
76
62
 
77
- * Fix the `capture` view helper compatibility with HAML and Slim
63
+ * Fix the `capture` view helper compatibility with HAML and Slim.
78
64
 
79
65
  When a blank string was captured in HAML or Slim (and possibly other template engines)
80
66
  it would instead return the entire buffer.
81
67
 
82
68
  *Jean Boussier*
83
69
 
84
-
85
- ## Rails 7.1.1 (October 11, 2023) ##
86
-
87
70
  * Updated `@rails/ujs` files to ignore certain data-* attributes when element is contenteditable.
88
71
 
89
72
  This fix was already landed in >= 7.0.4.3, < 7.1.0.
@@ -91,406 +74,28 @@
91
74
 
92
75
  *Ryunosuke Sato*
93
76
 
77
+ * Added validation for HTML tag names in the `tag` and `content_tag` helper method.
94
78
 
95
- ## Rails 7.1.0 (October 05, 2023) ##
96
-
97
- * No changes.
98
-
99
-
100
- ## Rails 7.1.0.rc2 (October 01, 2023) ##
101
-
102
- * No changes.
103
-
104
-
105
- ## Rails 7.1.0.rc1 (September 27, 2023) ##
106
-
107
- * Introduce `ActionView::TestCase.register_parser`
108
-
109
- ```ruby
110
- register_parser :rss, -> rendered { RSS::Parser.parse(rendered) }
111
-
112
- test "renders RSS" do
113
- article = Article.create!(title: "Hello, world")
114
-
115
- render formats: :rss, partial: article
116
-
117
- assert_equal "Hello, world", rendered.rss.items.last.title
118
- end
119
- ```
120
-
121
- By default, register parsers for `:html` and `:json`.
122
-
123
- *Sean Doyle*
124
-
125
-
126
- ## Rails 7.1.0.beta1 (September 13, 2023) ##
127
-
128
- * Fix `simple_format` with blank `wrapper_tag` option returns plain html tag
129
-
130
- By default `simple_format` method returns the text wrapped with `<p>`. But if we explicitly specify
131
- the `wrapper_tag: nil` in the options, it returns the text wrapped with `<></>` tag.
132
-
133
- Before:
134
-
135
- ```ruby
136
- simple_format("Hello World", {}, { wrapper_tag: nil })
137
- # <>Hello World</>
138
- ```
139
-
140
- After:
141
-
142
- ```ruby
143
- simple_format("Hello World", {}, { wrapper_tag: nil })
144
- # <p>Hello World</p>
145
- ```
146
-
147
- *Akhil G Krishnan*, *Junichi Ito*
148
-
149
- * Don't double-encode nested `field_id` and `field_name` index values
150
-
151
- Pass `index: @options` as a default keyword argument to `field_id` and
152
- `field_name` view helper methods.
153
-
154
- *Sean Doyle*
155
-
156
- * Allow opting in/out of `Link preload` headers when calling `stylesheet_link_tag` or `javascript_include_tag`
157
-
158
- ```ruby
159
- # will exclude header, even if setting is enabled:
160
- javascript_include_tag("http://example.com/all.js", preload_links_header: false)
161
-
162
- # will include header, even if setting is disabled:
163
- stylesheet_link_tag("http://example.com/all.js", preload_links_header: true)
164
- ```
165
-
166
- *Alex Ghiculescu*
167
-
168
- * Stop generating `Link preload` headers once it has reached 1KB.
169
-
170
- Some proxies have trouble handling large headers, but more importantly preload links
171
- have diminishing returns so it's preferable not to go overboard with them.
172
-
173
- If tighter control is needed, it's recommended to disable automatic generation of preloads
174
- and to generate them manually from the controller or from a middleware.
175
-
176
- *Jean Boussier*
177
-
178
- * `simple_format` helper now handles a `:sanitize_options` - any extra options you want appending to the sanitize.
179
-
180
- Before:
181
- ```ruby
182
- simple_format("<a target=\"_blank\" href=\"http://example.com\">Continue</a>")
183
- # => "<p><a href=\"http://example.com\">Continue</a></p>"
184
- ```
185
-
186
- After:
187
- ```ruby
188
- simple_format("<a target=\"_blank\" href=\"http://example.com\">Continue</a>", {}, { sanitize_options: { attributes: %w[target href] } })
189
- # => "<p><a target=\"_blank\" href=\"http://example.com\">Continue</a></p>"
190
- ```
191
-
192
- *Andrei Andriichuk*
193
-
194
- * Add support for HTML5 standards-compliant sanitizers, and default to `Rails::HTML5::Sanitizer`
195
- in the Rails 7.1 configuration if it is supported.
196
-
197
- Action View's HTML sanitizers can be configured by setting
198
- `config.action_view.sanitizer_vendor`. Supported values are `Rails::HTML4::Sanitizer` or
199
- `Rails::HTML5::Sanitizer`.
200
-
201
- The Rails 7.1 configuration will set this to `Rails::HTML5::Sanitizer` when it is supported, and
202
- fall back to `Rails::HTML4::Sanitizer`. Previous configurations default to
203
- `Rails::HTML4::Sanitizer`.
204
-
205
- *Mike Dalessio*
206
-
207
- * `config.dom_testing_default_html_version` controls the HTML parser used by
208
- `ActionView::TestCase#document_root_element`, which creates the DOM used by the assertions in
209
- Rails::Dom::Testing.
210
-
211
- The Rails 7.1 default configuration opts into the HTML5 parser when it is supported, to better
212
- represent what the DOM would be in a browser user agent. Previously this test helper always used
213
- Nokogiri's HTML4 parser.
214
-
215
- *Mike Dalessio*
216
-
217
- * Add support for the HTML picture tag. It supports passing a String, an Array or a Block.
218
- Supports passing properties directly to the img tag via the `:image` key.
219
- Since the picture tag requires an img tag, the last element you provide will be used for the img tag.
220
- For complete control over the picture tag, a block can be passed, which will populate the contents of the tag accordingly.
221
-
222
- Can be used like this for a single source:
223
- ```erb
224
- <%= picture_tag("picture.webp") %>
225
- ```
226
- which will generate the following:
227
- ```html
228
- <picture>
229
- <img src="/images/picture.webp" />
230
- </picture>
231
- ```
232
-
233
- For multiple sources:
234
- ```erb
235
- <%= picture_tag("picture.webp", "picture.png", :class => "mt-2", :image => { alt: "Image", class: "responsive-img" }) %>
236
- ```
237
- will generate:
238
- ```html
239
- <picture class="mt-2">
240
- <source srcset="/images/picture.webp" />
241
- <source srcset="/images/picture.png" />
242
- <img alt="Image" class="responsive-img" src="/images/picture.png" />
243
- </picture>
244
- ```
245
-
246
- Full control via a block:
247
- ```erb
248
- <%= picture_tag(:class => "my-class") do %>
249
- <%= tag(:source, :srcset => image_path("picture.webp")) %>
250
- <%= tag(:source, :srcset => image_path("picture.png")) %>
251
- <%= image_tag("picture.png", :alt => "Image") %>
252
- <% end %>
253
- ```
254
- will generate:
255
- ```html
256
- <picture class="my-class">
257
- <source srcset="/images/picture.webp" />
258
- <source srcset="/images/picture.png" />
259
- <img alt="Image" src="/images/picture.png" />
260
- </picture>
261
- ```
262
-
263
- *Juan Pablo Balarini*
264
-
265
- * Remove deprecated support to passing instance variables as locals to partials.
266
-
267
- *Rafael Mendonça França*
79
+ The `tag` and `content_tag` method now checks that the provided tag name adheres to the HTML
80
+ specification. If an invalid HTML tag name is provided, the method raises an `ArgumentError`
81
+ with an appropriate error message.
268
82
 
269
- * Remove deprecated constant `ActionView::Path`.
83
+ Examples:
270
84
 
271
- *Rafael Mendonça França*
272
-
273
- * Guard `token_list` calls from escaping HTML too often
274
-
275
- *Sean Doyle*
276
-
277
- * `select` can now be called with a single hash containing options and some HTML options
278
-
279
- Previously this would not work as expected:
280
-
281
- ```erb
282
- <%= select :post, :author, authors, required: true %>
283
- ```
284
-
285
- Instead you needed to do this:
286
-
287
- ```erb
288
- <%= select :post, :author, authors, {}, required: true %>
289
- ```
290
-
291
- Now, either form is accepted, for the following HTML attributes: `required`, `multiple`, `size`.
292
-
293
- *Alex Ghiculescu*
294
-
295
- * Datetime form helpers (`time_field`, `date_field`, `datetime_field`, `week_field`, `month_field`) now accept an instance of Time/Date/DateTime as `:value` option.
296
-
297
- Before:
298
- ```erb
299
- <%= form.datetime_field :written_at, value: Time.current.strftime("%Y-%m-%dT%T") %>
300
- ```
301
-
302
- After:
303
- ```erb
304
- <%= form.datetime_field :written_at, value: Time.current %>
305
- ```
306
-
307
- *Andrey Samsonov*
308
-
309
- * Choices of `select` can optionally contain html attributes as the last element
310
- of the child arrays when using grouped/nested collections
311
-
312
- ```erb
313
- <%= form.select :foo, [["North America", [["United States","US"],["Canada","CA"]], { disabled: "disabled" }]] %>
314
- # => <select><optgroup label="North America" disabled="disabled"><option value="US">United States</option><option value="CA">Canada</option></optgroup></select>
315
- ```
316
-
317
- *Chris Gunther*
318
-
319
- * `check_box_tag` and `radio_button_tag` now accept `checked` as a keyword argument
320
-
321
- This is to make the API more consistent with the `FormHelper` variants. You can now
322
- provide `checked` as a positional or keyword argument:
323
-
324
- ```erb
325
- = check_box_tag "admin", "1", false
326
- = check_box_tag "admin", "1", checked: false
327
-
328
- = radio_button_tag 'favorite_color', 'maroon', false
329
- = radio_button_tag 'favorite_color', 'maroon', checked: false
330
- ```
331
-
332
- *Alex Ghiculescu*
333
-
334
- * Allow passing a class to `dom_id`.
335
- You no longer need to call `new` when passing a class to `dom_id`.
336
- This makes `dom_id` behave like `dom_class` in this regard.
337
- Apart from saving a few keystrokes, it prevents Ruby from needing
338
- to instantiate a whole new object just to generate a string.
339
-
340
- Before:
341
- ```ruby
342
- dom_id(Post) # => NoMethodError: undefined method `to_key' for Post:Class
343
- ```
344
-
345
- After:
346
- ```ruby
347
- dom_id(Post) # => "new_post"
348
- ```
349
-
350
- *Goulven Champenois*
351
-
352
- * Report `:locals` as part of the data returned by ActionView render instrumentation.
353
-
354
- Before:
355
- ```ruby
356
- {
357
- identifier: "/Users/adam/projects/notifications/app/views/posts/index.html.erb",
358
- layout: "layouts/application"
359
- }
360
- ```
361
-
362
- After:
363
85
  ```ruby
364
- {
365
- identifier: "/Users/adam/projects/notifications/app/views/posts/index.html.erb",
366
- layout: "layouts/application",
367
- locals: {foo: "bar"}
368
- }
369
- ```
370
-
371
- *Aaron Gough*
372
-
373
- * Strip `break_sequence` at the end of `word_wrap`.
374
-
375
- This fixes a bug where `word_wrap` didn't properly strip off break sequences that had printable characters.
376
-
377
- For example, compare the outputs of this template:
378
-
379
- ```erb
380
- # <%= word_wrap("11 22\n33 44", line_width: 2, break_sequence: "\n# ") %>
381
- ```
86
+ # Raises ArgumentError: Invalid HTML5 tag name: 12p
87
+ content_tag("12p") # Starting with a number
382
88
 
383
- Before:
89
+ # Raises ArgumentError: Invalid HTML5 tag name: ""
90
+ content_tag("") # Empty tag name
384
91
 
385
- ```
386
- # 11
387
- # 22
388
- #
389
- # 33
390
- # 44
391
- #
392
- ```
393
-
394
- After:
395
-
396
- ```
397
- # 11
398
- # 22
399
- # 33
400
- # 44
401
- ```
402
-
403
- *Max Chernyak*
404
-
405
- * Allow templates to set strict `locals`.
406
-
407
- By default, templates will accept any `locals` as keyword arguments. To define what `locals` a template accepts, add a `locals` magic comment:
408
-
409
- ```erb
410
- <%# locals: (message:) -%>
411
- <%= message %>
412
- ```
413
-
414
- Default values can also be provided:
415
-
416
- ```erb
417
- <%# locals: (message: "Hello, world!") -%>
418
- <%= message %>
419
- ```
420
-
421
- Or `locals` can be disabled entirely:
422
-
423
- ```erb
424
- <%# locals: () %>
425
- ```
426
-
427
- *Joel Hawksley*
428
-
429
- * Add `include_seconds` option for `datetime_local_field`
430
-
431
- This allows to omit seconds part in the input field, by passing `include_seconds: false`
432
-
433
- *Wojciech Wnętrzak*
434
-
435
- * Guard against `ActionView::Helpers::FormTagHelper#field_name` calls with nil
436
- `object_name` arguments. For example:
437
-
438
- ```erb
439
- <%= fields do |f| %>
440
- <%= f.field_name :body %>
441
- <% end %>
442
- ```
92
+ # Raises ArgumentError: Invalid HTML5 tag name: div/
93
+ tag("div/") # Contains a solidus
443
94
 
444
- *Sean Doyle*
445
-
446
- * Strings returned from `strip_tags` are correctly tagged `html_safe?`
447
-
448
- Because these strings contain no HTML elements and the basic entities are escaped, they are safe
449
- to be included as-is as PCDATA in HTML content. Tagging them as html-safe avoids double-escaping
450
- entities when being concatenated to a SafeBuffer during rendering.
451
-
452
- Fixes [rails/rails-html-sanitizer#124](https://github.com/rails/rails-html-sanitizer/issues/124)
453
-
454
- *Mike Dalessio*
455
-
456
- * Move `convert_to_model` call from `form_for` into `form_with`
457
-
458
- Now that `form_for` is implemented in terms of `form_with`, remove the
459
- `convert_to_model` call from `form_for`.
460
-
461
- *Sean Doyle*
462
-
463
- * Fix and add protections for XSS in `ActionView::Helpers` and `ERB::Util`.
464
-
465
- Escape dangerous characters in names of tags and names of attributes in the
466
- tag helpers, following the XML specification. Rename the option
467
- `:escape_attributes` to `:escape`, to simplify by applying the option to the
468
- whole tag.
469
-
470
- *Álvaro Martín Fraguas*
471
-
472
- * Extend audio_tag and video_tag to accept Active Storage attachments.
473
-
474
- Now it's possible to write
475
-
476
- ```ruby
477
- audio_tag(user.audio_file)
478
- video_tag(user.video_file)
479
- ```
480
-
481
- Instead of
482
-
483
- ```ruby
484
- audio_tag(polymorphic_path(user.audio_file))
485
- video_tag(polymorphic_path(user.video_file))
95
+ # Raises ArgumentError: Invalid HTML5 tag name: "image file"
96
+ tag("image file") # Contains a space
486
97
  ```
487
98
 
488
- `image_tag` already supported that, so this follows the same pattern.
489
-
490
- *Matheus Richard*
491
-
492
- * Ensure models passed to `form_for` attempt to call `to_model`.
493
-
494
- *Sean Doyle*
99
+ *Akhil G Krishnan*
495
100
 
496
- Please check [7-0-stable](https://github.com/rails/rails/blob/7-0-stable/actionview/CHANGELOG.md) for previous changes.
101
+ Please check [7-1-stable](https://github.com/rails/rails/blob/7-1-stable/actionview/CHANGELOG.md) for previous changes.
@@ -80,6 +80,23 @@ module ActionView # :nodoc:
80
80
  # This is useful in cases where you aren't sure if the local variable has been assigned. Alternatively, you could also use
81
81
  # <tt>defined? headline</tt> to first check if the variable has been assigned before using it.
82
82
  #
83
+ # By default, templates will accept any <tt>locals</tt> as keyword arguments. To restrict what <tt>locals</tt> a template accepts, add a <tt>locals:</tt> magic comment:
84
+ #
85
+ # <%# locals: (headline:) %>
86
+ #
87
+ # Headline: <%= headline %>
88
+ #
89
+ # In cases where the local variables are optional, declare the keyword argument with a default value:
90
+ #
91
+ # <%# locals: (headline: nil) %>
92
+ #
93
+ # <% unless headline.nil? %>
94
+ # Headline: <%= headline %>
95
+ # <% end %>
96
+ #
97
+ # Read more about strict locals in {Action View Overview}[https://guides.rubyonrails.org/action_view_overview.html#strict-locals]
98
+ # in the guides.
99
+ #
83
100
  # === Template caching
84
101
  #
85
102
  # By default, \Rails will compile each template to a method in order to render it. When you alter a template,
@@ -256,7 +273,8 @@ module ActionView # :nodoc:
256
273
  message.
257
274
  gsub("unknown keyword:", "unknown local:").
258
275
  gsub("missing keyword:", "missing local:").
259
- gsub("no keywords accepted", "no locals accepted")
276
+ gsub("no keywords accepted", "no locals accepted").
277
+ concat(" for #{@current_template.short_identifier}")
260
278
  )
261
279
  end
262
280
  else
@@ -10,16 +10,17 @@ module ActionView
10
10
  @watcher = nil
11
11
  @previous_change = false
12
12
 
13
- rebuild_watcher
14
-
15
13
  ActionView::PathRegistry.file_system_resolver_hooks << method(:rebuild_watcher)
16
14
  end
17
15
 
18
16
  def updated?
17
+ build_watcher unless @watcher
19
18
  @previous_change || @watcher.updated?
20
19
  end
21
20
 
22
21
  def execute
22
+ return unless @watcher
23
+
23
24
  watcher = nil
24
25
  @mutex.synchronize do
25
26
  @previous_change = false
@@ -33,7 +34,7 @@ module ActionView
33
34
  ActionView::LookupContext::DetailsKey.clear
34
35
  end
35
36
 
36
- def rebuild_watcher
37
+ def build_watcher
37
38
  @mutex.synchronize do
38
39
  old_watcher = @watcher
39
40
 
@@ -51,6 +52,11 @@ module ActionView
51
52
  end
52
53
  end
53
54
 
55
+ def rebuild_watcher
56
+ return unless @watcher
57
+ build_watcher
58
+ end
59
+
54
60
  def dirs_to_watch
55
61
  all_view_paths.uniq.sort
56
62
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module ActionView
4
4
  class DependencyTracker # :nodoc:
5
- class RipperTracker # :nodoc:
5
+ class RubyTracker # :nodoc:
6
6
  EXPLICIT_DEPENDENCY = /# Template Dependency: (\S+)/
7
7
 
8
8
  def self.call(name, template, view_paths = nil)
@@ -17,8 +17,9 @@ module ActionView
17
17
  true
18
18
  end
19
19
 
20
- def initialize(name, template, view_paths = nil)
20
+ def initialize(name, template, view_paths = nil, parser_class: RenderParser::Default)
21
21
  @name, @template, @view_paths = name, template, view_paths
22
+ @parser_class = parser_class
22
23
  end
23
24
 
24
25
  private
@@ -29,7 +30,7 @@ module ActionView
29
30
 
30
31
  compiled_source = template.handler.call(template, template.source)
31
32
 
32
- RenderParser.new(@name, compiled_source).render_calls.filter_map do |render_call|
33
+ @parser_class.new(@name, compiled_source).render_calls.filter_map do |render_call|
33
34
  next if render_call.end_with?("/_")
34
35
  render_call.gsub(%r|/_|, "/")
35
36
  end
@@ -9,7 +9,7 @@ module ActionView
9
9
  extend ActiveSupport::Autoload
10
10
 
11
11
  autoload :ERBTracker
12
- autoload :RipperTracker
12
+ autoload :RubyTracker
13
13
 
14
14
  @trackers = Concurrent::Map.new
15
15
 
@@ -8,9 +8,9 @@ module ActionView
8
8
 
9
9
  module VERSION
10
10
  MAJOR = 7
11
- MINOR = 1
12
- TINY = 4
13
- PRE = nil
11
+ MINOR = 2
12
+ TINY = 0
13
+ PRE = "beta1"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
16
16
  end