<commit_before>'use strict';

var path = require('path'),
    Changes = require('../model/changes'),
    TargetBase = function (options) {
        this.init(options);
    };

TargetBase.prototype = {
    CACHE_DIR: path.join(process.cwd(), 'cache'),
    SNAPSHOTS_DIR: path.join(process.cwd(), 'db', 'snapshots'),
    KEY: {
        NODE_PREFIX: 'nodes:',
        DOCS_PREFIX: 'docs:',
        PEOPLE_PREFIX: 'people:',
        BLOCKS_PREFIX: 'blocks:',
        URL_PREFIX: 'urls:',
        VERSIONS_PEOPLE: 'versions:people',
        AUTHORS: 'authors',
        TRANSLATORS: 'translators',
        TAGS: 'tags'

    },

    tasks: [],
    options: undefined,
    changes: undefined,

    init: function (options) {
        this.options = options || {};
        this.changes = new Changes();
    },

    getName: function () {
        return 'BASE';
    },

    addTask: function (task) {
        this.tasks.push(task);
        return this;
    },

    getTasks: function () {
        return this.tasks;
    },

    getChanges: function () {
        return this.changes;
    },

    getOptions: function () {
        return this.options;
    },

    execute: function () {
        var _this = this,
            initial = this.getTasks().shift();
        return this.getTasks().reduce(function (prev, item) {
            return prev.then(function () {
                return item(_this);
            });
        }, initial(_this));
    }
};

exports.TargetBase = TargetBase;<commit_msg>Fix issue with tasks executing<commit_after>'use strict';

var path = require('path'),
    Changes = require('../model/changes'),
    TargetBase = function (options) {
        this.init(options);
    };

TargetBase.prototype = {
    CACHE_DIR: path.join(process.cwd(), 'cache'),
    SNAPSHOTS_DIR: path.join(process.cwd(), 'db', 'snapshots'),
    KEY: {
        NODE_PREFIX: 'nodes:',
        DOCS_PREFIX: 'docs:',
        PEOPLE_PREFIX: 'people:',
        BLOCKS_PREFIX: 'blocks:',
        URL_PREFIX: 'urls:',
        VERSIONS_PEOPLE: 'versions:people',
        AUTHORS: 'authors',
        TRANSLATORS: 'translators',
        TAGS: 'tags'

    },

    tasks: [],
    options: undefined,
    changes: undefined,

    init: function (options) {
        this.options = options || {};
        this.changes = new Changes();
    },

    getName: function () {
        return 'BASE';
    },

    addTask: function (task) {
        this.tasks.push(task);
        return this;
    },

    getTasks: function () {
        return this.tasks;
    },

    getChanges: function () {
        return this.changes;
    },

    getOptions: function () {
        return this.options;
    },

    execute: function () {
        var _this = this,
            initial = this.getTasks()[0];
        return this.getTasks().reduce(function (prev, item) {
            return prev.then(function () {
                return item(_this);
            });
        }, initial(_this));
    }
};

exports.TargetBase = TargetBase;
{'fraction_non_alphanumeric': 0.14855801475519786, 'fraction_numerical': 0.00033534540576794097, 'mean_word_length': 2.075257731958763, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5679975', 'n_tokens_mistral': 916, 'n_tokens_neox': 877, 'n_words': 185}