def sort_by_path!
      indices = @positions.map {|a|
        @paths.index(@paths.find {|p| a.position.start_with? p})
      }
      @positions = indices.zip(@positions).sort {|a, b|
        aindex, acb = a
        bindex, bcb = b
        if aindex == bindex
          acb.position <=> bcb.position
        else
          aindex <=> bindex
        end
      }.map {|p| p.last}
    end
def sort_by_path!
      indices = @positions.map {|a|
        @paths.index(@paths.find {|p| a.position.start_with? p})
      }
      @positions = indices.zip(@positions).sort {|a, b|
        aindex, acb = a
        bindex, bcb = b
        if aindex == bindex
          acb.position <=> bcb.position
        else
          aindex <=> bindex
        end
      }.map {|p| p.last}
    end
Reorder @positions so it respects @path.  The comparison rule is
 as follows:
 - for two pairs of cookbooks [a_pos, a_cookbook], [b_pos, b_cookbook]
  - let a_index be the index of the first element of cookbooks_path that is a prefix for a_pos.
  - let b_index be similarly defined on b_pos.
  - if a_index != b_index, sort on a_index and b_index.
  - otherwise lexically sort on a_pos and b_pos.