<commit_before>module.exports = function(grunt) {
    'use strict';

    var fs = require('fs');

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        jshint: {
            all: {
                src: ['conkitty.js', 'browser.js', 'bin/conkitty', 'Gruntfile.js'],
                options: {
                    jshintrc: '.jshintrc'
                }
            }
        },

        clean: {
            tmp: ['tmp'],
            'browser.js': ['browser.js']
        },

        conkitty: {
            test: {
                files: {
                    'tmp/test.ctpl.js': ['test/test.ctpl']
                }
            }
        },

        uglify: {
            options: {
                preserveComments: 'some'
            },
            build: {
                files: {
                    'tmp/test.ctpl.min.js': 'tmp/test.ctpl.js'
                }
            }
        },

        qunit: {
            all: ['test/**/*.html']
        }
    });

    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-qunit');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-clean');

    grunt.registerMultiTask('conkitty', function() {
        var conkittyCompile = require(__dirname + '/conkitty.js');

        this.files.forEach(function(f) {
            var compiled = conkittyCompile(grunt.file.read(f.src[0])),
                ret = [fs.readFileSync(__dirname + '/_common.js', {encoding: 'utf8'}), '\n'],
                name;

            for (name in compiled) {
                ret.push('$C.tpl[\'' + name + '\'] = ' + compiled[name] + '\n');
            }

            grunt.file.write(f.dest, ret.join('\n'));
            grunt.log.writeln('File "' + f.dest + '" created.');
        });
    });

    grunt.registerTask('browser.js', function() {
        var browser = fs.readFileSync(__dirname + '/_browser.js', {encoding: 'utf8'}),
            common = fs.readFileSync(__dirname + '/_common.js', {encoding: 'utf8'});

        common = common.replace(/\n(?!\n|$)/g, '\n    ');
        browser = browser.replace('/*** common.js inserted here ***/', common);

        fs.writeFileSync(__dirname + '/browser.js', '/* This file is automatically generated from _browser.js and _common.js */\n\n' + browser);
        grunt.log.writeln('File "browser.js" created.');
    });

    grunt.registerTask('default', ['jshint', 'clean', 'browser.js', 'conkitty', 'uglify', 'qunit']);
};<commit_msg>Temporary broken everything.<commit_after>module.exports = function(grunt) {
    'use strict';

    var fs = require('fs');

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        jshint: {
            all: {
                src: ['conkitty.js', 'browser.js', 'bin/conkitty', 'Gruntfile.js'],
                options: {
                    jshintrc: '.jshintrc'
                }
            }
        },

        clean: {
            tmp: ['tmp'],
            'browser.js': ['browser.js']
        },

        conkitty: {
            test: {
                files: {
                    'tmp/test.ctpl.js': ['test/test.ctpl']
                }
            }
        },

        uglify: {
            options: {
                preserveComments: 'some'
            },
            build: {
                files: {
                    'tmp/test.ctpl.min.js': 'tmp/test.ctpl.js'
                }
            }
        },

        qunit: {
            all: ['test/**/*.html']
        }
    });

    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-qunit');
    grunt.loadNpmTasks('grunt-contrib-uglify');
    grunt.loadNpmTasks('grunt-contrib-clean');

    grunt.registerMultiTask('conkitty', function() {
        var Conkitty = require(__dirname + '/conkitty.js'),
            conkitty = new Conkitty(),
            tmp = new Conkitty();

        tmp.push(grunt.file.read(__dirname + '/ololo.ctpl'));
        console.log(JSON.stringify(tmp.compile(), undefined, 4));

        this.files.forEach(function(f) {
            var ret = [fs.readFileSync(__dirname + '/_common.js', {encoding: 'utf8'}), '\n'];
                //name;

            conkitty.push(grunt.file.read(f.src[0]));

            //for (name in compiled) {
            //    ret.push('$C.tpl[\'' + name + '\'] = ' + compiled[name] + '\n');
            //}

            grunt.file.write(f.dest, ret.join('\n'));
            grunt.log.writeln('File "' + f.dest + '" created.');
        });
    });

    grunt.registerTask('browser.js', function() {
        var browser = fs.readFileSync(__dirname + '/_browser.js', {encoding: 'utf8'}),
            common = fs.readFileSync(__dirname + '/_common.js', {encoding: 'utf8'});

        common = common.replace(/\n(?!\n|$)/g, '\n    ');
        browser = browser.replace('/*** common.js inserted here ***/', common);

        fs.writeFileSync(__dirname + '/browser.js', '/* This file is automatically generated from _browser.js and _common.js */\n\n' + browser);
        grunt.log.writeln('File "browser.js" created.');
    });

    grunt.registerTask('default', ['jshint', 'clean', 'browser.js', 'conkitty', 'uglify', 'qunit']);
};
{'fraction_non_alphanumeric': 0.1788053949903661, 'fraction_numerical': 0.0017341040462427746, 'mean_word_length': 1.6498213374170496, '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': '5058281', 'n_tokens_mistral': 1663, 'n_tokens_neox': 1601, 'n_words': 252}