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

Rewrite IPAddr.new.include? with pure Ruby bit operation #110

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hsbt
Copy link
Member

@hsbt hsbt commented Jul 23, 2024

I want to reduce across stdlib dependencies. I remove IPAddr and rewrite that to rough bit operation.

Copy link
Member

@knu knu left a comment

Choose a reason for hiding this comment

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

I'm not particularly in favor of implementing another IP address parser to maintain.

Leaving aside the maintenance cost, there would be concerns about regression and incompatibility. I think the new implementation has to be tested with all IP address patterns that IPAddr can handle in the test suite, and it also has to reject invalid addresses that IPAddr rejects.

@knu
Copy link
Member

knu commented Jul 28, 2024

it also has to reject invalid addresses that IPAddr rejects.

Maybe this is not a strict requirement because it silently ignores any malformed address and returns false.

@hsbt
Copy link
Member Author

hsbt commented Aug 1, 2024

@knu Thanks, I also agree your comment. I added only simple IPv4 and IPv6 pattern. I keep open this until another idea will be available.

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

Successfully merging this pull request may close these issues.

2 participants