diff options
-rw-r--r-- | NEWS | 6 | ||||
-rw-r--r-- | lib/erb.rb | 6 |
2 files changed, 7 insertions, 5 deletions
@@ -97,8 +97,10 @@ with all sufficient information, see the ChangeLog file or Redmine * ERB - * 2nd, 3rd and 4th arguments of ERB.new are deprecated. 2nd argument (safe_level) will be dropped in the future - and some of those arguments (trim_mode, eoutvar) are changed to keyword arguments. [Feature #14256] + * Add :trim_mode and :eoutvar keyword arguments to ERB.new. Now non-keyword arguments other than first one + are softly deprecated and will be removed when Ruby 2.5 becomes EOL. + + * erb command's -S option is deprecated, which will be removed in the next version. * Matrix diff --git a/lib/erb.rb b/lib/erb.rb index 2247838ded..c9b987dfb7 100644 --- a/lib/erb.rb +++ b/lib/erb.rb @@ -805,16 +805,16 @@ class ERB 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, which should be removed at Ruby 2.7. 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 + 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 if $VERBOSE else safe_level = nil 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 + 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 if $VERBOSE 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 + warn 'Passing eoutvar with the 4th argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, eoutvar: ...) instead.', uplevel: 1 if $VERBOSE eoutvar = legacy_eoutvar end |