<commit_before>// Based on generator-webapp 0.4.9
'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) {

    // Load grunt tasks automatically
    require('load-grunt-tasks')(grunt);

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

    // Configurable paths
    var config = {
        app: 'dev',
        dist: 'public',
        sinatraApp: 'app',
        sinatraViews: '<%= config.sinatraApp %>/views',
        sinatraLayouts: '<%= config.sinatraViews %>/development/layouts'
    };

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

        // Project settings
        config: config,

        // Run shell commands
        shell: {
            restart: {
                options: {
                    stdout: false,
                    stderr: false,
                    async: true
                },
                command: 'touch tmp/restart.txt'
            }
        },

        // Watches files for changes and runs tasks based on the changed files
        watch: {
            // Disable bower-install for now. It doesn't quite meet our needs.
            //
            // bower: {
            //     files: ['bower.json'],
            //     tasks: ['bowerInstall']
            // },
            backend: {
                files: [
                    'Gemfile',
                    'Gemfile.lock',
                    'app/**/*.rb',
                    'app.rb',
                    'config.ru',
                    'lib/**/*.rb',
                ],
                tasks: ['shell:restart']
            },
            js: {
                files: ['<%= config.app %>/scripts/{,*/}*.js'],
                tasks: ['jshint'],
                options: {
                    livereload: true
                }
            },
            gruntfile: {
                files: ['Gruntfile.js']
            },
            compass: {
                files: ['<%= config.app %>/styles/{,*/}*.{scss,sass}'],
                tasks: ['compass:dev', 'autoprefixer']
            },
            styles: {
                files: ['<%= config.app %>/styles/{,*/}*.css'],
                tasks: ['newer:copy:styles', 'autoprefixer']
            },
            livereload: {
                options: {
                    livereload: 35729
                },
                files: [
                    '<%= config.app %>/{,*/}*.html',
                    '<%= config.app %>/tmp/styles/{,*/}*.css',
                    '<%= config.app %>/images/{,*/}*'
                ]
            }
        },

        // Empties folders to start fresh
        clean: {
            dist: {
                files: [{
                    dot: true,
                    src: [
                        '<%= config.app %>/tmp',
                        '<%= config.dist %>/*',
                        '!<%= config.dist %>/.git*'
                    ]
                }]
            },
            dev: '<%= config.app %>/tmp'
        },

        // Make sure code styles are up to par and there are no obvious mistakes
        jshint: {
            options: {
                jshintrc: '.jshintrc',
                reporter: require('jshint-stylish')
            },
            all: [
                'Gruntfile.js',
                '<%= config.app %>/scripts/{,*/}*.js',
                '!<%= config.app %>/scripts/vendor/*'
            ]
        },

        // Compiles Sass to CSS and generates necessary files if requested
        compass: {
            options: {
                sassDir: '<%= config.app %>/styles',
                cssDir: '<%= config.app %>/tmp/styles',
                generatedImagesDir: '<%= config.app %>/tmp/images/generated',
                imagesDir: '<%= config.app %>/images',
                javascriptsDir: '<%= config.app %>/scripts',
                fontsDir: '<%= config.app %>/styles/fonts',
                importPath: '<%= config.app %>/bower_components',
                httpImagesPath: '/images',
                httpGeneratedImagesPath: '/images/generated',
                httpFontsPath: '/styles/fonts',
                relativeAssets: false,
                assetCacheBuster: false
            },
            dist: {
                options: {
                    generatedImagesDir: '<%= config.dist %>/images/generated',
                    httpImagesPath: '../images',
                    httpGeneratedImagesPath: '../images/generated',
                    httpFontsPath: '../styles/fonts'
                }
            },
            dev: {
                options: {
                    debugInfo: true
                }
            }
        },
