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

Fix exception attribute outputs undefined method '=~' for false when Net::Ping::External#ping6 succeeds #39

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

taketo1113
Copy link

This Pull Request fixes an issue where an undefined method '=~' for false error is output to the exception attribute when Net::Ping::External#ping6 succeeds.

Steps to reproduce

  • ruby: 3.4.1
  • net-ping: 2.0.8
  • OS: CentOS Stream 9
require 'net/ping'

pe = Net::Ping::External.new("2001:4860:4860::8888") # dns.google
pe.ping6
=> true

pe.exception
=> "undefined method '=~' for false"

Expected behavior

When Net::Ping::External#ping6 succeeds, the exception attribute should be nil, similar to how it behaves with Net::Ping::External#ping.

# ping6
pe = Net::Ping::External.new("2001:4860:4860::8888") # dns.google
pe.ping6
=> true

pe.exception
=> nil


# ping
pe4 = Net::Ping::External.new("8.8.8.8") # dns.google
pe4.ping
=> true

pe4.exception
=> nil

Actual behavior

When Net::Ping::External#ping6 succeeds, the exception attribute is not nil and instead has the value undefined method '=~' for false.

# ping6
pe = Net::Ping::External.new("2001:4860:4860::8888") # dns.google
pe.ping6
=> true

pe.exception
=> "undefined method '=~' for false"


# ping
pe4 = Net::Ping::External.new("8.8.8.8") # dns.google
pe4.ping
=> true

pe4.exception
=> nil

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant