summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTakashi Kokubun <[email protected]>2022-01-15 13:46:43 -0800
committergit <[email protected]>2022-01-16 06:46:47 +0900
commitd12a08abb5fd1412d59094a953899bbd8a64ac88 (patch)
tree6c13cdfcee1dcbe43692da0751af98d9c4854633 /lib
parent3cfb6fc4797c2840375c693c24802db125075de4 (diff)
[ruby/erb] Remove safe_level and further positional arguments (https://github.com/ruby/erb/pull/7)
[Feature #14256] https://github.com/ruby/erb/commit/5133efa06f
Diffstat (limited to 'lib')
-rw-r--r--lib/erb.rb15
1 files changed, 1 insertions, 14 deletions
diff --git a/lib/erb.rb b/lib/erb.rb
index 0e42425a60..54216330da 100644
--- a/lib/erb.rb
+++ b/lib/erb.rb
@@ -808,20 +808,7 @@ class ERB
# Chicken Fried Steak -- 9.95
# A well messages pattie, breaded and fried.
#
- def initialize(str, safe_level=NOT_GIVEN, legacy_trim_mode=NOT_GIVEN, legacy_eoutvar=NOT_GIVEN, trim_mode: nil, eoutvar: '_erbout')
- # Complex initializer for $SAFE deprecation at [Feature #14256]. Use keyword arguments to pass trim_mode or eoutvar.
- if safe_level != NOT_GIVEN
- warn 'Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments.', uplevel: 1
- end
- if legacy_trim_mode != NOT_GIVEN
- warn 'Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: ...) instead.', uplevel: 1
- trim_mode = legacy_trim_mode
- end
- if legacy_eoutvar != NOT_GIVEN
- warn 'Passing eoutvar with the 4th argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, eoutvar: ...) instead.', uplevel: 1
- eoutvar = legacy_eoutvar
- end
-
+ def initialize(str, trim_mode: nil, eoutvar: '_erbout')
compiler = make_compiler(trim_mode)
set_eoutvar(compiler, eoutvar)
@src, @encoding, @frozen_string = *compiler.compile(str)