<commit_before>//
// BEGIN - gulp.js
//

//
// === DEPENDENCIES ===
//

var gulp = require('gulp');
var gutil = require('gulp-util');
var bower = require('bower');
var concat = require('gulp-concat');
var del = require('del');
var jshint = require('gulp-jshint');
var sass = require('gulp-sass');
var minifyCss = require('gulp-minify-css');
var sourcemap = require('gulp-sourcemaps');
var vinylPaths = require('vinyl-paths');
var rename = require('gulp-rename');
var ngAnnotate = require('gulp-ng-annotate');
var uglify = require("gulp-uglify");
var imagemin = require('gulp-imagemin');
var htmlreplace = require('gulp-html-replace');
var replace = require('gulp-replace');
var sh = require('shelljs');
var karma = require('karma').server;
var ngConstant = require('gulp-ng-constant');
var extend = require('gulp-extend');
var gulpif = require('gulp-if');
var minifyHtml    = require('gulp-minify-html');
var templateCache = require('gulp-angular-templatecache');
var inject = require('gulp-inject');

//
// === PATHS ===
//

// Files
//
// Note: change the 'ionicbundle' entry below from 'ionic.bundle.min.js' to 'ionic.bundle.js' to debug "moduleErr"
// errors in a production build ("gulp build") - see explanation:
//
// http://www.chrisgmyr.com/2014/08/debugging-uncaught-error-injectormodulerr-in-angularjs/
//
// (the unminified ionic.bundle.js needs to have the extra console.log statement as explained in the article)
//
var files = {
  jsbundle: 'app.bundle.min.js',
  appcss: 'app.css',
  ionicappmincss: 'ionic.app.min.css',
  ionicbundle: 'ionic.bundle.min.js'    // change to 'ionic.bundle.js' for debugging moduleErr errors
};
// Paths
var paths = {
  sass: ['./scss/**/*.scss'],
  css: ['./src/css/**/*.css'],
  scripts: [
    './src/js/**/*.js',
    '!./src/js/config/config.js'   /* exclude config.js: handled separately */
  ],
  injectedScripts: [
    './src/js/app/**/*.js',
    '!./src/js/app/app.js',                   /* exclude the root module ('app' module) files */
    '!./src/js/app/application.ctrl.js',      /* exclude the root module ('app' module) files */
    '!./src/js/app/application.service.js'    /* exclude the root module ('app' module) files */
  ],
  images: ['./src/img/**/*'],
  templates: ['./src/js/**/*.html'],
  indexTemplate: ['./src/index-template.html'],
  index: ['./src/index.html'],
  locales: [
    './src/js/locales/*.json'
  ],
  ionicfonts: ['./src/lib/ionic/fonts/*'],
  lib: [
    './src/lib/ionic/js/' + files.ionicbundle,
    './src/lib/parse/parse.min.js',
    './src/lib/angular-resource/angular-resource.min.js',
    './src/lib/angular-messages/angular-messages.min.js',
    './src/lib/angular-elastic/elastic.js',
    './src/lib/ngCordova/dist/ng-cordova.min.js',
    './src/lib/ionic-service-core/ionic-core.js',             /* Ionic.io libraries, to do: minify */
    './src/lib/ionic-service-analytics/ionic-analytics.js',   /* Ionic.io libraries, to do: minify */
    './src/lib/ionic-content-banner/dist/ionic.content.banner.min.js',
    './src/lib/angular-translate/angular-translate.min.js',
    './src/lib/angular-translate-loader-static-files/angular-translate-loader-static-files.min.js',
    './src/lib/fus-messages/dist/fus-messages.js',
    './src/lib/firebase/firebase.js',
    './src/lib/angularfire/dist/angularfire.min.js'
    ],
  dist: ['./www']
};

//
// === TOP LEVEL TASKS (invoke with "gulp <task-name>") ===
//

// default task for DEV

gulp.task('default', ['dev-config', 'dev-sass', 'inject-index']);

// watch task for DEV
//
// NOTE: inject-index commented out because this isn't reliable within the "watch" task - so, if you add or remove
// Javascript files and you want to inject them into index.html, then you just need to restart "ionic serve" so that
// the "default" task can re-run 'inject-index'

gulp.task('watch', function() {
  gulp.watch(paths.sass, ['dev-sass', 'inject-index']);
});

// karma tasks for TEST

var runtest = function (single) {
  karma.start({
    configFile: __dirname + '/karma.conf.js',
    singleRun: single,
    autoWatch: !single
  });
};

