<commit_before>var gulp = require('gulp'),
	connect = require('gulp-connect');
    jshint = require('gulp-jshint'),
    uglify = require('gulp-uglify'),
    concat = require('gulp-concat'),
	build = require('gulp-build'),
	minifyCSS = require('gulp-minify-css'),
	sourcemaps = require('gulp-sourcemaps'),
	clean = require('gulp-clean'),
	htmlreplace = require('gulp-html-replace'),
	stylish = require('jshint-stylish'),
	gutil = require('gulp-util'),
	ftp = require('gulp-ftp');

var t = new Date().getTime(),
	js_all = 'js/all.min.js',
	js_vendor = 'js/vendor.min.js',
	css_file_min = 'all.min.css';




// build tasks
gulp.task('minify-css', function () {
	gulp.src(['css/reset.css', 'css/fonts.css', 'css/styles.css'], { cwd: 'webapp' })
    .pipe(minifyCSS())
    .pipe(concat(css_file_min))
    .pipe(gulp.dest('build/css'));
});

// test JS
gulp.task('test_js', function(){
	return gulp.src(['js/scripts.js', 'js/elecciones_app.js'], { cwd: 'webapp' })
		.pipe(jshint())
		.pipe(jshint.reporter('default'))
		.pipe(jshint.reporter(stylish));
});

gulp.task('js', ['test_js'], function () {
	gulp.src('js/scripts.js, js/elecciones_app.js', { cwd: 'webapp' })
		.pipe(sourcemaps.init())
		.pipe(uglify())
		.pipe(concat(js_all))
		.pipe(sourcemaps.write('./'))
		.pipe(gulp.dest('build'));
	
	gulp.src([
		'js/jquery.min.js', 
		], { cwd: 'webapp' })
		.pipe(sourcemaps.init())
      	.pipe(uglify())
      	.pipe(concat(js_vendor))
		.pipe(sourcemaps.write())
      	.pipe(gulp.dest('build'));
	
});

gulp.task('copy', function () {
	gulp.src('**/*.html', { cwd: 'webapp' })
		.pipe(htmlreplace({
			js:[(js_vendor+'?'+t), (js_all+'?'+t)],
			css: ['css/'+css_file_min+'?'+t]
		}))
		.pipe(gulp.dest('build'));
	
	gulp.src('css/fonts/*', { cwd: 'webapp' })
		.pipe(gulp.dest('build/css/fonts'));

	gulp.src('img/*', { cwd: 'webapp' })
		.pipe(gulp.dest('build/img'));

	gulp.src('data', { cwd: 'webapp' })
		.pipe(gulp.dest('build'));

});

gulp.task('build', ['minify-css', 'js', 'copy']);


// SERVER
gulp.task('connect', function() {
  connect.server({
    root: 'webapp',
    livereload: true
  });
});

gulp.task('html', function () {
  gulp.src('./webapp/*.html')
    .pipe(connect.reload());
});
 
gulp.task('watch', function () {
  gulp.watch(['./webapp/*.html', './webapp/**/*.css', './webapp/**/*.js'], ['html', 'test_js']);
});
 
gulp.task('server', ['connect', 'watch']);

gulp.task('server_pro', function() {
  connect.server({
    root: 'build',
  });
});


// default task
gulp.task('default', function() {
  console.log("Elecciones 2015 CABA");
});


