<commit_before>// generated on 2016-09-04 using generator-webapp 2.1.0
const gulp = require('gulp');
var connect = require('gulp-connect');
var phpconnect = require('gulp-connect-php');
var modrewrite = require('connect-modrewrite');
const gulpLoadPlugins = require('gulp-load-plugins');
const browserSync = require('browser-sync');
const del = require('del');
const wiredep = require('wiredep').stream;

const $ = gulpLoadPlugins();
const reload = browserSync.reload;

gulp.task('styles', () => {
  return gulp.src('app/styles/**/*.scss')
    .pipe($.plumber())
    .pipe($.sourcemaps.init())
    .pipe($.sass.sync({
      outputStyle: 'expanded',
      precision: 10,
      includePaths: ['.']
    }).on('error', $.sass.logError))
    .pipe($.autoprefixer({
      browsers: ['> 1%', 'last 2 versions', 'Firefox ESR']
    }))
    .pipe($.sourcemaps.write())
    .pipe(gulp.dest('.tmp/styles'))
    .pipe(reload({
      stream: true
    }));
})
gulp.task('scripts', () => {
  return gulp.src('app/scripts/**/*.js')
    .pipe($.plumber())
    .pipe($.sourcemaps.init())
    .pipe($.babel())
    .pipe($.sourcemaps.write('.'))
    .pipe(gulp.dest('.tmp/scripts'))
    .pipe(reload({
      stream: true
    }));
})
function lint(files, options) {
  return gulp.src(files)
    .pipe(reload({
      stream: true,
      once: true
    }))
    .pipe($.eslint(options))
    .pipe($.eslint.format())
    .pipe($.if(!browserSync.active, $.eslint.failAfterError()));
}

gulp.task('lint', () => {
  return lint('app/scripts/**/*.js', {
      fix: true
    })
    .pipe(gulp.dest('app/scripts'));
})
gulp.task('lint:test', () => {
  return lint('test/spec/**/*.js', {
      fix: true,
      env: {
        mocha: true
      }
    })
    .pipe(gulp.dest('test/spec/**/*.js'));
})
gulp.task('html', ['styles', 'scripts'], () => {
  return gulp.src('app/**/*.php')
    .pipe($.useref({
      searchPath: ['.tmp', 'app', '.']
    }))
    .pipe($.if('*.js', $.uglify()))
    .pipe($.if('*.css', $.cssnano({
      safe: true,
      autoprefixer: false
    })))
    .pipe(gulp.dest('dist'));
})
gulp.task('images', () => {
  return gulp.src('app/images/**/*')
    .pipe($.cache($.imagemin({
      progressive: true,
      interlaced: true,
      // don't remove IDs from SVGs, they are often used
      // as hooks for embedding and styling
      svgoPlugins: [{
        cleanupIDs: false
      }]
    })))
    .pipe(gulp.dest('dist/images'));
})
gulp.task('fonts', () => {
  return gulp.src(require('main-bower-files')('**/*.{eot,svg,ttf,woff,woff2}', function(err) {})
      .concat('app/fonts/**/*'))
    .pipe(gulp.dest('.tmp/fonts'))
    .pipe(gulp.dest('dist/fonts'));
})
gulp.task('extras', () => {
  return gulp.src([
    'app/*.*',
    '!app/*.php'
  ], {
    dot: true
  }).pipe(gulp.dest('dist'));
})
gulp.task('clean', del.bind(null, ['.tmp', 'dist']));

gulp.task('serve-php', ['styles', 'scripts', 'fonts'], function() {
  phpconnect.server({
    base: 'app'
  }, function() {
    // connect is required to serve static assets from multiple roots
    connect.server({
      port: 8001,
      root: ['.', '.tmp', 'node_modules'],
      middleware: function() {
        return [
          // urls without extensions or with php extension should
          // be proxied to php. This prevents dots in urls, though.
          modrewrite([
            '^([^.]*|.*?\.php)$ http://localhost:8000$1 [P,NC]'
          ])
        ];
      }
    });
    browserSync.init({
      proxy: 'localhost:8001'
    });
  });
  gulp.watch([
    'app/*.php',
    'app/**/*.php',
    'app/images/**/*',
    '.tmp/fonts/**/*'
  ]).on('change', reload);

  gulp.watch('app/styles/**/*.scss', ['styles']);
  gulp.watch('app/scripts/**/*.js', ['scripts']);
  gulp.watch('app/fonts/**/*', ['fonts']);
  gulp.watch('bower.json', ['wiredep', 'fonts']);
});

