title: NetAddr::Tree take list of CIDR and merge them?
body: <p>I’m using the Ruby NetAddr::Tree class to hold a bunch of CIDR objects, but I need a way to compress the CIDR objects into larger subnets.</p>
  
  <p>I want a way to take IPs like:</p>
  
  <pre><code>12.26.8.0/21
  12.26.16.0/21
  12.26.24.0/21
  12.26.32.0/21
  12.26.40.0/21
  12.27.152.0/21
  </code></pre>
  
  <p>and merge the relevant address ranges in the tree so the output would be like:</p>
  
  <pre><code>12.26.8.0/21
  12.26.16.0/20
  12.26.32.0/20
  12.27.152.0/21
  </code></pre>
  
  <p>I looked through the documentation but can’t find any way to do this. I’m happy to move away from using NEtAddr::Tree if needed, all that’s important is it take a list of IP/netmask strings, merge them and output them line by line.</p>