mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
Manage deprecation warnings about keyword argument
This commit is contained in:
parent
9bf9de3d9d
commit
7aa8a78674
2 changed files with 5 additions and 0 deletions
|
@ -1160,6 +1160,7 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
|
|||
|
||||
def capture_warning_warn
|
||||
verbose = $VERBOSE
|
||||
deprecated = Warning[:deprecated]
|
||||
warning = []
|
||||
|
||||
::Warning.class_eval do
|
||||
|
@ -1172,11 +1173,13 @@ $stderr = $stdout; raise "\x82\xa0"') do |outs, errs, status|
|
|||
end
|
||||
|
||||
$VERBOSE = true
|
||||
Warning[:deprecated] = true
|
||||
yield
|
||||
|
||||
return warning
|
||||
ensure
|
||||
$VERBOSE = verbose
|
||||
Warning[:deprecated] = deprecated
|
||||
|
||||
::Warning.class_eval do
|
||||
remove_method :warn
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue