Class: Tocer::Runner

Inherits:
Object
  • Object
show all
Defined in:
lib/tocer/runner.rb

Overview

Generates/updates Table of Contents for files in root path.

Instance Method Summary collapse

Constructor Details

#initialize(writer: Writer.new) ⇒ Runner

Returns a new instance of Runner.



12
13
14
15
# File 'lib/tocer/runner.rb', line 12

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

Instance Method Details

#call(configuration) ⇒ Object

:reek:FeatureEnvy



18
19
20
21
22
23
24
25
# File 'lib/tocer/runner.rb', line 18

def call configuration
  configuration.root_dir
               .files(%({#{configuration.patterns.join ","}}))
               .each do |path|
                 kernel.puts "  #{path}"
                 writer.call path, label: configuration.label
               end
end