Actually, let's turn this into cidr notation and just iterate through the network, looking for a free IP.

The enumerate method in http://netaddr.rubyforge.org/classes/NetAddr/CIDR.html will work