actionview 5.1.7 → 5.2.0.beta1

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 (107) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +27 -275
  3. data/README.rdoc +1 -1
  4. data/lib/action_view.rb +3 -2
  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 +6 -12
  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.rb +2 -0
  13. data/lib/action_view/helpers/active_model_helper.rb +9 -3
  14. data/lib/action_view/helpers/asset_tag_helper.rb +79 -22
  15. data/lib/action_view/helpers/asset_url_helper.rb +13 -11
  16. data/lib/action_view/helpers/atom_feed_helper.rb +3 -1
  17. data/lib/action_view/helpers/cache_helper.rb +24 -14
  18. data/lib/action_view/helpers/capture_helper.rb +9 -7
  19. data/lib/action_view/helpers/controller_helper.rb +3 -1
  20. data/lib/action_view/helpers/csrf_helper.rb +4 -2
  21. data/lib/action_view/helpers/date_helper.rb +5 -3
  22. data/lib/action_view/helpers/debug_helper.rb +3 -1
  23. data/lib/action_view/helpers/form_helper.rb +43 -60
  24. data/lib/action_view/helpers/form_options_helper.rb +9 -7
  25. data/lib/action_view/helpers/form_tag_helper.rb +20 -11
  26. data/lib/action_view/helpers/javascript_helper.rb +5 -3
  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 +4 -1
  31. data/lib/action_view/helpers/sanitize_helper.rb +3 -1
  32. data/lib/action_view/helpers/tag_helper.rb +2 -2
  33. data/lib/action_view/helpers/tags.rb +3 -1
  34. data/lib/action_view/helpers/tags/base.rb +12 -10
  35. data/lib/action_view/helpers/tags/check_box.rb +3 -1
  36. data/lib/action_view/helpers/tags/checkable.rb +4 -2
  37. data/lib/action_view/helpers/tags/collection_check_boxes.rb +2 -0
  38. data/lib/action_view/helpers/tags/collection_helpers.rb +2 -0
  39. data/lib/action_view/helpers/tags/collection_radio_buttons.rb +2 -0
  40. data/lib/action_view/helpers/tags/collection_select.rb +3 -1
  41. data/lib/action_view/helpers/tags/color_field.rb +3 -1
  42. data/lib/action_view/helpers/tags/date_field.rb +2 -0
  43. data/lib/action_view/helpers/tags/date_select.rb +3 -1
  44. data/lib/action_view/helpers/tags/datetime_field.rb +3 -1
  45. data/lib/action_view/helpers/tags/datetime_local_field.rb +2 -0
  46. data/lib/action_view/helpers/tags/datetime_select.rb +2 -0
  47. data/lib/action_view/helpers/tags/email_field.rb +2 -0
  48. data/lib/action_view/helpers/tags/file_field.rb +2 -0
  49. data/lib/action_view/helpers/tags/grouped_collection_select.rb +3 -1
  50. data/lib/action_view/helpers/tags/hidden_field.rb +2 -0
  51. data/lib/action_view/helpers/tags/label.rb +2 -4
  52. data/lib/action_view/helpers/tags/month_field.rb +2 -0
  53. data/lib/action_view/helpers/tags/number_field.rb +2 -0
  54. data/lib/action_view/helpers/tags/password_field.rb +2 -0
  55. data/lib/action_view/helpers/tags/placeholderable.rb +2 -0
  56. data/lib/action_view/helpers/tags/radio_button.rb +3 -1
  57. data/lib/action_view/helpers/tags/range_field.rb +2 -0
  58. data/lib/action_view/helpers/tags/search_field.rb +2 -0
  59. data/lib/action_view/helpers/tags/select.rb +5 -3
  60. data/lib/action_view/helpers/tags/tel_field.rb +2 -0
  61. data/lib/action_view/helpers/tags/text_area.rb +3 -1
  62. data/lib/action_view/helpers/tags/text_field.rb +3 -1
  63. data/lib/action_view/helpers/tags/time_field.rb +2 -0
  64. data/lib/action_view/helpers/tags/time_select.rb +2 -0
  65. data/lib/action_view/helpers/tags/time_zone_select.rb +3 -1
  66. data/lib/action_view/helpers/tags/translator.rb +2 -0
  67. data/lib/action_view/helpers/tags/url_field.rb +2 -0
  68. data/lib/action_view/helpers/tags/week_field.rb +2 -0
  69. data/lib/action_view/helpers/text_helper.rb +4 -2
  70. data/lib/action_view/helpers/translation_helper.rb +5 -4
  71. data/lib/action_view/helpers/url_helper.rb +24 -5
  72. data/lib/action_view/layouts.rb +7 -5
  73. data/lib/action_view/log_subscriber.rb +5 -3
  74. data/lib/action_view/lookup_context.rb +4 -4
  75. data/lib/action_view/model_naming.rb +2 -0
  76. data/lib/action_view/path_set.rb +2 -0
  77. data/lib/action_view/railtie.rb +11 -2
  78. data/lib/action_view/record_identifier.rb +2 -0
  79. data/lib/action_view/renderer/abstract_renderer.rb +2 -0
  80. data/lib/action_view/renderer/partial_renderer.rb +13 -11
  81. data/lib/action_view/renderer/partial_renderer/collection_caching.rb +4 -2
  82. data/lib/action_view/renderer/renderer.rb +2 -0
  83. data/lib/action_view/renderer/streaming_template_renderer.rb +3 -1
  84. data/lib/action_view/renderer/template_renderer.rb +2 -0
  85. data/lib/action_view/rendering.rb +3 -5
  86. data/lib/action_view/routing_url_for.rb +2 -0
  87. data/lib/action_view/tasks/cache_digests.rake +2 -0
  88. data/lib/action_view/template.rb +6 -4
  89. data/lib/action_view/template/error.rb +2 -3
  90. data/lib/action_view/template/handlers.rb +3 -1
  91. data/lib/action_view/template/handlers/builder.rb +3 -4
  92. data/lib/action_view/template/handlers/erb.rb +5 -9
  93. data/lib/action_view/template/handlers/erb/erubi.rb +2 -0
  94. data/lib/action_view/template/handlers/html.rb +2 -0
  95. data/lib/action_view/template/handlers/raw.rb +2 -0
  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/test_case.rb +21 -5
  101. data/lib/action_view/testing/resolvers.rb +3 -1
  102. data/lib/action_view/version.rb +2 -0
  103. data/lib/action_view/view_paths.rb +3 -3
  104. data/lib/assets/compiled/rails-ujs.js +3 -3
  105. metadata +14 -15
  106. data/lib/action_view/template/handlers/erb/deprecated_erubis.rb +0 -9
  107. data/lib/action_view/template/handlers/erb/erubis.rb +0 -81
@@ -1,9 +0,0 @@
1
- ::ActiveSupport::Deprecation.warn("ActionView::Template::Handlers::Erubis is deprecated and will be removed from Rails 5.2. Switch to ActionView::Template::Handlers::ERB::Erubi instead.")
2
-
3
- module ActionView
4
- class Template
5
- module Handlers
6
- Erubis = ERB::Erubis
7
- end
8
- end
9
- end
@@ -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