<commit_before>'use strict';

console.log('Starting Gulp...');

// Node APIs
var exec         = require('child_process').exec;
var path         = require('path');

// Node Modules
var gulp         = require('gulp');
var $            = require('gulp-load-plugins')({lazy: false});

var autoprefixer = require('autoprefixer');
var browserSync  = require('browser-sync');
var del          = require('del');
var runSequence  = require('run-sequence');
var Server       = require('karma').Server;

var out = './public/';
var src = './src/';
var tmp = './.tmp/';
var lib = './lib/';

var env = 'prod';

gulp.task('clean', function() {
    del.sync(out);
    del.sync(tmp);
});

gulp.task('vendor', function() {
    return gulp
        .src([
            lib + '/jquery/dist/jquery.min.js',
            lib + '/materialize/dist/js/materialize.min.js',
            lib + '/angular/angular.min.js',
            lib + '/angular-route/angular-route.min.js',
            lib + '/angular-materialize/src/angular-materialize.js'
        ])
        .pipe($.concat('vendor.min.js'))
        .pipe(gulp.dest(out));
});

gulp.task('angular:config', function() {
    return gulp
        .src(src + '**/app.config.json')
        .pipe($.ngConfig('app.config', {
            environment: env,
            wrap: true
        }))
        .pipe($.rename('config.module.js'))
        .pipe(gulp.dest(tmp));
});

gulp.task('angular:template', function() {
    return gulp
        .src([
            src + '**/*.html',
            '!' + src + 'index.html'
        ])
        .pipe($.htmlmin({
            collapseWhitespace: true
        }))
        .pipe($.angularTemplatecache('templates.module.js', {
            module: 'app.templates',
            moduleSystem: 'IIFE',
            standalone: true
        }))
        .pipe(gulp.dest(tmp));
});

gulp.task('js', [
        'angular:config',
        'angular:template'
    ], function() {
    return gulp
        .src([
            tmp + 'config.module.js',
            tmp + 'templates.module.js',
            src + '**/*.module.js',
            src + '**/!(*.spec).js'
        ])
        .pipe($.sourcemaps.init())
            .pipe($.ngAnnotate())
            .pipe($.concat('app.min.js'))
            .pipe($.uglify())
        .pipe($.sourcemaps.write('.'))
        .pipe(gulp.dest(out));
});

gulp.task('html', function() {
   return gulp
       .src(src + 'index.html')
       .pipe($.htmlmin({
            collapseWhitespace: true
        }))
       .pipe(gulp.dest(out));
});

gulp.task('sass', function() {
    return gulp
        .src(src + '**/*.s@(a|c)ss')
        .pipe(injectSass(gulp.src(src + '**/_*.s@(a|c)ss')))
        .pipe($.sourcemaps.init())
            .pipe($.sass().on('error', function() {}))
            .pipe($.postcss([
                autoprefixer({browsers: ['last 2 versions']}),
            ]))
            .pipe($.concat('app.min.css'))
            .pipe($.cssnano())
        .pipe($.sourcemaps.write('.'))
        .pipe(gulp.dest(out));
});

gulp.task('build', function() {
    runSequence('clean', ['vendor', 'js', 'html', 'sass']);
});

gulp.task('test', ['build'], function() {
    karma(true);
});

gulp.task('tdd', ['build'], function() {
    karma(false);
});

gulp.task('server', function() {
    exec('node server.js', function(err, stdout, stderr) {
        console.log(stdout);
        console.log(stderr);
    });
});

gulp.task('browser-sync', ['server'], function() {
    browserSync.create().init(null, {
		proxy: "http://localhost:8080",
        files: ["public/**/*"],
        open: false,
        port: 8081,
        online: true,
        notify: false
	});
});

gulp.task('watch', function() {
    $.watch([
        src + '**/*.html',
        src + '**/*.js',
        src + '**/*.json'
    ], function() {
        gulp.start('js');
    });
    $.watch(src + '**/*.html', function() {
        gulp.start('html');
    });
    $.watch(src + '**/*.s@(a|c)ss', function() {
        gulp.start('sass');
    });
});

gulp.task('default', function() {
    env = 'local';
    runSequence(['tdd', 'watch'], 'browser-sync')
});

////////////////
<commit_msg>Changed gulp.js back to its original state<commit_after>'use strict';

console.log('Starting Gulp...');

// Node APIs
var exec         = require('child_process').exec;
var path         = require('path');

