Parse port numbers in Ruby land, add some specs