<commit_before>/*
 * Scale-Out-Agile
 * 
 * <NAME>
 * https://github.com/Scale-Out-Agile/Scale-Out-Agile.github.io
 * 
 * Copyright (c) 2014
 * Licensed under the MIT license.
 */

module.exports = function (grunt) {
    'use strict';

    // Project configuration.
    grunt.initConfig({

        // Project metadata
        pkg: grunt.file.readJSON('package.json'),
        vendor: grunt.file.readJSON('.bowerrc').directory,
        site: grunt.file.readYAML('_config.yml'),
        bootstrap: '<%= vendor %>/bootstrap',


        // Before generating any new files, remove files from previous build.
        clean: {
            site: ['<%= site.dest %>/**/*.*', '<%= site.dest %>/*/*/', '<%= site.dest %>/*/']
        },


        // Lint JavaScript
        jshint: {
            all: ['Gruntfile.js', 'templates/helpers/*.js'],
            options: {
                jshintrc: '.jshintrc'
            }
        },


        // Build HTML from templates and data
        assemble: {
            options: {
                flatten: true,
                production: true,
                assets: '<%= site.assets %>',
                postprocess: require('pretty'),

                // Metadata
                pkg: '<%= pkg %>',
                site: '<%= site %>',
                data: ['<%= site.data %>'],

                // Templates
                partials: '<%= site.includes %>',
                layoutdir: '<%= site.layouts %>',
                layout: '<%= site.layout %>',

                // Extensions
                helpers: '<%= site.helpers %>',
                plugins: '<%= site.plugins %>'
            },
            site: {
                files: { '<%= site.dest %>/': ['<%= site.templates %>/*.hbs'] }
            }
        },


        // Compile LESS to CSS
        less: {
            options: {
                vendor: 'vendor',
                paths: [
          '<%= site.theme %>',
          '<%= site.theme %>/bootstrap',
          '<%= site.theme %>/components',
          '<%= site.theme %>/utils'
        ]
            },
            site: {
                src: ['<%= site.theme %>/site.less'],
                dest: '<%= site.assets %>/css/site.css'
            }
        },


        // Copy Bootstrap's assets to site assets
        copy: {
            assets: {
                files: [
          { expand: true, cwd: '<%= bootstrap %>/dist/fonts', src: ['*.*'], dest: '<%= site.assets %>/fonts/' },
          { expand: true, cwd: '<%= bootstrap %>/dist/js', src: ['*.*'], dest: '<%= site.assets %>/js/' },
        ]
            }
        },

        watch: {
            all: {
                files: ['<%= jshint.all %>'],
                tasks: ['jshint', 'nodeunit']
            },
            site: {
                files: ['Gruntfile.js', '<%= less.options.paths %>/*.less', 'templates/**/*.hbs'],
                tasks: ['design']
            }
        },

        gitcheckout: {
            src: {
                options: {
                    branch: 'src'
                }
            },
            master: {
                options: {
                    branch: 'master'
                }
            }
        }
    });

    // Load npm plugins to provide necessary tasks.
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-readme');
    grunt.loadNpmTasks('grunt-sync-pkg');
    grunt.loadNpmTasks('grunt-git');
    grunt.loadNpmTasks('assemble-less');
    grunt.loadNpmTasks('assemble');

    // Build HTML, compile LESS and watch for changes. You must first run "bower install"
    // or install Bootstrap to the "vendor" directory before running this command.
    grunt.registerTask('design', ['clean', 'assemble', 'less:site', 'watch:site']);

    grunt.registerTask('docs', ['readme', 'sync']);

    grunt.registerTask('default', ['clean', 'jshint', 'copy:assets', 'assemble', 'less', 'docs']);

    grunt.registerTask('deploy', ['gitcheckout:master', 'gitcheckout:src']);
};<commit_msg>I think this is a complete deploy task. We shall see soon.<commit_after>/*
 * Scale-Out-Agile
 * 
 * <NAME>
 * https://github.com/Scale-Out-Agile/Scale-Out-Agile.github.io
 * 
 * Copyright (c) 2014
 * Licensed under the MIT license.
 */