// Node Modules
var gulp         = require('gulp');
var $            = require('gulp-load-plugins')({lazy: false});

var autoprefixer = require('autoprefixer');
var browserSync  = require('browser-sync');
var del          = require('del');
var runSequence  = require('run-sequence');
var Server       = require('karma').Server;

var out = './public/';
var src = './src/';
var tmp = './.tmp/';
var lib = './lib/';

var env = 'prod';

gulp.task('clean', function() {
    del.sync(out);
    del.sync(tmp);
});

gulp.task('vendor', function() {
    return gulp
        .src([
            lib + '/jquery/dist/jquery.min.js',
            lib + '/materialize/dist/js/materialize.min.js',
            lib + '/angular/angular.min.js',
            lib + '/angular-route/angular-route.min.js',
            lib + '/angular-materialize/src/angular-materialize.js'
        ])
        .pipe($.concat('vendor.min.js'))
        .pipe(gulp.dest(out));
});

gulp.task('angular:config', function() {
    return gulp
        .src(src + '**/app.config.json')
        .pipe($.ngConfig('app.config', {
            environment: env,
            wrap: true
        }))
        .pipe($.rename('config.module.js'))
        .pipe(gulp.dest(tmp));
});

gulp.task('angular:template', function() {
    return gulp
        .src([
            src + '**/*.html',
            '!' + src + 'index.html'
        ])
        .pipe($.htmlmin({
            collapseWhitespace: true
        }))
        .pipe($.angularTemplatecache('templates.module.js', {
            module: 'app.templates',
            moduleSystem: 'IIFE',
            standalone: true
        }))
        .pipe(gulp.dest(tmp));
});

gulp.task('js', [
        'angular:config',
        'angular:template'
    ], function() {
    return gulp
        .src([
            tmp + 'config.module.js',
            tmp + 'templates.module.js',
            src + '**/*.module.js',
            src + '**/!(*.spec).js'
        ])
        .pipe($.sourcemaps.init())
            .pipe($.ngAnnotate())
            .pipe($.concat('app.min.js'))
            .pipe($.uglify())
        .pipe($.sourcemaps.write('.'))
        .pipe(gulp.dest(out));
});

gulp.task('html', function() {
   return gulp
       .src(src + 'index.html')
       .pipe($.htmlmin({
            collapseWhitespace: true
        }))
       .pipe(gulp.dest(out));
});

gulp.task('sass', function() {
    return gulp
        .src(src + '**/*.s@(a|c)ss')
        .pipe(injectSass(gulp.src(src + '**/_*.s@(a|c)ss')))
        .pipe($.sourcemaps.init())
            .pipe($.sass().on('error', function() {}))
            .pipe($.postcss([
                autoprefixer({browsers: ['last 2 versions']}),
            ]))
            .pipe($.concat('app.min.css'))
            .pipe($.cssnano())
        .pipe($.sourcemaps.write('.'))
        .pipe(gulp.dest(out));
});

gulp.task('build', function() {
    runSequence('clean', ['vendor', 'js', 'html', 'sass']);
});

gulp.task('test', ['build'], function() {
    karma(true);
});

gulp.task('tdd', ['build'], function() {
    karma(false);
});

gulp.task('server', function() {
    exec('node server.js', function(err, stdout, stderr) {
        console.log(stdout);
        console.log(stderr);
    });
});

gulp.task('browser-sync', ['server'], function() {
    browserSync.create().init(null, {
		proxy: "http://localhost:8080",
        files: ["public/**/*"],
        browser:"google chrome",
        port: 8081,
        online: true,
        notify: false
	});
});

gulp.task('watch', function() {
    $.watch([
        src + '**/*.html',
        src + '**/*.js',
        src + '**/*.json'
    ], function() {
        gulp.start('js');
    });
    $.watch(src + '**/*.html', function() {
        gulp.start('html');
    });
    $.watch(src + '**/*.s@(a|c)ss', function() {
        gulp.start('sass');
    });
});

gulp.task('default', function() {
    env = 'local';
    runSequence(['tdd', 'watch'], 'browser-sync')
});

////////////////

{'fraction_non_alphanumeric': 0.22333373508497048, 'fraction_numerical': 0.0021694588405447753, 'mean_word_length': 2.004344677769732, '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': '2296951', 'n_tokens_mistral': 2760, 'n_tokens_neox': 2740, 'n_words': 448}