Method: PDK::Module::UpdateManager#sync_changes!

Defined in:
lib/pdk/module/update_manager.rb

#sync_changes!Object

Apply any pending changes stored in the UpdateManager to the module.

Raises:



81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/pdk/module/update_manager.rb', line 81

def sync_changes!
  calculate_diffs

  files_to_write = @added_files
  files_to_write += @modified_files.reject { |file| @diff_cache[file[:path]].nil? }

  @removed_files.each do |file|
    unlink_file(file)
  end

  files_to_write.each do |file|
    write_file(file[:path], file[:content])
  end
end