diff options
author | V3n3RiX <venerix@koprulu.sector> | 2022-06-29 12:04:12 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2022-06-29 12:04:12 +0100 |
commit | 0f558761aa2dee1017b4751e4017205e015a9560 (patch) | |
tree | 037df795519468a25d9362b4e95cdaeb84eb1cf9 /dev-ruby/sprockets/files/sprockets-3.7.2-erb-deprecation.patch | |
parent | 752d6256e5204b958b0ef7905675a940b5e9172f (diff) |
gentoo resync : 29.12.2022
Diffstat (limited to 'dev-ruby/sprockets/files/sprockets-3.7.2-erb-deprecation.patch')
-rw-r--r-- | dev-ruby/sprockets/files/sprockets-3.7.2-erb-deprecation.patch | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/dev-ruby/sprockets/files/sprockets-3.7.2-erb-deprecation.patch b/dev-ruby/sprockets/files/sprockets-3.7.2-erb-deprecation.patch new file mode 100644 index 000000000000..c433360cae52 --- /dev/null +++ b/dev-ruby/sprockets/files/sprockets-3.7.2-erb-deprecation.patch @@ -0,0 +1,29 @@ +From b4fbdd9dfccabcaf5aa9f6ab7f6cab430cc16999 Mon Sep 17 00:00:00 2001 +From: utilum <oz@utilum.com> +Date: Sun, 24 Jun 2018 10:30:13 +0200 +Subject: [PATCH] backport: Deprecate safe_level of `ERB.new` in Ruby 2.6 + +37a87ba0969d9c08e0e5d05271c7d2e6ba8aa817 +--- + lib/sprockets/erb_processor.rb | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/lib/sprockets/erb_processor.rb b/lib/sprockets/erb_processor.rb +index a14d1c1a8..acbd4ad63 100644 +--- a/lib/sprockets/erb_processor.rb ++++ b/lib/sprockets/erb_processor.rb +@@ -18,7 +18,13 @@ def initialize(&block) + end + + def call(input) +- engine = ::ERB.new(input[:data], nil, '<>') ++ match = ERB.version.match(/\Aerb\.rb \[(?<version>[^ ]+) /) ++ if match && match[:version] >= "2.2.0" # Ruby 2.6+ ++ engine = ::ERB.new(input[:data], trim_mode: '<>') ++ else ++ engine = ::ERB.new(input[:data], nil, '<>') ++ end ++ + context = input[:environment].context_class.new(input) + klass = (class << context; self; end) + klass.class_eval(&@block) if @block |