//  push build to FTP
gulp.task('deploy_ftp', function () {
    var keys = require('./keys_ftp');
    return gulp.src('**/*', { cwd: 'build' })
        .pipe(ftp({
            host: keys.host,
            user: keys.user,
            pass: <PASSWORD>,
            remotePath: keys.remotePath,
        }))<commit_msg>Fix gulp task with multiple sources<commit_after>var gulp = require('gulp'),
	connect = require('gulp-connect');
    jshint = require('gulp-jshint'),
    uglify = require('gulp-uglify'),
    concat = require('gulp-concat'),
	build = require('gulp-build'),
	minifyCSS = require('gulp-minify-css'),
	sourcemaps = require('gulp-sourcemaps'),
	clean = require('gulp-clean'),
	htmlreplace = require('gulp-html-replace'),
	stylish = require('jshint-stylish'),
	gutil = require('gulp-util'),
	ftp = require('gulp-ftp');
    merge = require('merge-stream');

var t = new Date().getTime(),
	js_all = 'js/all.min.js',
	js_vendor = 'js/vendor.min.js',
	css_file_min = 'all.min.css';


// build tasks
gulp.task('minify-css', function () {
	gulp.src(['css/reset.css', 'css/fonts.css', 'css/styles.css'], { cwd: 'webapp' })
    .pipe(minifyCSS())
    .pipe(concat(css_file_min))
    .pipe(gulp.dest('build/css'));
});

// test JS
gulp.task('test_js', function(){
	return gulp.src(['js/scripts.js', 'js/elecciones_app.js'], { cwd: 'webapp' })
		.pipe(jshint())
		.pipe(jshint.reporter('default'))
		.pipe(jshint.reporter(stylish));
});

gulp.task('js', ['test_js'], function () {
	var all = gulp.src(['js/scripts.js', 'js/elecciones_app.js'] , { cwd: 'webapp' })
		.pipe(sourcemaps.init())
		.pipe(uglify())
		.pipe(concat(js_all))
		.pipe(sourcemaps.write('./'))
		.pipe(gulp.dest('build'));
	
	var vendor = gulp.src([
		'js/jquery.min.js', 
		], { cwd: 'webapp' })
		.pipe(sourcemaps.init())
      	.pipe(uglify())
      	.pipe(concat(js_vendor))
		.pipe(sourcemaps.write('./'))
      	.pipe(gulp.dest('build'));

    return merge(all,vendor);
	
});

gulp.task('copy', function () {
	gulp.src('**/*.html', { cwd: 'webapp' })
		.pipe(htmlreplace({
			js:[(js_vendor+'?'+t), (js_all+'?'+t)],
			css: ['css/'+css_file_min+'?'+t]
		}))
		.pipe(gulp.dest('build'));
	
	gulp.src('css/fonts/*', { cwd: 'webapp' })
		.pipe(gulp.dest('build/css/fonts'));

	gulp.src('img/*', { cwd: 'webapp' })
		.pipe(gulp.dest('build/img'));

	gulp.src('data/*', { cwd: 'webapp' })
		.pipe(gulp.dest('build/data'));

});

gulp.task('build', ['minify-css', 'js', 'copy']);


// SERVER
gulp.task('connect', function() {
  connect.server({
    root: 'webapp',
    livereload: true
  });
});

gulp.task('html', function () {
  gulp.src('./webapp/*.html')
    .pipe(connect.reload());
});
 
gulp.task('watch', function () {
  gulp.watch(['./webapp/*.html', './webapp/**/*.css', './webapp/**/*.js'], ['html', 'test_js']);
});
 
gulp.task('server', ['connect', 'watch']);

gulp.task('server_pro', function() {
  connect.server({
    root: 'build'
  });
});


// default task
gulp.task('default', function() {
  console.log("Elecciones 2015 CABA");
});


//  push build to FTP
gulp.task('deploy_ftp', function () {
    var keys = require('./keys_ftp');
    return gulp.src('**/*', { cwd: 'build' })
        .pipe(ftp({
            host: keys.host,
            user: keys.user,
            pass: keys.pass,
            remotePath: keys.remotePath,
        }))
{'fraction_non_alphanumeric': 0.24843246907303848, 'fraction_numerical': 0.0013557024233180816, 'mean_word_length': 3.6001558846453623, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '5231652', 'n_tokens_mistral': 2393, 'n_tokens_neox': 2297, 'n_words': 343}