Class: KuberKit::Preprocessing::DirPreprocessor

Inherits:
Object
  • Object
show all
Defined in:
lib/kuber_kit/preprocessing/dir_preprocessor.rb

Instance Method Summary collapse

Instance Method Details

#compile(shell, source_dir, destination_dir, context_helper: nil) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/kuber_kit/preprocessing/dir_preprocessor.rb', line 7

def compile(shell, source_dir, destination_dir, context_helper: nil)
  shell.recursive_list_files(source_dir).each do |source_file_path|
    relative_path = source_file_path.sub(source_dir, '')
    destination_file_path = File.join(destination_dir, relative_path)

    file_preprocessor.compile(
      shell, source_file_path, 
      destination_path: destination_file_path, 
      context_helper: context_helper
    )
  end
end