Sha256: 97aa3f466d70d5c085fb8c2969e8b2ffb114509d9c7ddd4358bc49255eb1513e

Contents?: true

Size: 523 Bytes

Versions: 1

Compression:

Stored size: 523 Bytes

Contents

class Eco::API::UseCases::DefaultCases::TagPaths < Eco::API::Common::Loaders::UseCase
  name "create-tag-paths"
  type :other

  def main(session, options, usecase)
    CSV.open("tag_paths.csv", "w") do |csv|
      csv << ["Tag", "Path"]
      tag_paths.each do |values|
        csv << values
      end
    end
  end

  private

  def tag_paths
    @tag_paths ||= tagtree.tags.reverse.map do |tag|
      [tag, tagtree.path(tag).join("|")]
    end
  end

  def tagtree
    session.tagtree
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
eco-helpers-2.5.10 lib/eco/api/usecases/default_cases/create_tag_paths_case.rb