Method: Jsus::Util::PostProcessor.process

Defined in:
lib/jsus/util/post_processor.rb

.process(source_files, processors) ⇒ Array

Accepts a collection of source files and list of processors and applies these processors to the sources.

Parameters:

  • source files

  • array with names of processors Available postprocs: "mooltie8", "moocompat12"

Returns:

  • processed sources



17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/jsus/util/post_processor.rb', line 17

def self.process(source_files, processors)
  Array(processors).each do |processor|
    source_files = case processor.strip
    when /moocompat12/i
      Moocompat12.new(source_files).process
    when /mooltie8/i
      MooltIE8.new(source_files).process
    when /semicolon/i
      Semicolon.new(source_files).process
    else
      Jsus.logger.error "Unknown post-processor: #{processor}"
      source_files
    end
  end
  source_files
end