<commit_before>// Generated on 2016-01-05 using generator-angular 0.15.1
'use strict';

// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'

module.exports = function (grunt) {

  var merge = require('merge');

  // Time how long tasks take. Can help when optimizing build times
  require('time-grunt')(grunt);

  // Automatically load required Grunt tasks
  require('jit-grunt')(grunt, {
    useminPrepare: 'grunt-usemin',
    ngtemplates: 'grunt-angular-templates'
  });

  // Configurable paths for the application
  var appConfig = {
    app: 'app',
    dist: 'build/dist/ui'
  };

  var externalAppConfig = require('./config.json');
  appConfig = merge(appConfig, externalAppConfig);

  // Connect function to serve a Javascript configuration file
  var javascriptConfigMiddleware = function (req, res) {
    var config = {
      apiBaseUri: appConfig.api.baseUri
    };

    res.writeHead(200, {'Content-Type': 'application/javascript'});
    res.end('var configuration = ' + JSON.stringify(config) + ';');
  };

  // Define the configuration for all the tasks
  grunt.initConfig({

    // Project settings
    yeoman: appConfig,

    // Watches files for changes and runs tasks based on the changed files
    watch: {
      bower: {
        files: ['bower.json'],
        tasks: ['wiredep']
      },
      js: {
        files: ['<%= yeoman.app %>/scripts/{,*/}*.js'],
        tasks: ['newer:jshint:all', 'newer:jscs:all'],
        options: {
          livereload: '<%= connect.options.livereload %>'
        }
      },
      jsTest: {
        files: ['test/spec/{,*/}*.js'],
        tasks: ['newer:jshint:test', 'newer:jscs:test', 'karma']
      },
      compass: {
        files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
        tasks: ['compass:server', 'postcss:server']
      },
      gruntfile: {
        files: ['Gruntfile.js']
      },
      livereload: {
        options: {
          livereload: '<%= connect.options.livereload %>'
        },
        files: [
          '<%= yeoman.app %>/{,*/}*.html',
          '.tmp/styles/{,*/}*.css',
          '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
        ]
      }
    },

    // The actual grunt server settings
    connect: {
      options: {
        port: '<%= yeoman.serve.port %>',
        hostname: '<%= yeoman.serve.host %>',
        livereload: '<%= yeoman.serve.livereload %>'
      },
      livereload: {
        options: {
          open: true,
          middleware: function (connect) {
            return [
              connect().use(
                '/scripts/config.js',
                javascriptConfigMiddleware
              ),
              connect.static('.tmp'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect().use(
                '/app/styles',
                connect.static('./app/styles')
              ),
              connect.static(appConfig.app)
            ];
          }
        }
      },
      test: {
        options: {
          port: '<%= yeoman.test.port %>',
          middleware: function (connect) {
            return [
              connect().use(
                '/scripts/config.js',
                javascriptConfigMiddleware
              ),
              connect.static('.tmp'),
              connect.static('test'),
              connect().use(<commit_msg>Rebuild CSS on change<commit_after>// Generated on 2016-01-05 using generator-angular 0.15.1
'use strict';

// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'

module.exports = function (grunt) {

  var merge = require('merge');

  // Time how long tasks take. Can help when optimizing build times
  require('time-grunt')(grunt);

  // Automatically load required Grunt tasks
  require('jit-grunt')(grunt, {
    useminPrepare: 'grunt-usemin',
    ngtemplates: 'grunt-angular-templates'
  });

  // Configurable paths for the application
  var appConfig = {
    app: 'app',
    dist: 'build/dist/ui'
  };

  var externalAppConfig = require('./config.json');
  appConfig = merge(appConfig, externalAppConfig);

  // Connect function to serve a Javascript configuration file
  var javascriptConfigMiddleware = function (req, res) {
    var config = {
      apiBaseUri: appConfig.api.baseUri
    };

    res.writeHead(200, {'Content-Type': 'application/javascript'});
    res.end('var configuration = ' + JSON.stringify(config) + ';');
  };

  // Define the configuration for all the tasks
  grunt.initConfig({

    // Project settings
    yeoman: appConfig,

    // Watches files for changes and runs tasks based on the changed files
    watch: {
      bower: {
        files: ['bower.json'],
        tasks: ['wiredep']
      },
      js: {
        files: ['<%= yeoman.app %>/scripts/{,*/}*.js'],
        tasks: ['newer:jshint:all', 'newer:jscs:all'],
        options: {
          livereload: '<%= connect.options.livereload %>'
        }
      },
      css: {
        files: ['<%= yeoman.app %>/styles/{,*/}*.css'],
        tasks: ['copy:styles', 'newer:postcss:server']
      },
      jsTest: {
        files: ['test/spec/{,*/}*.js'],
        tasks: ['newer:jshint:test', 'newer:jscs:test', 'karma']
      },
      gruntfile: {
        files: ['Gruntfile.js']
      },
      livereload: {
        options: {
          livereload: '<%= connect.options.livereload %>'
        },
        files: [
          '<%= yeoman.app %>/{,*/}*.html',
          '.tmp/styles/{,*/}*.css',
          '<%= yeoman.app %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
        ]
      }
    },

    // The actual grunt server settings
    connect: {
      options: {
        port: '<%= yeoman.serve.port %>',
        hostname: '<%= yeoman.serve.host %>',
        livereload: '<%= yeoman.serve.livereload %>'
      },
      livereload: {
        options: {
          open: true,
          middleware: function (connect) {
            return [
              connect().use(
                '/scripts/config.js',
                javascriptConfigMiddleware
              ),
              connect.static('.tmp'),
              connect().use(
                '/bower_components',
                connect.static('./bower_components')
              ),
              connect.static(appConfig.app)
            ];
          }
        }
      },
      test: {
        options: {
          port: '<%= yeoman.test.port %>',
          middleware: function (connect) {
            return [
              connect().use(
                '/scripts/config.js',
                javascriptConfigMiddleware
              ),
              connect.static('.tmp'),
              connect.static('test'),
              connect().use(
{'fraction_non_alphanumeric': 0.16065007910254567, 'fraction_numerical': 0.004314684308931396, 'mean_word_length': 1.8372093023255813, 'pattern_counts': {'":': 0, '<': 23, '<?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': '5807355', 'n_tokens_mistral': 2132, 'n_tokens_neox': 2022, 'n_words': 423}