lib/hamlit/engine.rb in hamlit-0.5.3 vs lib/hamlit/engine.rb in hamlit-0.6.0

- old
+ new

@@ -1,23 +1,21 @@ require 'temple' require 'hamlit/compiler' -require 'hamlit/html/pretty' -require 'hamlit/html/ugly' +require 'hamlit/html' require 'hamlit/parser' module Hamlit class Engine < Temple::Engine define_options( - generator: Temple::Generators::ArrayBuffer, - format: :html, - attr_quote: "'", - ugly: true, + generator: Temple::Generators::ArrayBuffer, + format: :html, + attr_quote: "'", ) use Parser use Compiler - use :Html, -> { create(html_compiler) } + use HTML filter :Escapable filter :ControlFlow filter :MultiFlattener filter :StaticMerger use :Generator, -> { create(options[:generator]) } @@ -27,16 +25,8 @@ def create(klass) valid_options = options.to_hash.select do |key, value| klass.options.valid_key?(key) end klass.new(valid_options) - end - - def html_compiler - if options[:ugly] - HTML::Ugly - else - HTML::Pretty - end end end end