gulp.task('test', function (done) {
  runtest(false), done;<commit_msg>CRITICAL BUGFIX: took out 'inject-index' because this caused simple CSS/SASS changes to reload the whole page, which made simple styling changes slow and painful<commit_after>//
// BEGIN - gulp.js
//

//
// === DEPENDENCIES ===
//

var gulp = require('gulp');
var gutil = require('gulp-util');
var bower = require('bower');
var concat = require('gulp-concat');
var del = require('del');
var jshint = require('gulp-jshint');
var sass = require('gulp-sass');
var minifyCss = require('gulp-minify-css');
var sourcemap = require('gulp-sourcemaps');
var vinylPaths = require('vinyl-paths');
var rename = require('gulp-rename');
var ngAnnotate = require('gulp-ng-annotate');
var uglify = require("gulp-uglify");
var imagemin = require('gulp-imagemin');
var htmlreplace = require('gulp-html-replace');
var replace = require('gulp-replace');
var sh = require('shelljs');
var karma = require('karma').server;
var ngConstant = require('gulp-ng-constant');
var extend = require('gulp-extend');
var gulpif = require('gulp-if');
var minifyHtml    = require('gulp-minify-html');
var templateCache = require('gulp-angular-templatecache');
var inject = require('gulp-inject');

//
// === PATHS ===
//

// Files
//
// Note: change the 'ionicbundle' entry below from 'ionic.bundle.min.js' to 'ionic.bundle.js' to debug "moduleErr"
// errors in a production build ("gulp build") - see explanation:
//
// http://www.chrisgmyr.com/2014/08/debugging-uncaught-error-injectormodulerr-in-angularjs/
//
// (the unminified ionic.bundle.js needs to have the extra console.log statement as explained in the article)
//
var files = {
  jsbundle: 'app.bundle.min.js',
  appcss: 'app.css',
  ionicappmincss: 'ionic.app.min.css',
  ionicbundle: 'ionic.bundle.min.js'    // change to 'ionic.bundle.js' for debugging moduleErr errors
};
// Paths
var paths = {
  sass: ['./scss/**/*.scss'],
  css: ['./src/css/**/*.css'],
  scripts: [
    './src/js/**/*.js',
    '!./src/js/config/config.js'   /* exclude config.js: handled separately */
  ],
  injectedScripts: [
    './src/js/app/**/*.js',
    '!./src/js/app/app.js',                   /* exclude the root module ('app' module) files */
    '!./src/js/app/application.ctrl.js',      /* exclude the root module ('app' module) files */
    '!./src/js/app/application.service.js'    /* exclude the root module ('app' module) files */
  ],
  images: ['./src/img/**/*'],
  templates: ['./src/js/**/*.html'],
  indexTemplate: ['./src/index-template.html'],
  index: ['./src/index.html'],
  locales: [
    './src/js/locales/*.json'
  ],
  ionicfonts: ['./src/lib/ionic/fonts/*'],
  lib: [
    './src/lib/ionic/js/' + files.ionicbundle,
    './src/lib/parse/parse.min.js',
    './src/lib/angular-resource/angular-resource.min.js',
    './src/lib/angular-messages/angular-messages.min.js',
    './src/lib/angular-elastic/elastic.js',
    './src/lib/ngCordova/dist/ng-cordova.min.js',
    './src/lib/ionic-service-core/ionic-core.js',             /* Ionic.io libraries, to do: minify */
    './src/lib/ionic-service-analytics/ionic-analytics.js',   /* Ionic.io libraries, to do: minify */
    './src/lib/ionic-content-banner/dist/ionic.content.banner.min.js',
    './src/lib/angular-translate/angular-translate.min.js',
    './src/lib/angular-translate-loader-static-files/angular-translate-loader-static-files.min.js',
    './src/lib/fus-messages/dist/fus-messages.js',
    './src/lib/firebase/firebase.js',
    './src/lib/angularfire/dist/angularfire.min.js'
    ],
  dist: ['./www']
};

//
// === TOP LEVEL TASKS (invoke with "gulp <task-name>") ===
//

// default task for DEV

gulp.task('default', ['dev-config', 'dev-sass', 'inject-index']);

// watch task for DEV
//
// NOTE: inject-index does not run automatically within the "watch" task - so, if you add or remove Javascript files
// and you want to inject them into index.html, then you just need to restart "ionic serve" so that the "default" task
// can re-run 'inject-index'.

gulp.task('watch', function() {
  gulp.watch(paths.sass, ['dev-sass']);
});

// karma tasks for TEST

var runtest = function (single) {
  karma.start({
    configFile: __dirname + '/karma.conf.js',
    singleRun: single,
    autoWatch: !single
  });
};

gulp.task('test', function (done) {
  runtest(false), done;
{'fraction_non_alphanumeric': 0.19900023803856226, 'fraction_numerical': 0.0014282313734825041, 'mean_word_length': 3.280692817116658, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '3039439', 'n_tokens_mistral': 2968, 'n_tokens_neox': 2937, 'n_words': 623}