Skip to content

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

Open
hsbt wants to merge 2 commits into
masterfrom
remove-ipaddr
Open

Rewrite IPAddr.new.include? with pure Ruby bit operation#110
hsbt wants to merge 2 commits into
masterfrom
remove-ipaddr

Conversation

@hsbt

@hsbt hsbt commented Jul 23, 2024

Copy link
Copy Markdown
Member

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

@knu knu left a comment

Copy link
Copy Markdown
Member

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

knu commented Jul 28, 2024

Copy link
Copy Markdown
Member

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

hsbt commented Aug 1, 2024

Copy link
Copy Markdown
Member Author

@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants