/**
 * Config helper to define files.
 * @module task.helpers.FileConfigHelper.
 * @author "{{authorModule}}"
 *
 */

var _configObjects = require('./_config_objects'),
    File = _configObjects.File;

/**
 * New readonly file.
 * @param {string} src - Template file name.
 * @param {object} data - Render data.
 * @returns {object} - File definition object.
 * @protected
 * @ignore
 */
function newReadonlyFile(src, data) {
    return new File().tmpl(src).mode('444').force(true).data(data);
}

{{#each files}}
/**
 * File definition with {{relativePath}} template.
 * By default,  mode is 444 and force option is enabled.
 * @function apemanfile.helper.new{{Name}}File
 * @param {object} data - Render data object.
 * @example
 *    var {{name}}File = h.new{{Name}}File({foo:bar}).force(false).mode('644');
 * @returns {object} - File config object.
 */
exports.new{{Name}}File = function (data) {
    var src = '{{relativePath}}';
    return newReadonlyFile(src, data);
};
{{/each}}
