Module: Jsus::Util::PostProcessor

Defined in:
lib/jsus/util/post_processor.rb,
lib/jsus/util/post_processor/base.rb,
lib/jsus/util/post_processor/mooltie8.rb,
lib/jsus/util/post_processor/semicolon.rb,
lib/jsus/util/post_processor/moocompat12.rb

Defined Under Namespace

Classes: Base, Moocompat12, MooltIE8, Semicolon

Constant Summary collapse

AVAILABLE_PROCESSORS =
["mooltie8", "moocompat12", "semicolon"].freeze

Class Method Summary collapse

Class Method Details

.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, Pool, Container)

    source files

  • processors (Array)

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

Returns:

  • (Array)

    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