Sha256: ca1a8007f10d7f12722fae4310cab9b6bfaf5482034418f5124d08f3873daa6c

Contents?: true

Size: 706 Bytes

Versions: 7

Compression:

Stored size: 706 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 = Configuration::Loader.call
      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

7 entries across 7 versions & 1 rubygems

Version Path
tocer-13.3.1 lib/tocer/runner.rb
tocer-13.3.0 lib/tocer/runner.rb
tocer-13.2.0 lib/tocer/runner.rb
tocer-13.1.0 lib/tocer/runner.rb
tocer-13.0.2 lib/tocer/runner.rb
tocer-13.0.1 lib/tocer/runner.rb
tocer-13.0.0 lib/tocer/runner.rb