actionview 5.1.7 → 5.2.8.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.

Files changed (109) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +119 -178
  3. data/MIT-LICENSE +1 -1
  4. data/README.rdoc +4 -4
  5. data/lib/action_view/base.rb +8 -10
  6. data/lib/action_view/buffers.rb +2 -0
  7. data/lib/action_view/context.rb +2 -2
  8. data/lib/action_view/dependency_tracker.rb +2 -0
  9. data/lib/action_view/digestor.rb +7 -7
  10. data/lib/action_view/flows.rb +2 -0
  11. data/lib/action_view/gem_version.rb +5 -3
  12. data/lib/action_view/helpers/active_model_helper.rb +9 -3
  13. data/lib/action_view/helpers/asset_tag_helper.rb +180 -34
  14. data/lib/action_view/helpers/asset_url_helper.rb +19 -17
  15. data/lib/action_view/helpers/atom_feed_helper.rb +3 -1
  16. data/lib/action_view/helpers/cache_helper.rb +24 -14
  17. data/lib/action_view/helpers/capture_helper.rb +9 -7
  18. data/lib/action_view/helpers/controller_helper.rb +3 -1
  19. data/lib/action_view/helpers/csp_helper.rb +24 -0
  20. data/lib/action_view/helpers/csrf_helper.rb +4 -2
  21. data/lib/action_view/helpers/date_helper.rb +7 -5
  22. data/lib/action_view/helpers/debug_helper.rb +4 -2
  23. data/lib/action_view/helpers/form_helper.rb +53 -70
  24. data/lib/action_view/helpers/form_options_helper.rb +23 -17
  25. data/lib/action_view/helpers/form_tag_helper.rb +23 -11
  26. data/lib/action_view/helpers/javascript_helper.rb +20 -5
  27. data/lib/action_view/helpers/number_helper.rb +2 -0
  28. data/lib/action_view/helpers/output_safety_helper.rb +2 -0
  29. data/lib/action_view/helpers/record_tag_helper.rb +3 -1
  30. data/lib/action_view/helpers/rendering_helper.rb +3 -1
  31. data/lib/action_view/helpers/sanitize_helper.rb +3 -1
  32. data/lib/action_view/helpers/tag_helper.rb +39 -8
  33. data/lib/action_view/helpers/tags/base.rb +12 -10
  34. data/lib/action_view/helpers/tags/check_box.rb +3 -1
  35. data/lib/action_view/helpers/tags/checkable.rb +4 -2
  36. data/lib/action_view/helpers/tags/collection_check_boxes.rb +2 -0
  37. data/lib/action_view/helpers/tags/collection_helpers.rb +2 -0
  38. data/lib/action_view/helpers/tags/collection_radio_buttons.rb +2 -0
  39. data/lib/action_view/helpers/tags/collection_select.rb +3 -1
  40. data/lib/action_view/helpers/tags/color_field.rb +3 -1
  41. data/lib/action_view/helpers/tags/date_field.rb +2 -0
  42. data/lib/action_view/helpers/tags/date_select.rb +3 -1
  43. data/lib/action_view/helpers/tags/datetime_field.rb +3 -1
  44. data/lib/action_view/helpers/tags/datetime_local_field.rb +2 -0
  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 +3 -1
  49. data/lib/action_view/helpers/tags/hidden_field.rb +2 -0
  50. data/lib/action_view/helpers/tags/label.rb +2 -4
  51. data/lib/action_view/helpers/tags/month_field.rb +2 -0
  52. data/lib/action_view/helpers/tags/number_field.rb +2 -0
  53. data/lib/action_view/helpers/tags/password_field.rb +2 -0
  54. data/lib/action_view/helpers/tags/placeholderable.rb +2 -0
  55. data/lib/action_view/helpers/tags/radio_button.rb +3 -1
  56. data/lib/action_view/helpers/tags/range_field.rb +2 -0
  57. data/lib/action_view/helpers/tags/search_field.rb +2 -0
  58. data/lib/action_view/helpers/tags/select.rb +4 -2
  59. data/lib/action_view/helpers/tags/tel_field.rb +2 -0
  60. data/lib/action_view/helpers/tags/text_area.rb +3 -1
  61. data/lib/action_view/helpers/tags/text_field.rb +3 -1
  62. data/lib/action_view/helpers/tags/time_field.rb +2 -0
  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 +2 -0
  66. data/lib/action_view/helpers/tags/url_field.rb +2 -0
  67. data/lib/action_view/helpers/tags/week_field.rb +2 -0
  68. data/lib/action_view/helpers/tags.rb +3 -1
  69. data/lib/action_view/helpers/text_helper.rb +9 -7
  70. data/lib/action_view/helpers/translation_helper.rb +17 -5
  71. data/lib/action_view/helpers/url_helper.rb +28 -4
  72. data/lib/action_view/helpers.rb +4 -0
  73. data/lib/action_view/layouts.rb +7 -5
  74. data/lib/action_view/log_subscriber.rb +5 -3
  75. data/lib/action_view/lookup_context.rb +4 -4
  76. data/lib/action_view/model_naming.rb +2 -0
  77. data/lib/action_view/path_set.rb +2 -0
  78. data/lib/action_view/railtie.rb +11 -2
  79. data/lib/action_view/record_identifier.rb +2 -0
  80. data/lib/action_view/renderer/abstract_renderer.rb +2 -0
  81. data/lib/action_view/renderer/partial_renderer/collection_caching.rb +4 -2
  82. data/lib/action_view/renderer/partial_renderer.rb +13 -11
  83. data/lib/action_view/renderer/renderer.rb +2 -0
  84. data/lib/action_view/renderer/streaming_template_renderer.rb +5 -1
  85. data/lib/action_view/renderer/template_renderer.rb +2 -0
  86. data/lib/action_view/rendering.rb +3 -5
  87. data/lib/action_view/routing_url_for.rb +2 -0
  88. data/lib/action_view/tasks/cache_digests.rake +2 -0
  89. data/lib/action_view/template/error.rb +2 -3
  90. data/lib/action_view/template/handlers/builder.rb +3 -4
  91. data/lib/action_view/template/handlers/erb/erubi.rb +2 -0
  92. data/lib/action_view/template/handlers/erb.rb +5 -9
  93. data/lib/action_view/template/handlers/html.rb +2 -0
  94. data/lib/action_view/template/handlers/raw.rb +2 -0
  95. data/lib/action_view/template/handlers.rb +3 -1
  96. data/lib/action_view/template/html.rb +3 -1
  97. data/lib/action_view/template/resolver.rb +7 -6
  98. data/lib/action_view/template/text.rb +3 -1
  99. data/lib/action_view/template/types.rb +3 -1
  100. data/lib/action_view/template.rb +6 -4
  101. data/lib/action_view/test_case.rb +21 -5
  102. data/lib/action_view/testing/resolvers.rb +3 -1
  103. data/lib/action_view/version.rb +2 -0
  104. data/lib/action_view/view_paths.rb +3 -3
  105. data/lib/action_view.rb +4 -3
  106. data/lib/assets/compiled/rails-ujs.js +52 -15
  107. metadata +15 -16
  108. data/lib/action_view/template/handlers/erb/deprecated_erubis.rb +0 -9
  109. data/lib/action_view/template/handlers/erb/erubis.rb +0 -81
