Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

$VERBOSE = false won't be worked since rb_warning is changed to rb_warn #112

Merged
merged 1 commit into from Mar 7, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 6 additions & 12 deletions lib/tzinfo/ruby_core_support.rb
Expand Up @@ -156,21 +156,15 @@ def self.open_file(file_name, mode, opts, &block)
# Object#untaint is a deprecated no-op in Ruby >= 2.7 and will be removed in
# 3.0. Add a refinement to either silence the warning, or supply the method
# if needed.
old_verbose = $VERBOSE
$VERBOSE = false
begin
o = Object.new
if [:taint, :untaint, :tainted?].none? {|m| o.respond_to?(m) } || !o.taint.tainted?
module UntaintExt
refine Object do
def untaint
self
end
o = Object.new
if [:taint, :untaint, :tainted?].none? {|m| o.respond_to?(m) } || RUBY_VERSION >= '2.7'
module UntaintExt
refine Object do
def untaint
self
end
end
end
ensure
$VERBOSE = old_verbose
end
end
end