From: Luke Rodgers <lukeasrodgers@gmail.com>
Date: Sun, 26 May 2019 21:45:45 -0400
Subject: [PATCH] Rescue IPAddr::InvalidAddressError
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

As of ruby 2.6 the error raise here includes a string with the offending
IP in it, which causes the matching to fail. We could just ditch string
matching altogether except for 1.9.3 support, which raises a generic
ArugmentError.

Acked-By: Cédric Boutillier <boutil@debian.org>
Origin: https://github.com/voxpupuli/json-schema/pull/437/commits/4ed4025e418ced4c207580b855d173ee3c99509c.patch
Forwarded: https://github.com/voxpupuli/json-schema/pull/437
Bug: https://github.com/voxpupuli/json-schema/issues/430
Bug-Debian: https://bugs.debian.org/952019
---
 lib/json-schema/attributes/formats/ip.rb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/json-schema/attributes/formats/ip.rb b/lib/json-schema/attributes/formats/ip.rb
index 04b2e3a..f0c787c 100644
--- a/lib/json-schema/attributes/formats/ip.rb
+++ b/lib/json-schema/attributes/formats/ip.rb
@@ -10,6 +10,7 @@ module JSON
 
         begin
           ip = IPAddr.new(data)
+        rescue IPAddr::InvalidAddressError
         rescue ArgumentError => e
           raise e unless e.message == 'invalid address'
         end
