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

Ruby 2.6 support #437

Closed

Conversation

lukeasrodgers
Copy link
Contributor

Addresses an IPAddr validation error issue with ruby 2.6.
Fixes #430

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.
@@ -10,6 +10,7 @@ def self.validate(current_schema, data, fragments, processor, validator, options

begin
ip = IPAddr.new(data)
rescue IPAddr::InvalidAddressError
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I considered adding a comment here, since it is confusing, but left explanation in the commit message instead. Happy to add an explicit comment if preferable.

These rubies do not have `IPAddr::InvalidAddressError` defined.
@bastelfreak
Copy link
Member

Hey people, could we get this merged and released? It's also breaking the tests on Ruby 2.7

@boutil
Copy link

boutil commented Feb 28, 2020

Hi!
I confirm that the patch fixes #430. It is applied in Debian to solve the same bug
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=952019
discovered during the transition from ruby2.5 to ruby2.7.

@pboling
Copy link

pboling commented Feb 14, 2021

#423 (comment)

@ghoneycutt
Copy link
Member

Thank you for your contribution. This functionality has been added with PR #457

@ghoneycutt ghoneycutt closed this Feb 16, 2022
@lukeasrodgers lukeasrodgers deleted the ruby-2.6-support branch February 16, 2022 19:37
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.

Ruby 2.6.1: fully_validate throws exception anyway
5 participants