A Ruby library for performing calculations on IPv4 and IPv6 subnets. There is also limited support for EUI addresses.
The original netaddr used for a custom IPAM system that was built for a large cloud provider.
A complete rewrite and totally incompatible with 1.x.
To run unit tests, execute the following from the top level directory
ruby test/run_all.rb
To build the gem, execute the following from the top level directory
gem build netaddr.gemspec
Example code may be found in test/example.rb. This example code runs as part of the unit tests.
I use the following conventions:
- I use tabs for indention since tabs make it really easy to adjust indention widths on the fly.
- I do not follow rigid limits on line lengths. My editor auto-wraps so I add a line break where it feels appropriate.
- I'm not a fan of obfuscation. I prefer clear code over fancy code.