ipaddr
ipaddr copied to clipboard
==: Fix comparing '0.0.0.0'/'::' to nil
It fixes comparing '0.0.0.0'/'::' to nil for == method.
IPAddr.new("0.0.0.0") == nil
and nil == IPAddr.new("0.0.0.0")
will return same result of false
.
# IPv4
IPAddr.new("0.0.0.0") == nil
=> false
nil == IPAddr.new('0.0.0.0')
=> false
IPAddr.new("0.0.0.0").nil?
=> false
# IPv6
IPAddr.new("::") == nil
=> false
nil == IPAddr.new("::")
=> false
IPAddr.new("::").nil?
=> false
Fix #75