15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/stack_master/template_compilers/sparkle_formation.rb', line 15
def self.compile(template_file_path, compile_time_parameters, compiler_options = {})
if compiler_options['sparkle_path']
::SparkleFormation.sparkle_path = File.expand_path(compiler_options['sparkle_path'])
else
::SparkleFormation.sparkle_path = File.dirname(template_file_path)
end
sparkle_template = ::SparkleFormation.compile(template_file_path, :sparkle)
definitions = sparkle_template.parameters
validate_definitions(definitions)
validate_parameters(definitions, compile_time_parameters)
sparkle_template.compile_time_parameter_setter do
sparkle_template.compile_state = create_state(definitions, compile_time_parameters)
end
JSON.pretty_generate(sparkle_template)
end
|