/**
 * @overview Helper module to create apemanfile configurations.
 * This file is generated by a task and do NOT edit manually.
 * @namespace _apemanfile_helper
 * @private
 * @author {{meta.author.name}}
 */


var h = exports;

/*
 * @function apemanfile.helper._workerPath
 * @protected
 * @ignore
 * @returns {string} - Worker path.
 */
h._workerPath = function(){
    var h = this;
    return h.resolve('{{workerPath}}');
};

{{#each task.workers}}
/**
 * Task definition to {{readableName}}.
 * @function apemanfile.helper.{{name}}Task
 * @param {object} config - Task configuration.
 * @returns {object} - Task definition object.
 */
h.{{name}}Task = function (config) {
    var h = this;
    return {
        worker: {
            path: h._workerPath(),
            key: "{{name}}"
        },
        config: config
    };
};
{{/each}}

/**
 * New readonly file.
 * @param {string} src - Template file name.
 * @param {object} data - Render data.
 * @returns {object} - File definition object.
 * @protected
 * @ignore
 */
h._newReadonlyFile = function (src, data) {
    var h = this;
    return h.newFile().tmpl(h.resolve(src)).data(data);
};


{{#each tmpl.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 definition object.
 */
h.new{{Name}}File = function (data) {
    var h = this,
        src = '{{../tmplDir}}/{{relativePath}}';
    return h._newReadonlyFile(src, data);
};
{{/each}}
