Sha256: cacb08b89e7a360fbb1d7643a0138908a43915f0d47f3d1ed36bd6469a7fcfe1

Contents?: true

Size: 705 Bytes

Versions: 12

Compression:

Stored size: 705 Bytes

Contents

# frozen_string_literal: true

require "refinements/pathnames"

module Tocer
  # Generates/updates Table of Contents for files in root path.
  class Runner
    using Refinements::Pathnames

    def initialize writer: Writer.new
      @writer = writer
    end

    def call configuration = Container[:configuration]
      Pathname(configuration.root_dir).files(%({#{configuration.includes.join ","}}))
                                      .each do |path|
                                        yield path if block_given?
                                        writer.call path, label: configuration.label
                                      end
    end

    private

    attr_reader :writer
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
tocer-15.2.0 lib/tocer/runner.rb
tocer-15.1.2 lib/tocer/runner.rb
tocer-15.1.1 lib/tocer/runner.rb
tocer-15.1.0 lib/tocer/runner.rb
tocer-15.0.0 lib/tocer/runner.rb
tocer-14.5.0 lib/tocer/runner.rb
tocer-14.4.0 lib/tocer/runner.rb
tocer-14.3.0 lib/tocer/runner.rb
tocer-14.2.0 lib/tocer/runner.rb
tocer-14.1.0 lib/tocer/runner.rb
tocer-14.0.1 lib/tocer/runner.rb
tocer-14.0.0 lib/tocer/runner.rb