module.exports = function (grunt) {
    'use strict';

    // Project configuration.
    grunt.initConfig({

        // Project metadata
        pkg: grunt.file.readJSON('package.json'),
        vendor: grunt.file.readJSON('.bowerrc').directory,
        site: grunt.file.readYAML('_config.yml'),
        bootstrap: '<%= vendor %>/bootstrap',


        // Before generating any new files, remove files from previous build.
        clean: {
            site: ['<%= site.dest %>/**/*.*', '<%= site.dest %>/*/*/', '<%= site.dest %>/*/']
        },


        // Lint JavaScript
        jshint: {
            all: ['Gruntfile.js', 'templates/helpers/*.js'],
            options: {
                jshintrc: '.jshintrc'
            }
        },


        // Build HTML from templates and data
        assemble: {
            options: {
                flatten: true,
                production: true,
                assets: '<%= site.assets %>',
                postprocess: require('pretty'),

                // Metadata
                pkg: '<%= pkg %>',
                site: '<%= site %>',
                data: ['<%= site.data %>'],

                // Templates
                partials: '<%= site.includes %>',
                layoutdir: '<%= site.layouts %>',
                layout: '<%= site.layout %>',

                // Extensions
                helpers: '<%= site.helpers %>',
                plugins: '<%= site.plugins %>'
            },
            site: {
                files: { '<%= site.dest %>/': ['<%= site.templates %>/*.hbs'] }
            }
        },


        // Compile LESS to CSS
        less: {
            options: {
                vendor: 'vendor',
                paths: [
          '<%= site.theme %>',
          '<%= site.theme %>/bootstrap',
          '<%= site.theme %>/components',
          '<%= site.theme %>/utils'
        ]
            },
            site: {
                src: ['<%= site.theme %>/site.less'],
                dest: '<%= site.assets %>/css/site.css'
            }
        },


        copy: {
            // Copy Bootstrap's assets to site assets
            assets: {
                files: [
          { expand: true, cwd: '<%= bootstrap %>/dist/fonts', src: ['*.*'], dest: '<%= site.assets %>/fonts/' },
          { expand: true, cwd: '<%= bootstrap %>/dist/js', src: ['*.*'], dest: '<%= site.assets %>/js/' },
        ]
            },
            // Copy the build dir to the root directory
            ghpages: {
                files: [{ expand: true, cwd: '<%= site.dest %>', src: ['**'], dest: ''}]
            }
        },

        watch: {
            all: {
                files: ['<%= jshint.all %>'],
                tasks: ['jshint', 'nodeunit']
            },
            site: {
                files: ['Gruntfile.js', '<%= less.options.paths %>/*.less', 'templates/**/*.hbs'],
                tasks: ['design']
            }
        },

        gitcheckout: {
            src: {
                options: {
                    branch: 'src'
                }
            },
            master: {
                options: {
                    branch: 'master'
                }
            }
        },

        gitstash: {
            save: {
                options: {
                    command: 'save',
                    create: true,
                    stash: 6
                }
            },
            restore: {
                options: {
                    command: 'apply',
                    staged: true,
                    stash: 6
                }
            }
        },

        gitcommit: {
            deploy: {
                options: {
                    message: 'Deploy latest to production.'
                },
                files: ['**']
            }
        }
    });

    // Load npm plugins to provide necessary tasks.
    grunt.loadNpmTasks('grunt-contrib-clean');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-watch');
    grunt.loadNpmTasks('grunt-readme');
    grunt.loadNpmTasks('grunt-sync-pkg');
    grunt.loadNpmTasks('grunt-git');
    grunt.loadNpmTasks('assemble-less');
    grunt.loadNpmTasks('assemble');

    // Build HTML, compile LESS and watch for changes. You must first run "bower install"
    // or install Bootstrap to the "vendor" directory before running this command.
    grunt.registerTask('design', ['clean', 'assemble', 'less', 'watch:site']);

    grunt.registerTask('docs', ['readme', 'sync']);

    grunt.registerTask('default', ['clean', 'jshint', 'copy:assets', 'assemble', 'less', 'docs']);

    grunt.registerTask('deploy', [
        'gitstash:save', 'gitcheckout:master',
        'copy:ghpages', 'gitcommit:deploy',
        'gitcheckout:src', 'gitstash:restore'
    ]);

    grunt.registerTask('recover', ['gitstash:restore']);
};
{'fraction_non_alphanumeric': 0.17092720970537262, 'fraction_numerical': 0.0010831889081455806, 'mean_word_length': 1.3938294010889292, 'pattern_counts': {'":': 0, '<': 60, '<?xml version=': 0, '>': 60, 'https://': 2, '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': '1140642', 'n_tokens_mistral': 2792, 'n_tokens_neox': 2558, 'n_words': 515}