Class: ERB::Processor::ForDirectoryTree

Inherits:
Object
  • Object
show all
Defined in:
lib/erb/processor/for_directory_tree.rb

Overview

Orchestrate the processing of all .erb templates in tree structure

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(paths) ⇒ ForDirectoryTree

Returns a new instance of ForDirectoryTree.



12
13
14
# File 'lib/erb/processor/for_directory_tree.rb', line 12

def initialize(paths)
  @paths = paths
end

Instance Attribute Details

#pathsObject (readonly)

Returns the value of attribute paths.



10
11
12
# File 'lib/erb/processor/for_directory_tree.rb', line 10

def paths
  @paths
end

Instance Method Details

#runObject



16
17
18
19
20
21
22
# File 'lib/erb/processor/for_directory_tree.rb', line 16

def run
  Find.find(*paths) do |path|
    next unless ForSingleFile.template_file?(path)

    ForSingleFile.new(path).run
  end
end