IPAddress [1] is a library to manipulate IPv4 and IPv6 addresses. It
has been written as a replacement for IPAddr, trying to fix some of
its bugs, and at the same time extending its functionalities and
offering a more powerful and flexible interface.
Migrating from IPAddr to IPAddress is very easy, as most of the
methods have the same name and same behaviour. Moreover, IPAddress is
around 50% faster than IPAddr, and it's very well documented in each
of its parts. The code is very clear, easy to read, to maintain and to
extend, consisting mostly of one line methods.
I've been in touch with the maintainer of IPAddr, Mr. Akinori MUSHA,
asking him if he would consider IPAddress as a replacement, and he
suggested me to write to -core.
I think IPAddress is mature enough, so here is my proposal. Let me
know what you think.
Best regards,
Marco
The proposal itself is very interesting. So are you proposing to add
IPAddress along with IPAddr, or replacing it? I don't want to have
two separate libraries to do (almost) same thing. We did similar
mistakes in the past. Please no more.
Replacing is OK for me, if we can keep fundamental backward
compatibility, and the current IPAddr maintainer (knu) agrees.
matz.
message "Re: [ruby-core:33748] Proposal: IPAddress in the standard library"
> The proposal itself is very interesting. So are you proposing to add
> IPAddress along with IPAddr, or replacing it?
Replacing it.
I don't think it's a good idea to have duplicated libraries in the stdlib.
> I don't want to have
> two separate libraries to do (almost) same thing. We did similar
> mistakes in the past. Please no more.
Couldn't agree more.
> Replacing is OK for me, if we can keep fundamental backward
> compatibility,
Backward compatibility was a goal since release 0.6, and I think we
did a good job. Users familiar with IPAddr will feel at home with
IPAddress, as most of the methods have same name and behaviour, and
you can pretty much replace "IPAddr.new" with "IPAddress.parse"
everywhere, expecting the same results.
I encourage anyone interested to install the gem and check if they
feel backward compatibility is good enough.
> and the current IPAddr maintainer (knu) agrees.
I'll write him again about that.
Thanks,
Marco