1
0
Fork 0
mirror of https://github.com/haml/haml.git synced 2022-11-09 12:33:31 -05:00

Use HamlEngine for CLI

This commit is contained in:
Takashi Kokubun 2015-10-24 14:09:47 +09:00
parent 83b73aaa25
commit 0b7677f1c8

View file

@ -25,7 +25,7 @@ module Hamlit
def generate_code(file)
template = File.read(file)
Hamlit::Engine.new(engine_options).call(template)
Hamlit::HamlEngine.new(template, haml_options).precompiled
end
def generate_ast(file)
@ -33,8 +33,8 @@ module Hamlit
Hamlit::Parser.new.call(template)
end
def engine_options
{ pretty: options['style'] == 'pretty' }
def haml_options
{ ugly: options['style'] != 'pretty' }
end
# Flexible default_task, compatible with haml's CLI