Class: StackMaster::TemplateCompiler
- Inherits:
-
Object
- Object
- StackMaster::TemplateCompiler
- Defined in:
- lib/stack_master/template_compiler.rb
Constant Summary collapse
- TemplateCompilationFailed =
Class.new(RuntimeError)
Class Method Summary collapse
- .compile(config, template_file_path, compile_time_parameters, compiler_options = {}) ⇒ Object
- .register(name, klass) ⇒ Object
Class Method Details
.compile(config, template_file_path, compile_time_parameters, compiler_options = {}) ⇒ Object
5 6 7 8 9 10 11 |
# File 'lib/stack_master/template_compiler.rb', line 5 def self.compile(config, template_file_path, compile_time_parameters, = {}) compiler = template_compiler_for_file(template_file_path, config) compiler.require_dependencies compiler.compile(template_file_path, compile_time_parameters, ) rescue raise TemplateCompilationFailed.new("Failed to compile #{template_file_path}.") end |
.register(name, klass) ⇒ Object
13 14 15 16 |
# File 'lib/stack_master/template_compiler.rb', line 13 def self.register(name, klass) @compilers ||= {} @compilers[name] = klass end |