<commit_before>

var _       = require('underscore'),
    yesno   = require('yesno'),
    fs      = require('fs'),


    /**
     * GitConfig
     *
     * @constructor
     * @param file {string}
     */
    File = function (file) {
        this.file = file;
    };


_.extend(File.prototype, {


    /**
     * exists
     *
     * @returns {Promise}
     */
    exists: function () {

        var file = this.file;

        return new Promise(function (fulfill, reject) {

            fs.exists(file, function (exists) {

                if (!exists) {
                    reject()
                } else {
                    fulfill()
                }
            });
        });
    },


    /**
     * read
     *
     * @returns {Promise}
     */
    read: function () {

        var file = this.file;

        return new Promise(function (fulfill, reject) {

            fs.stat(file, function (error, stats) {

                fs.open(file, "r", function (error, fd) {

                    buffer = new Buffer(stats.size);

                    fs.read(fd, buffer, 0, buffer.length, null, function (error, bytesRead, buffer) {

                        fulfill(buffer.toString("utf8", 0, buffer.length));

                        fs.close(fd);
                    });
                });
            });
        });
    },


    /**
     * create
     *
     * @returns {Promise}
     */
    create: function () {

        var file = this.file;

        return new Promise(function (fulfill, reject) {

            yesno.ask(file + ' doesn\'t exists, would you like to create it? (y/n)', true, function (ok) {

                if (ok) {
                    fulfill();
                } else {
                    reject();
                }

            });
        });
    },


    getUser: function (contents) {

    }

});




// expose the class
module.exports = File;<commit_msg>Changing file management libs<commit_after>

var _       = require('underscore'),
    yesno   = require('yesno'),
    fs      = require('fs'),


    /**
     * GitConfig
     *
     * @constructor
     * @param file {string}
     */
    File = function (file) {
        this.file = file;
    };


_.extend(File.prototype, {


    /**
     * exists
     *
     * @returns {Promise}
     */
    exists: function () {

        var file = this.file;

        return new Promise(function (fulfill, reject) {

            fs.exists(file, function (exists) {

                if (!exists) {
                    reject()
                } else {
                    fulfill()
                }
            });
        });
    },


    /**
     * read
     *
     * @returns {Promise}
     */
    read: function () {

        var file = this.file;

        return new Promise(function (fulfill, reject) {

            fs.stat(file, function (error, stats) {

                fs.open(file, "r", function (error, fd) {

                    buffer = new Buffer(stats.size);

                    fs.read(fd, buffer, 0, buffer.length, null, function (error, bytesRead, buffer) {

                        fulfill(buffer.toString("utf8", 0, buffer.length));

                        fs.close(fd);
                    });
                });
            });
        });
    },


    /**
     * create
     *
     * @returns {Promise}
     */
    create: function () {

        var file = this.file;

        return new Promise(function (fulfill, reject) {

            yesno.ask(file + ' doesn\'t exists, would you like to create it? (y/n)', true, function (ok) {

                if (ok) {
                    fulfill();
                } else {
                    reject();
                }

            });
        });
    },


    getUser: function (contents) {

        console.log(content);
    }
});




// expose the class
module.exports = File;
{'fraction_non_alphanumeric': 0.13469068128425998, 'fraction_numerical': 0.0015661707126076742, 'mean_word_length': 1.1516002245929253, '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': '6904243', 'n_tokens_mistral': 1121, 'n_tokens_neox': 1021, 'n_words': 235}