Sha256: fc54888f0be65a870c3806bbae3f644142fc9d95bb7549bdb185b9a82851d46d

Contents?: true

Size: 682 Bytes

Versions: 7

Compression:

Stored size: 682 Bytes

Contents

# frozen_string_literal: true

require "refinements/pathnames"

module Tocer
  # Generates/updates Table of Contents for files in root path.
  class Runner
    include Import[:kernel]

    using Refinements::Pathnames

    def initialize(writer: Writer.new, **)
      super(**)
      @writer = writer
    end

    # :reek:FeatureEnvy
    def call configuration
      configuration.root_dir
                   .files(%({#{configuration.patterns.join ","}}))
                   .each do |path|
                     kernel.puts "  #{path}"
                     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-16.2.1 lib/tocer/runner.rb
tocer-16.2.0 lib/tocer/runner.rb
tocer-16.1.0 lib/tocer/runner.rb
tocer-16.0.3 lib/tocer/runner.rb
tocer-16.0.2 lib/tocer/runner.rb
tocer-16.0.1 lib/tocer/runner.rb
tocer-16.0.0 lib/tocer/runner.rb