Skip to content

Commit

Permalink
fix ruby 2.7.0 deprecation warning: deprecated Object#=~ is called on…
Browse files Browse the repository at this point in the history
… FalseClass; it always returns nil
  • Loading branch information
stillhart committed Mar 10, 2020
1 parent c82808c commit 9048779
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/net/ping/external.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def ping(host = @host, count = 1, interval = 1, timeout = @timeout)
bool = true # Success, at least one response.
end

if err & err =~ /warning/i
if err & (err =~ /warning/i)
@warning = err.chomp
end
when 2
Expand Down

1 comment on commit 9048779

@djberg96
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's late and I'm tired, but shouldn't this be if err && err =~ /warning/i?

Please sign in to comment.