Method: PDK::Generate::PuppetObject#stage_changes

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

#stage_changes(update_manager) ⇒ PDK::Module::UpdateManager

Check that the templates can be rendered. Find an appropriate template and stages the target files from the template. This is the main entry point for the class.

Returns:

Raises:



103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/pdk/generate/puppet_object.rb', line 103

def stage_changes(update_manager)
  check_preconditions

  with_templates do |template_dir|
    template_files.each do |source_file, relative_dest_path|
      new_content = template_dir.render_single_item(source_file, template_data)
      next if new_content.nil?

      stage_change(relative_dest_path, new_content, update_manager)
    end
  end
  non_template_files.each { |relative_dest_path, content| stage_change(relative_dest_path, content, update_manager) }

  update_manager
end