aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-29 07:11:38 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-29 07:11:38 +0000
commitc02f03609036ba4e815c2ed67fa002492b39dda9 (patch)
tree30eb8348c10be3b5b42616fc722f8d2091773b87
parenta403cd3598932b3349b8ff5a786b8fe4abbc3f91 (diff)
downloadruby-c02f03609036ba4e815c2ed67fa002492b39dda9.tar.gz
Revert "erb.rb: print deprecation warning with warn level 1"
This reverts commit b5569b9ab2ad5e0e4a997df7eb73e97ecbacc9dd. The deprecation is indefinitely postponed. [Bug #15478] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--lib/erb.rb8
-rw-r--r--test/erb/test_erb.rb8
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/erb.rb b/lib/erb.rb
index 74b18bb585..43498cc106 100644
--- a/lib/erb.rb
+++ b/lib/erb.rb
@@ -812,18 +812,18 @@ class ERB
# 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], which should be removed at a version later than 2.7.
+ # 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
+ 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
diff --git a/test/erb/test_erb.rb b/test/erb/test_erb.rb
index 82293ccc86..5342df4ae8 100644
--- a/test/erb/test_erb.rb
+++ b/test/erb/test_erb.rb
@@ -24,7 +24,7 @@ class TestERB < Test::Unit::TestCase
assert_match(/\Atest filename:1\b/, e.backtrace[0])
end
- # [deprecated] This will be removed later than Ruby 2.7
+ # [deprecated] This will be removed later
def test_without_filename_with_safe_level
erb = EnvUtil.suppress_warning do
ERB.new("<% raise ::TestERB::MyError %>", 1)
@@ -35,7 +35,7 @@ class TestERB < Test::Unit::TestCase
assert_match(/\A\(erb\):1\b/, e.backtrace[0])
end
- # [deprecated] This will be removed later than Ruby 2.7
+ # [deprecated] This will be removed later
def test_with_filename_and_safe_level
erb = EnvUtil.suppress_warning do
ERB.new("<% raise ::TestERB::MyError %>", 1)
@@ -98,7 +98,7 @@ class TestERBCore < Test::Unit::TestCase
end
def test_core
- # [deprecated] Fix initializer later than Ruby 2.7
+ # [deprecated] Fix initializer later
EnvUtil.suppress_warning do
_test_core(nil)
_test_core(0)
@@ -661,7 +661,7 @@ EOS
end
end
- # These interfaces will be removed later than Ruby 2.7.
+ # [deprecated] These interfaces will be removed later
def test_deprecated_interface_warnings
[nil, 0, 1, 2].each do |safe|
assert_warning(/2nd argument of ERB.new is deprecated/) do