def sort_dep_tags_by_dep(dep_tags)
      dep_tags_index = {}

      # map tag to index
      dep_tags.each.with_index do |tag_info, k|
        tag = tag_info[:tag]
        dep_tags_index[tag.to_path] = k
      end

      # generate dependency graph
      dep_tags_hash = TSortableHash.new
      dep_tags.each do |tag_info|
        tag = tag_info[:tag].to_path
        dep_ind = dep_tags_index[tag]
        dep_tags_hash[dep_ind] = deps_resolver.dep_to[tag].to_a.map {|tag| dep_tags_index[tag] }.reject(&:nil?)
      end

      dep_tags_hash.tsort.map {|k| dep_tags[k] }
    end
def sort_dep_tags_by_dep(dep_tags)
      dep_tags_index = {}

      # map tag to index
      dep_tags.each.with_index do |tag_info, k|
        tag = tag_info[:tag]
        dep_tags_index[tag.to_path] = k
      end

      # generate dependency graph
      dep_tags_hash = TSortableHash.new
      dep_tags.each do |tag_info|
        tag = tag_info[:tag].to_path
        dep_ind = dep_tags_index[tag]
        dep_tags_hash[dep_ind] = deps_resolver.dep_to[tag].to_a.map {|tag| dep_tags_index[tag] }.reject(&:nil?)
      end

      dep_tags_hash.tsort.map {|k| dep_tags[k] }
    end
Sort by dependency