@@ -1,81 +0,0 @@
1
- gem "erubis"
2
- require "erubis"
3
-
4
- module ActionView
5
- class Template
6
- module Handlers
7
- class ERB
8
- class Erubis < ::Erubis::Eruby
9
- # :nodoc: all
10
- def add_preamble(src)
11
- @newline_pending = 0
12
- src << "@output_buffer = output_buffer || ActionView::OutputBuffer.new;"
13
- end
14
-
15
- def add_text(src, text)
16
- return if text.empty?
17
-
18
- if text == "\n"
19
- @newline_pending += 1
20
- else
21
- src << "@output_buffer.safe_append='"
22
- src << "\n" * @newline_pending if @newline_pending > 0
23
- src << escape_text(text)
24
- src << "'.freeze;"
25
-
26
- @newline_pending = 0
27
- end
28
- end
29
-
30
- # Erubis toggles <%= and <%== behavior when escaping is enabled.
31
- # We override to always treat <%== as escaped.
32
- def add_expr(src, code, indicator)
33
- case indicator
34
- when "=="
35
- add_expr_escaped(src, code)
36
- else
37
- super
38
- end
39
- end
40
-
41
- BLOCK_EXPR = /\s*((\s+|\))do|\{)(\s*\|[^|]*\|)?\s*\Z/
42
-
43
- def add_expr_literal(src, code)
44
- flush_newline_if_pending(src)
45
- if BLOCK_EXPR.match?(code)
46
- src << "@output_buffer.append= " << code
47
- else
48
- src << "@output_buffer.append=(" << code << ");"
49
- end
50
- end
51
-
52
- def add_expr_escaped(src, code)
53
- flush_newline_if_pending(src)
54
- if BLOCK_EXPR.match?(code)
55
- src << "@output_buffer.safe_expr_append= " << code
56
- else
57
- src << "@output_buffer.safe_expr_append=(" << code << ");"
58
- end
59
- end
60
-
61
- def add_stmt(src, code)
62
- flush_newline_if_pending(src)
63
- super
64
- end
65
-
66
- def add_postamble(src)
67
- flush_newline_if_pending(src)
68
- src << "@output_buffer.to_s"
69
- end
70
-
71
- def flush_newline_if_pending(src)
72
- if @newline_pending > 0
73
- src << "@output_buffer.safe_append='#{"\n" * @newline_pending}'.freeze;"
74
- @newline_pending = 0
75
- end
76
- end
77
- end
78
- end
79
- end
80
- end
81
- end