gulp.task('serve', ['styles', 'scripts', 'fonts'], () => {
  browserSync({
    notify: false,
    port: 9000,
    server: {
      baseDir: ['.tmp', 'app'],
      routes: {
        '/bower_components': 'bower_components'<commit_msg>fixed get request not working<commit_after>// generated on 2016-09-04 using generator-webapp 2.1.0
const gulp = require('gulp');
var connect = require('gulp-connect');
var phpconnect = require('gulp-connect-php');
var modrewrite = require('connect-modrewrite');
const gulpLoadPlugins = require('gulp-load-plugins');
const browserSync = require('browser-sync');
const del = require('del');
const wiredep = require('wiredep').stream;

const $ = gulpLoadPlugins();
const reload = browserSync.reload;

gulp.task('styles', () => {
  return gulp.src('app/styles/**/*.scss')
    .pipe($.plumber())
    .pipe($.sourcemaps.init())
    .pipe($.sass.sync({
      outputStyle: 'expanded',
      precision: 10,
      includePaths: ['.']
    }).on('error', $.sass.logError))
    .pipe($.autoprefixer({
      browsers: ['> 1%', 'last 2 versions', 'Firefox ESR']
    }))
    .pipe($.sourcemaps.write())
    .pipe(gulp.dest('.tmp/styles'))
    .pipe(reload({
      stream: true
    }));
})
gulp.task('scripts', () => {
  return gulp.src('app/scripts/**/*.js')
    .pipe($.plumber())
    .pipe($.sourcemaps.init())
    .pipe($.babel())
    .pipe($.sourcemaps.write('.'))
    .pipe(gulp.dest('.tmp/scripts'))
    .pipe(reload({
      stream: true
    }));
})
function lint(files, options) {
  return gulp.src(files)
    .pipe(reload({
      stream: true,
      once: true
    }))
    .pipe($.eslint(options))
    .pipe($.eslint.format())
    .pipe($.if(!browserSync.active, $.eslint.failAfterError()));
}

gulp.task('lint', () => {
  return lint('app/scripts/**/*.js', {
      fix: true
    })
    .pipe(gulp.dest('app/scripts'));
})
gulp.task('lint:test', () => {
  return lint('test/spec/**/*.js', {
      fix: true,
      env: {
        mocha: true
      }
    })
    .pipe(gulp.dest('test/spec/**/*.js'));
})
gulp.task('html', ['styles', 'scripts'], () => {
  return gulp.src('app/**/*.php')
    .pipe($.useref({
      searchPath: ['.tmp', 'app', '.']
    }))
    .pipe($.if('*.js', $.uglify()))
    .pipe($.if('*.css', $.cssnano({
      safe: true,
      autoprefixer: false
    })))
    .pipe(gulp.dest('dist'));
})
gulp.task('images', () => {
  return gulp.src('app/images/**/*')
    .pipe($.cache($.imagemin({
      progressive: true,
      interlaced: true,
      // don't remove IDs from SVGs, they are often used
      // as hooks for embedding and styling
      svgoPlugins: [{
        cleanupIDs: false
      }]
    })))
    .pipe(gulp.dest('dist/images'));
})
gulp.task('fonts', () => {
  return gulp.src(require('main-bower-files')('**/*.{eot,svg,ttf,woff,woff2}', function(err) {})
      .concat('app/fonts/**/*'))
    .pipe(gulp.dest('.tmp/fonts'))
    .pipe(gulp.dest('dist/fonts'));
})
gulp.task('extras', () => {
  return gulp.src([
    'app/*.*',
    '!app/*.php'
  ], {
    dot: true
  }).pipe(gulp.dest('dist'));
})
gulp.task('clean', del.bind(null, ['.tmp', 'dist']));

gulp.task('serve-php', ['styles', 'scripts', 'fonts'], function() {
  phpconnect.server({
    base: 'app'
  }, function() {
    // connect is required to serve static assets from multiple roots
    connect.server({
      port: 8001,
      root: ['.', '.tmp', 'node_modules'],
      middleware: function() {
        return [
          // urls without extensions or with php extension should
          // be proxied to php. This prevents dots in urls, though.
          modrewrite([
            '^([^.]*|.*?\.php\\??.*)$ http://localhost:8000$1 [P,NC]'
          ])
        ];
      }
    });
    browserSync.init({
      proxy: 'localhost:8001'
    });
  });
  gulp.watch([
    'app/*.php',
    'app/**/*.php',
    'app/images/**/*',
    '.tmp/fonts/**/*'
  ]).on('change', reload);

  gulp.watch('app/styles/**/*.scss', ['styles']);
  gulp.watch('app/scripts/**/*.js', ['scripts']);
  gulp.watch('app/fonts/**/*', ['fonts']);
  gulp.watch('bower.json', ['wiredep', 'fonts']);
});

gulp.task('serve', ['styles', 'scripts', 'fonts'], () => {
  browserSync({
    notify: false,
    port: 9000,
    server: {
      baseDir: ['.tmp', 'app'],
      routes: {
        '/bower_components': 'bower_components'
{'fraction_non_alphanumeric': 0.2404035433070866, 'fraction_numerical': 0.00812007874015748, 'mean_word_length': 2.7564695009242146, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, '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': '3039494', 'n_tokens_mistral': 2968, 'n_tokens_neox': 2877, 'n_words': 505}