<commit_msg>Fixup path to generated images<commit_after>// Based on generator-webapp 0.4.9
'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) {

    // Load grunt tasks automatically
    require('load-grunt-tasks')(grunt);

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

    // Configurable paths
    var config = {
        app: 'dev',
        dist: 'public',
        sinatraApp: 'app',
        sinatraViews: '<%= config.sinatraApp %>/views',
        sinatraLayouts: '<%= config.sinatraViews %>/development/layouts'
    };

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

        // Project settings
        config: config,

        // Run shell commands
        shell: {
            restart: {
                options: {
                    stdout: false,
                    stderr: false,
                    async: true
                },
                command: 'touch tmp/restart.txt'
            }
        },

        // Watches files for changes and runs tasks based on the changed files
        watch: {
            // Disable bower-install for now. It doesn't quite meet our needs.
            //
            // bower: {
            //     files: ['bower.json'],
            //     tasks: ['bowerInstall']
            // },
            backend: {
                files: [
                    'Gemfile',
                    'Gemfile.lock',
                    'app/**/*.rb',
                    'app.rb',
                    'config.ru',
                    'lib/**/*.rb',
                ],
                tasks: ['shell:restart']
            },
            js: {
                files: ['<%= config.app %>/scripts/{,*/}*.js'],
                tasks: ['jshint'],
                options: {
                    livereload: true
                }
            },
            gruntfile: {
                files: ['Gruntfile.js']
            },
            compass: {
                files: ['<%= config.app %>/styles/{,*/}*.{scss,sass}'],
                tasks: ['compass:dev', 'autoprefixer']
            },
            styles: {
                files: ['<%= config.app %>/styles/{,*/}*.css'],
                tasks: ['newer:copy:styles', 'autoprefixer']
            },
            livereload: {
                options: {
                    livereload: 35729
                },
                files: [
                    '<%= config.app %>/{,*/}*.html',
                    '<%= config.app %>/tmp/styles/{,*/}*.css',
                    '<%= config.app %>/images/{,*/}*'
                ]
            }
        },

        // Empties folders to start fresh
        clean: {
            dist: {
                files: [{
                    dot: true,
                    src: [
                        '<%= config.app %>/tmp',
                        '<%= config.dist %>/*',
                        '!<%= config.dist %>/.git*'
                    ]
                }]
            },
            dev: '<%= config.app %>/tmp'
        },

        // Make sure code styles are up to par and there are no obvious mistakes
        jshint: {
            options: {
                jshintrc: '.jshintrc',
                reporter: require('jshint-stylish')
            },
            all: [
                'Gruntfile.js',
                '<%= config.app %>/scripts/{,*/}*.js',
                '!<%= config.app %>/scripts/vendor/*'
            ]
        },

        // Compiles Sass to CSS and generates necessary files if requested
        compass: {
            options: {
                sassDir: '<%= config.app %>/styles',
                cssDir: '<%= config.app %>/tmp/styles',
                generatedImagesDir: '<%= config.app %>/tmp/images/generated',
                imagesDir: '<%= config.app %>/images',
                javascriptsDir: '<%= config.app %>/scripts',
                fontsDir: '<%= config.app %>/styles/fonts',
                importPath: '<%= config.app %>/bower_components',
                httpImagesPath: '/images',
                httpGeneratedImagesPath: '/tmp/images/generated',
                httpFontsPath: '/styles/fonts',
                relativeAssets: false,
                assetCacheBuster: false
            },
            dist: {
                options: {
                    generatedImagesDir: '<%= config.dist %>/images/generated',
                    httpImagesPath: '../images',
                    httpGeneratedImagesPath: '../images/generated',
                    httpFontsPath: '../styles/fonts'
                }
            },
            dev: {
                options: {
                    debugInfo: true
                }
            }
        },

{'fraction_non_alphanumeric': 0.14206357370640882, 'fraction_numerical': 0.0016459212015224772, 'mean_word_length': 1.0597457627118645, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 47, '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': '5232609', 'n_tokens_mistral': 2666, 'n_tokens_neox': 2439, 'n_words': 544}