Sha256: 30b4530da52d32ead80f1995297c399e1d448e92b25d7db6bd2b2e4b0c80ab85

Contents?: true

Size: 699 Bytes

Versions: 6

Compression:

Stored size: 699 Bytes

Contents

require 'temple'
require 'faml/compiler'
require 'faml/html'
require 'faml/newline'
require 'faml/parser'

module Faml
  class Engine < Temple::Engine
    define_options(
      generator: Temple::Generators::ArrayBuffer,
    )

    DEFAULT_OPTIONS = {
        format: :html,
        attr_quote: "'",
    }.freeze

    def initialize(opts = {})
      super(DEFAULT_OPTIONS.merge(opts))
    end

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
faml-0.2.5 lib/faml/engine.rb
faml-0.2.4 lib/faml/engine.rb
faml-0.2.3 lib/faml/engine.rb
faml-0.2.2 lib/faml/engine.rb
faml-0.2.1 lib/faml/engine.rb
faml-0.2.0 lib/faml/engine.rb