Class: LintTrappings::Preprocessor

Inherits:
Object
  • Object
show all
Defined in:
lib/lint_trappings/preprocessor.rb

Overview

Processes a collection of streams with the specified command.

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Preprocessor

Returns a new instance of Preprocessor.



7
8
9
10
11
# File 'lib/lint_trappings/preprocessor.rb', line 7

def initialize(config)
  @config = config
  @command = @config['preprocess_command']
  @preprocess_files = @config['preprocess_files']
end

Instance Method Details

#preprocess_files(files_to_lint) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/lint_trappings/preprocessor.rb', line 13

def preprocess_files(files_to_lint)
  return unless @command

  files_to_lint.each do |file_to_lint|
    preprocess(file_to_lint) if preprocess_file?(file_to_lint.path)
  end
end