actionview 5.1.4 → 6.1.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.
- checksums.yaml +5 -5
- data/CHANGELOG.md +199 -168
- data/MIT-LICENSE +1 -1
- data/README.rdoc +7 -5
- data/lib/action_view.rb +10 -4
- data/lib/action_view/base.rb +87 -23
- data/lib/action_view/buffers.rb +17 -0
- data/lib/action_view/cache_expiry.rb +52 -0
- data/lib/action_view/context.rb +7 -11
- data/lib/action_view/dependency_tracker.rb +12 -4
- data/lib/action_view/digestor.rb +24 -23
- data/lib/action_view/flows.rb +2 -1
- data/lib/action_view/gem_version.rb +4 -2
- data/lib/action_view/helpers.rb +4 -2
- data/lib/action_view/helpers/active_model_helper.rb +9 -4
- data/lib/action_view/helpers/asset_tag_helper.rb +220 -57
- data/lib/action_view/helpers/asset_url_helper.rb +28 -23
- data/lib/action_view/helpers/atom_feed_helper.rb +5 -2
- data/lib/action_view/helpers/cache_helper.rb +39 -28
- data/lib/action_view/helpers/capture_helper.rb +13 -7
- data/lib/action_view/helpers/controller_helper.rb +3 -1
- data/lib/action_view/helpers/csp_helper.rb +26 -0
- data/lib/action_view/helpers/csrf_helper.rb +5 -3
- data/lib/action_view/helpers/date_helper.rb +78 -33
- data/lib/action_view/helpers/debug_helper.rb +4 -2
- data/lib/action_view/helpers/form_helper.rb +357 -106
- data/lib/action_view/helpers/form_options_helper.rb +45 -39
- data/lib/action_view/helpers/form_tag_helper.rb +42 -27
- data/lib/action_view/helpers/javascript_helper.rb +28 -12
- data/lib/action_view/helpers/number_helper.rb +16 -8
- data/lib/action_view/helpers/output_safety_helper.rb +3 -1
- data/lib/action_view/helpers/rendering_helper.rb +20 -9
- data/lib/action_view/helpers/sanitize_helper.rb +15 -19
- data/lib/action_view/helpers/tag_helper.rb +100 -24
- data/lib/action_view/helpers/tags.rb +3 -1
- data/lib/action_view/helpers/tags/base.rb +30 -21
- data/lib/action_view/helpers/tags/check_box.rb +3 -2
- data/lib/action_view/helpers/tags/checkable.rb +4 -2
- data/lib/action_view/helpers/tags/collection_check_boxes.rb +2 -1
- data/lib/action_view/helpers/tags/collection_helpers.rb +2 -1
- data/lib/action_view/helpers/tags/collection_radio_buttons.rb +2 -1
- data/lib/action_view/helpers/tags/collection_select.rb +3 -1
- data/lib/action_view/helpers/tags/color_field.rb +4 -3
- data/lib/action_view/helpers/tags/date_field.rb +3 -2
- data/lib/action_view/helpers/tags/date_select.rb +5 -4
- data/lib/action_view/helpers/tags/datetime_field.rb +3 -2
- data/lib/action_view/helpers/tags/datetime_local_field.rb +3 -2
- data/lib/action_view/helpers/tags/datetime_select.rb +2 -0
- data/lib/action_view/helpers/tags/email_field.rb +2 -0
- data/lib/action_view/helpers/tags/file_field.rb +2 -0
- data/lib/action_view/helpers/tags/grouped_collection_select.rb +3 -1
- data/lib/action_view/helpers/tags/hidden_field.rb +2 -0
- data/lib/action_view/helpers/tags/label.rb +6 -5
- data/lib/action_view/helpers/tags/month_field.rb +3 -2
- data/lib/action_view/helpers/tags/number_field.rb +2 -0
- data/lib/action_view/helpers/tags/password_field.rb +2 -0
- data/lib/action_view/helpers/tags/placeholderable.rb +2 -0
- data/lib/action_view/helpers/tags/radio_button.rb +3 -2
- data/lib/action_view/helpers/tags/range_field.rb +2 -0
- data/lib/action_view/helpers/tags/search_field.rb +2 -0
- data/lib/action_view/helpers/tags/select.rb +4 -3
- data/lib/action_view/helpers/tags/tel_field.rb +2 -0
- data/lib/action_view/helpers/tags/text_area.rb +3 -1
- data/lib/action_view/helpers/tags/text_field.rb +3 -2
- data/lib/action_view/helpers/tags/time_field.rb +3 -2
- data/lib/action_view/helpers/tags/time_select.rb +2 -0
- data/lib/action_view/helpers/tags/time_zone_select.rb +3 -1
- data/lib/action_view/helpers/tags/translator.rb +3 -6
- data/lib/action_view/helpers/tags/url_field.rb +2 -0
- data/lib/action_view/helpers/tags/week_field.rb +3 -2
- data/lib/action_view/helpers/text_helper.rb +11 -10
- data/lib/action_view/helpers/translation_helper.rb +102 -52
- data/lib/action_view/helpers/url_helper.rb +150 -32
- data/lib/action_view/layouts.rb +15 -15
- data/lib/action_view/log_subscriber.rb +32 -15
- data/lib/action_view/lookup_context.rb +67 -39
- data/lib/action_view/model_naming.rb +2 -0
- data/lib/action_view/path_set.rb +5 -12
- data/lib/action_view/railtie.rb +46 -21
- data/lib/action_view/record_identifier.rb +4 -3
- data/lib/action_view/renderer/abstract_renderer.rb +144 -11
- data/lib/action_view/renderer/collection_renderer.rb +196 -0
- data/lib/action_view/renderer/object_renderer.rb +34 -0
- data/lib/action_view/renderer/partial_renderer.rb +33 -283
- data/lib/action_view/renderer/partial_renderer/collection_caching.rb +64 -17
- data/lib/action_view/renderer/renderer.rb +61 -4
- data/lib/action_view/renderer/streaming_template_renderer.rb +14 -8
- data/lib/action_view/renderer/template_renderer.rb +36 -26
- data/lib/action_view/rendering.rb +57 -38
- data/lib/action_view/routing_url_for.rb +15 -12
- data/lib/action_view/tasks/cache_digests.rake +2 -0
- data/lib/action_view/template.rb +69 -76
- data/lib/action_view/template/error.rb +32 -18
- data/lib/action_view/template/handlers.rb +4 -2
- data/lib/action_view/template/handlers/builder.rb +5 -6
- data/lib/action_view/template/handlers/erb.rb +20 -19
- data/lib/action_view/template/handlers/erb/erubi.rb +17 -9
- data/lib/action_view/template/handlers/html.rb +3 -1
- data/lib/action_view/template/handlers/raw.rb +4 -2
- data/lib/action_view/template/html.rb +8 -7
- data/lib/action_view/template/inline.rb +22 -0
- data/lib/action_view/template/raw_file.rb +25 -0
- data/lib/action_view/template/renderable.rb +24 -0
- data/lib/action_view/template/resolver.rb +194 -152
- data/lib/action_view/template/sources.rb +13 -0
- data/lib/action_view/template/sources/file.rb +17 -0
- data/lib/action_view/template/text.rb +5 -4
- data/lib/action_view/template/types.rb +3 -1
- data/lib/action_view/test_case.rb +38 -30
- data/lib/action_view/testing/resolvers.rb +20 -27
- data/lib/action_view/unbound_template.rb +31 -0
- data/lib/action_view/version.rb +2 -0
- data/lib/action_view/view_paths.rb +61 -40
- data/lib/assets/compiled/rails-ujs.js +84 -23
- metadata +34 -23
- data/lib/action_view/helpers/record_tag_helper.rb +0 -21
- data/lib/action_view/template/handlers/erb/deprecated_erubis.rb +0 -9
- data/lib/action_view/template/handlers/erb/erubis.rb +0 -81
@@ -1,21 +0,0 @@
|
|
1
|
-
module ActionView
|
2
|
-
module Helpers
|
3
|
-
module RecordTagHelper
|
4
|
-
def div_for(*) # :nodoc:
|
5
|
-
raise NoMethodError, "The `div_for` method has been removed from " \
|
6
|
-
"Rails. To continue using it, add the `record_tag_helper` gem to " \
|
7
|
-
"your Gemfile:\n" \
|
8
|
-
" gem 'record_tag_helper', '~> 1.0'\n" \
|
9
|
-
"Consult the Rails upgrade guide for details."
|
10
|
-
end
|
11
|
-
|
12
|
-
def content_tag_for(*) # :nodoc:
|
13
|
-
raise NoMethodError, "The `content_tag_for` method has been removed from " \
|
14
|
-
"Rails. To continue using it, add the `record_tag_helper` gem to " \
|
15
|
-
"your Gemfile:\n" \
|
16
|
-
" gem 'record_tag_helper', '~> 1.0'\n" \
|
17
|
-
"Consult the Rails upgrade guide for details."
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -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
|