Module: Leftovers::Precompilers

Includes:
Autoloader
Defined in:
lib/leftovers/precompilers.rb,
lib/leftovers/precompilers/erb.rb,
lib/leftovers/precompilers/haml.rb,
lib/leftovers/precompilers/json.rb,
lib/leftovers/precompilers/slim.rb,
lib/leftovers/precompilers/yaml.rb,
lib/leftovers/precompilers/precompiler.rb,
lib/leftovers/precompilers/yaml/builder.rb

Defined Under Namespace

Modules: Haml, JSON, Slim, YAML Classes: ERB, Precompiler

Constant Summary

Constants included from Autoloader

Autoloader::ALL_CAPS_NAMES

Class Method Summary collapse

Methods included from Autoloader

class_from_path, dir_path_from_class, glob_children, included, root

Class Method Details

.build(precompilers) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/leftovers/precompilers.rb', line 8

def build(precompilers)
  precompilers.group_by { |p| build_precompiler(p[:format]) }.map do |format, precompiler|
    Precompiler.new(
      format,
      MatcherBuilders::Path.build(precompiler.flat_map { |p| p[:paths] })
    )
  end
end