lib/origen/generator/renderer.rb in origen-0.60.7 vs lib/origen/generator/renderer.rb in origen-0.60.8
- old
+ new
@@ -3,15 +3,15 @@
# Handles the recursive rendering and importing of sub templates
# and source files
module Renderer
def render(file, options = {}, &block)
fail 'File argument is nil' unless file
+
file = Origen.file_handler.clean_path_to_sub_template(file)
current_pipeline << { file: file, options: options,
placeholder: placeholder, block: block,
- indent: options[:indent] || 0
- }
+ indent: options[:indent] || 0 }
if block_given?
self.current_buffer += current_pipeline.last[:placeholder] + "\n"
end
current_pipeline.last[:placeholder]
end
@@ -45,11 +45,10 @@
@current_options = current[:options]
self.current_buffer = ''
output = compile(current[:file],
sub_template: true,
block: current[:block],
- scope: @scope
- )
+ scope: @scope)
if current[:indent] && current[:indent] > 0
indent = ' ' * current[:indent]
output = output.split("\n").map { |l| indent + l }.join("\n")
end
@current_options = nil