<commit_before>//Dependencies
var gulp		= require('gulp'),
	concat		= require('gulp-concat'),
	uglify		= require('gulp-uglify'),
	bower		= require('gulp-bower-files'),
	browserify	= require('gulp-browserify'),
	minify		= require('gulp-minify-css'),
	filter		= require('gulp-filter'),
	handlebars	= require('gulp-handlebars'),
	clean		= require('gulp-clean');

var config = require('./gulpconf');

//Prefix our arrays
var inv = [], arrs = ['scripts', 'scriptsBrowserify', 'styles', 'templates']
for(var x in arrs) {
	inv[arrs[x]] = config[arrs[x]].map(function(val) {
		return '!' + val;
	});
	config[arrs[x]] = config[arrs[x]].map(function(val) {
		return config.src + '/' + val;
	});
}

//Compiles js files into two files, bundle.js, browserify.js and bower.js
gulp.task('scripts', ['clean'], function() {
	//Our normal scripts
	gulp.src(config.scripts, {base: config.src})
		.pipe(concat('bundles/bundle.js'))
		.pipe(uglify({outSourceMap: true}))
		.pipe(gulp.dest(config.destination));

	//Our browserified scripts
	gulp.src(config.scriptsBrowserify, {base: config.src})
		.pipe(browserify({debug: true}))
		.pipe(concat('bundles/browserify.js'))
		.pipe(uglify({outSourceMap: true}))
		.pipe(gulp.dest(config.destination));

	//Our bower scripts
	bower()
		.pipe(filter('**/*.js'))
		.pipe(concat('bundles/bower.js'))
		.pipe(uglify({outSourceMap: true}))
		.pipe(gulp.dest(config.destination));
});

//Compiles css files into two files, bundle.css and bower.css
gulp.task('styles', ['clean'], function() {
	//Our normal styles
	gulp.src(config.styles, {base: config.src})
		.pipe(concat('bundles/bundle.css'))
		.pipe(minify())
		.pipe(gulp.dest(config.destination));

	//Our bower styles
	bower()
		.pipe(filter('**/*.css'))
		.pipe(concat('bundles/bower.css'))
		.pipe(minify())
		.pipe(gulp.dest(config.destination));
});

//Compiles handlebars templates into single file templates.js
gulp.task('templates', ['clean'], function() {
	gulp.src(config.templates, {base: config.src})
		.pipe(handlebars({wrapped: true}))
		.pipe(concat('bundles/templates.js'))
		.pipe(uglify({outSourceMap: true}))
		.pipe(gulp.dest(config.destination));
});

//Moves all the remaining assets to the destination
gulp.task('assets', ['clean'], function() {
	//Our normal assets
	gulp.src(config.src + '/**/*.*', {base: config.src})
		.pipe(filter(inv.scripts))
		.pipe(filter(inv.scriptsBrowserify))
		.pipe(filter(inv.styles))
		.pipe(filter(inv.templates))
		.pipe(gulp.dest(config.destination));

	//Our bower assets
	bower()
		.pipe(filter('**/*.!(css|js)'))
		.pipe(gulp.dest(config.destination + '/components'));
});

//Remove existing stuff
gulp.task('clean', function(cb) {
	gulp.src(config.destination, {read: false})
		.pipe(clean())
		.on('end', cb);
});

//Combine our tasks into build and watch
gulp.task('default', ['scripts', 'styles', 'templates', 'assets']);
gulp.task('watch', ['default'], function() {
	gulp.watch(config.src + '/**/*', ['default']);
});

//Run sails and our watch task
gulp.task('sails', ['watch'], function() {
	require('sails').lift();
});<commit_msg>Remove gulp sails task, should soon be replaced by hook<commit_after>//Dependencies
var gulp		= require('gulp'),
	concat		= require('gulp-concat'),
	uglify		= require('gulp-uglify'),
	bower		= require('gulp-bower-files'),
	browserify	= require('gulp-browserify'),
	minify		= require('gulp-minify-css'),
	filter		= require('gulp-filter'),
	handlebars	= require('gulp-handlebars'),
	clean		= require('gulp-clean');

var config = require('./gulpconf');

//Prefix our arrays
var inv = [], arrs = ['scripts', 'scriptsBrowserify', 'styles', 'templates']
for(var x in arrs) {
	inv[arrs[x]] = config[arrs[x]].map(function(val) {
		return '!' + val;
	});
	config[arrs[x]] = config[arrs[x]].map(function(val) {
		return config.src + '/' + val;
	});
}

//Compiles js files into two files, bundle.js, browserify.js and bower.js
gulp.task('scripts', ['clean'], function() {
	//Our normal scripts
	gulp.src(config.scripts, {base: config.src})
		.pipe(concat('bundles/bundle.js'))
		.pipe(uglify({outSourceMap: true}))
		.pipe(gulp.dest(config.destination));

	//Our browserified scripts
	gulp.src(config.scriptsBrowserify, {base: config.src})
		.pipe(browserify({debug: true}))
		.pipe(concat('bundles/browserify.js'))
		.pipe(uglify({outSourceMap: true}))
		.pipe(gulp.dest(config.destination));

	//Our bower scripts
	bower()
		.pipe(filter('**/*.js'))
		.pipe(concat('bundles/bower.js'))
		.pipe(uglify({outSourceMap: true}))
		.pipe(gulp.dest(config.destination));
});

//Compiles css files into two files, bundle.css and bower.css
gulp.task('styles', ['clean'], function() {
	//Our normal styles
	gulp.src(config.styles, {base: config.src})
		.pipe(concat('bundles/bundle.css'))
		.pipe(minify())
		.pipe(gulp.dest(config.destination));

	//Our bower styles
	bower()
		.pipe(filter('**/*.css'))
		.pipe(concat('bundles/bower.css'))
		.pipe(minify())
		.pipe(gulp.dest(config.destination));
});

//Compiles handlebars templates into single file templates.js
gulp.task('templates', ['clean'], function() {
	gulp.src(config.templates, {base: config.src})
		.pipe(handlebars({wrapped: true}))
		.pipe(concat('bundles/templates.js'))
		.pipe(uglify({outSourceMap: true}))
		.pipe(gulp.dest(config.destination));
});

//Moves all the remaining assets to the destination
gulp.task('assets', ['clean'], function() {
	//Our normal assets
	gulp.src(config.src + '/**/*.*', {base: config.src})
		.pipe(filter(inv.scripts))
		.pipe(filter(inv.scriptsBrowserify))
		.pipe(filter(inv.styles))
		.pipe(filter(inv.templates))
		.pipe(gulp.dest(config.destination));

	//Our bower assets
	bower()
		.pipe(filter('**/*.!(css|js)'))
		.pipe(gulp.dest(config.destination + '/components'));
});

//Remove existing stuff
gulp.task('clean', function(cb) {
	gulp.src(config.destination, {read: false})
		.pipe(clean())
		.on('end', cb);
});

//Combine our tasks into build and watch
gulp.task('default', ['scripts', 'styles', 'templates', 'assets']);
gulp.task('watch', ['default'], function() {
	gulp.watch(config.src + '/**/*', ['default']);
});
{'fraction_non_alphanumeric': 0.213265473649647, 'fraction_numerical': 0.0, 'mean_word_length': 4.88030888030888, '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': '7356054', 'n_tokens_mistral': 2256, 'n_tokens_neox': 2176, 'n_words': 409}