Method: PDK::Generate::PuppetObject#render_file

Defined in:
lib/pdk/generate/puppet_object.rb

#render_file(dest_path, template_path, data) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Render a file using the provided template and write it to disk.

Raises:

  • if the parent directories to ‘dest_path` do not exist and could not be created.

  • if the rendered file could not be written to ‘dest_path`.

Parameters:

  • The path that the rendered file should be written to. Any necessary directories will be automatically created.

  • The path on disk to the file containing the template.

  • The data to be provided to the template when rendering.

API:

  • private



150
151
152
153
154
# File 'lib/pdk/generate/puppet_object.rb', line 150

def render_file(dest_path, template_path, data)
  write_file(dest_path) do
    PDK::TemplateFile.new(template_path, data).render
  end
end