Sha256: 0ba6f9b8fd39bf8241755f99cc5f0c86b139c2b18d4bdf83c1cf2e0a47391445

Contents?: true

Size: 694 Bytes

Versions: 9

Compression:

Stored size: 694 Bytes

Contents

# frozen-string-literal: true
require 'haml_parser/parser'
require 'temple'
require_relative 'compiler'
require_relative 'html'
require_relative 'newline'
require_relative 'script_end'

module Faml
  class Engine < Temple::Engine
    define_options(
      generator: Temple::Generators::ArrayBuffer,
      filename: nil,
      extend_helpers: false,
    )

    use HamlParser::Parser
    use Compiler
    use Html
    filter :Escapable
    filter :ControlFlow
    filter :MultiFlattener
    use Newline
    use ScriptEnd
    filter :StaticMerger
    use :Generator do
      options[:generator].new(options.to_hash.reject { |k, _| !options[:generator].options.valid_key?(k) })
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
faml-0.7.3 lib/faml/engine.rb
faml-0.7.2 lib/faml/engine.rb
faml-0.7.1 lib/faml/engine.rb
faml-0.7.0 lib/faml/engine.rb
faml-0.6.5 lib/faml/engine.rb
faml-0.6.4 lib/faml/engine.rb
faml-0.6.3 lib/faml/engine.rb
faml-0.6.2 lib/faml/engine.rb
faml-0.6.1 lib/faml/engine.rb