<commit_before>var path = require('path');

module.exports = function(grunt) {

  grunt.initConfig({

    jshint: {
      options: {
        curly: true,
        eqeqeq: true,
        immed: true,
        latedef: true,
        newcap: true,
        noarg: true,
        sub: true,
        undef: true,
        unused: true,
        boss: true,
        eqnull: true,
        node: true,
        loopfunc: true,
        indent: 2,
      },
      gruntfile: {
        src: 'Gruntfile.js'
      },
      api: {
        src: [
          'src/api/**/*.js',
        ]
      },
      ui: {
        src: [
          'src/casgraph/**/*.js',
          'src/inspect/**/*.js',
          'src/latheapi/**/*.js',
          'src/layers/**/*.js',
          'src/modelviews/**/*.js',
          'src/scripting/**/*.js',
          'src/toolbars/**/*.js',
          'src/*.js',
        ],
        options: {
          globals: {
            "alert": false,
            "window": false,
            "document": false,
            "define": false,
            "postMessage": false,
            "indexedDB": false,
            "Worker": false,
            "importScripts": false,
            "history": false,
            "requestAnimationFrame": false,
            "THREE": false,
            "$": false,
            "requirejs": true,
            "dat": false,
            "Stats": false,
            "Shapesmith": false,
            "Blob": false,
            "FileReader": false,
            "saveAs": false
          },
        },
      },
      unit: {
        src: ['test/unit*.js', 'test/unit/**/*.js'],
        options: {
          globals: {
            define: false,
            describe: false,
            before: false,
            beforeEach: false,
            after: false,
            afterEach: false,
            it: false,
            requirejs: true,
            assert: true,
            chai: true,
            mocha: false,
          },
        },
      },
    },

    less: {
      all: {
        files: {
          './static/css/designs.css'     : 'static/css/less/designs.less',
          './static/css/signinsignup.css': 'static/css/less/signinsignup.less',
          './static/css/landing.css'     : 'static/css/less/landing.less',
          './static/css/grid.css'        : 'static/css/less/grid.less',
          './static/css/shapesmith.css'  : 'static/css/less/shapesmith.less',
        },
      },
    },

    watch: {
      gruntfile: {
        files: '<%= jshint.gruntfile.src %>',
        tasks: ['jshint:gruntfile']
      },
      api: {
        files: '<%= jshint.api.src %>',
        tasks: ['jshint:api', 'simplemocha:unit'],
      },
      ui: {
        files: '<%= jshint.ui.src %>',
        tasks: ['jshint:ui', 'simplemocha:unit']
      },
      unit: {
        files: '<%= jshint.unit.src %>',
        tasks: ['jshint:unit', 'simplemocha:unit']
      },
      less: {
        files: 'static/css/**/*.less',
        tasks: ['less'],
      }
    },

    simplemocha: {
      options: {
        timeout: 3000,
        slow: 5000,
        ignoreLeaks: false,
        ui: 'bdd',
        reporter: 'spec',
        path: 'test'
      },

      unit: {
        src: 'test/unit.js',
      },
      functional: {
        src: [
          'test/functional/points.test.js',
          'test/functional/polylines.test.js',
        ],
      },
    },

    requirejs: {
      compile: {
        options: {
          appDir: ".",
          baseUrl: "src",
          dir: "build",
          optimize: "none",
          mainConfigFile: "src/main.ui.js",
          modules: [
            {
              name: "main.ui"
            },
            {
              name: "main.designs",
            },
            {
              name: "worker",
            }
          ],
          fileExclusionRegExp: /(^\.|^bin$|^artwork$|^.*.db$|^.db$|^test|^grunt.*$|^mocha$|^chai$|^webdriverjs$)/,
        }
      }
    },

    uglify: {
      main_ui: {
        files: {
          'build/src/main.ui.js': ['build/src/main.ui.js']
        }
      },
      main_designs: {
        files: {
          'build/src/main.designs.js': ['build/src/main.designs.js']
        }
      },
      worker: {
        files: {
          'build/src/worker.js': ['build/src/worker.js']
        }
      },
    },

    express: {
      server: {
        options: {
          port: 8001,
          server: path.resolve('./src/api/server.js')
        }
      }
    },

    exec: {
      fix_worker: {
        cmd: 'echo "importScripts(\'/lib/require.js\');" > /tmp/worker.js; cat build/src/worker.js >> /tmp/worker.js; mv /tmp/worker.js build/src/worker.js '
      }
    },

  });

  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-less');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-requirejs');
  grunt.loadNpmTasks('grunt-simple-mocha');
  grunt.loadNpmTasks('grunt-express');
  grunt.loadNpmTasks('grunt-exec');

  // Unit testing
  grunt.registerTask('unit', ['jshint:unit', 'simplemocha:unit']);
  grunt.registerTask('test', ['jshint:api', 'jshint:ui', 'unit']);

  // Functional testing - requires a running server
  process.env['app_env'] = 'functional';
  grunt.registerTask('functional', ['express', 'simplemocha:functional']);

  // Build the single JS file
  grunt.registerTask('build', ['requirejs', 'exec:fix_worker', 'uglify']);

};
<commit_msg>trace requirejs exclusions/config. final trace<commit_after>var path = require('path');

module.exports = function(grunt) {

  grunt.initConfig({

    jshint: {
      options: {
        curly: true,
        eqeqeq: true,
        immed: true,
        latedef: true,
        newcap: true,
        noarg: true,
        sub: true,
        undef: true,
        unused: true,
        boss: true,
        eqnull: true,
        node: true,
        loopfunc: true,
        indent: 2,
      },
      gruntfile: {
        src: 'Gruntfile.js'
      },
      api: {
        src: [
          'src/api/**/*.js',
        ]
      },
      ui: {
        src: [
          'src/casgraph/**/*.js',
          'src/inspect/**/*.js',
          'src/latheapi/**/*.js',
          'src/layers/**/*.js',
          'src/modelviews/**/*.js',
          'src/scripting/**/*.js',
          'src/toolbars/**/*.js',
          'src/*.js',
        ],
        options: {
          globals: {
            "alert": false,
            "window": false,
            "document": false,
            "define": false,
            "postMessage": false,
            "indexedDB": false,
            "Worker": false,
            "importScripts": false,
            "history": false,
            "requestAnimationFrame": false,
            "THREE": false,
            "$": false,
            "requirejs": true,
            "dat": false,
            "Stats": false,
            "Shapesmith": false,
            "Blob": false,
            "FileReader": false,
            "saveAs": false
          },
        },
      },
      unit: {
        src: ['test/unit*.js', 'test/unit/**/*.js'],
        options: {
          globals: {
            define: false,
            describe: false,
            before: false,
            beforeEach: false,
            after: false,
            afterEach: false,
            it: false,
            requirejs: true,
            assert: true,
            chai: true,
            mocha: false,
          },
        },
      },
    },

    less: {
      all: {
        files: {
          './static/css/designs.css'     : 'static/css/less/designs.less',
          './static/css/signinsignup.css': 'static/css/less/signinsignup.less',
          './static/css/landing.css'     : 'static/css/less/landing.less',
          './static/css/grid.css'        : 'static/css/less/grid.less',
          './static/css/shapesmith.css'  : 'static/css/less/shapesmith.less',
        },
      },
    },

    watch: {
      gruntfile: {
        files: '<%= jshint.gruntfile.src %>',
        tasks: ['jshint:gruntfile']
      },
      api: {
        files: '<%= jshint.api.src %>',
        tasks: ['jshint:api', 'simplemocha:unit'],
      },
      ui: {
        files: '<%= jshint.ui.src %>',
        tasks: ['jshint:ui', 'simplemocha:unit']
      },
      unit: {
        files: '<%= jshint.unit.src %>',
        tasks: ['jshint:unit', 'simplemocha:unit']
      },
      less: {
        files: 'static/css/**/*.less',
        tasks: ['less'],
      }
    },

    simplemocha: {
      options: {
        timeout: 3000,
        slow: 5000,
        ignoreLeaks: false,
        ui: 'bdd',
        reporter: 'spec',
        path: 'test'
      },

      unit: {
        src: 'test/unit.js',
      },
      functional: {
        src: [
          'test/functional/points.test.js',
          'test/functional/polylines.test.js',
        ],
      },
    },

    requirejs: {
      compile: {
        options: {
          appDir: ".",
          baseUrl: "src",
          dir: "build",
          optimize: "none",
          mainConfigFile: "src/main.ui.js",
          modules: [
            {
              name: "main.ui"
            },
            {
              name: "main.designs",
            },
            {
              name: "worker",
            }
          ],
          fileExclusionRegExp: /(^\.|^release.*$|^bin$|^artwork$|^.*.db$|^.db$|^test|^grunt.*$|^mocha$|^chai$|^webdriverjs$)/,
        }
      }
    },

    uglify: {
      main_ui: {
        files: {
          'build/src/main.ui.js': ['build/src/main.ui.js']
        }
      },
      main_designs: {
        files: {
          'build/src/main.designs.js': ['build/src/main.designs.js']
        }
      },
      worker: {
        files: {
          'build/src/worker.js': ['build/src/worker.js']
        }
      },
    },

    express: {
      server: {
        options: {
          port: 8001,
          server: path.resolve('./src/api/server.js')
        }
      }
    },

    exec: {
      fix_worker: {
        cmd: 'echo "importScripts(\'/lib/require.js\');" > /tmp/worker.js; cat build/src/worker.js >> /tmp/worker.js; mv /tmp/worker.js build/src/worker.js '
      }
    },

  });

  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-contrib-less');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-contrib-requirejs');
  grunt.loadNpmTasks('grunt-simple-mocha');
  grunt.loadNpmTasks('grunt-express');
  grunt.loadNpmTasks('grunt-exec');

  // Unit testing
  grunt.registerTask('unit', ['jshint:unit', 'simplemocha:unit']);
  grunt.registerTask('test', ['jshint:api', 'jshint:ui', 'unit']);

  // Functional testing - requires a running server
  process.env['app_env'] = 'functional';
  grunt.registerTask('functional', ['express', 'simplemocha:functional']);

  // Build the single JS file
  grunt.registerTask('build', ['requirejs', 'exec:fix_worker', 'uglify']);

};
<|endoftext|>


<commit_before>// Gruntfile.js
// our wrapper function (required by grunt and its plugins)
// all configuration goes inside this function
exec = require('exec');
//var exec = require('child_process').exec

module.exports = function(grunt) {

  require('load-grunt-tasks')(grunt);
  // ===========================================================================
  // CONFIGURE GRUNT ===========================================================
  // ===========================================================================
  grunt.initConfig({

    // get the configuration info from package.json ----------------------------
    // this way we can use things like name and version (pkg.name)
    pkg: grunt.file.readJSON('package.json'),

    browserify: {
      dist: {
        files: {
          'assets/js/bundle.js': ['source/js/app.js']
        }
      }
    },
    sass: {
        options: {
            sourceMap: false
        },
        dist: {
            files: {
                'assets/css/styles.css': 'source/sass/styles.sass'
            }
        }
    },
    watch: {
      scripts: {
        files: ['source/**/*.js', 'source/**/*.sass', '**/*.html'],
        tasks: ['build'],
        options: {
          debounceDelay: 250,
        },
      },
    },
    callback:{}
  });

grunt.registerTask('callback', 'A sample task that logs stuff.', function() {
    exec('git add . && git commit -m "Update num: ' + Date.now() + ' "',
      function(err, out, code) {
      if (err instanceof Error)
        throw err;
      process.stdout.write(out);
      process.exit(code);
    });
});

  grunt.event.on('callback', function(action, filepath, target) {
    console.log('foi callback')
  });

  // ===========================================================================
  // LOAD GRUNT PLUGINS ========================================================
  // ===========================================================================
  // we can only load these if they are in our package.json
  // make sure you have run npm install so our app can find these
  grunt.registerTask('build', ['browserify', 'sass', 'callback']);
};<commit_msg>Update num: 1478205383115<commit_after>// Gruntfile.js
// our wrapper function (required by grunt and its plugins)
// all configuration goes inside this function
exec = require('exec');
//var exec = require('child_process').exec

module.exports = function(grunt) {

  require('load-grunt-tasks')(grunt);
  // ===========================================================================
  // CONFIGURE GRUNT ===========================================================
  // ===========================================================================
  grunt.initConfig({

    // get the configuration info from package.json ----------------------------
    // this way we can use things like name and version (pkg.name)
    pkg: grunt.file.readJSON('package.json'),

    browserify: {
      dist: {
        files: {
          'assets/js/bundle.js': ['source/js/app.js']
        }
      }
    },
    sass: {
        options: {
            sourceMap: false
        },
        dist: {
            files: {
                'assets/css/styles.css': 'source/sass/styles.sass'
            }
        }
    },
    watch: {
      scripts: {
        files: ['source/**/*.js', 'source/**/*.sass', '**/*.html'],
        tasks: ['build'],
        options: {
          debounceDelay: 250,
        },
      },
    },
    callback:{}
  });

grunt.registerTask('callback', 'A sample task that logs stuff.', function() {
    exec('git add . && git commit -m "Update num: ' + Date.now() + ' " && git push origin master',
      function(err, out, code) {
      if (err instanceof Error)
        throw err;
      process.stdout.write(out);
      process.exit(code);
    });
});

  grunt.event.on('callback', function(action, filepath, target) {
    console.log('foi callback')
  });

  // ===========================================================================
  // LOAD GRUNT PLUGINS ========================================================
  // ===========================================================================
  // we can only load these if they are in our package.json
  // make sure you have run npm install so our app can find these
  grunt.registerTask('build', ['browserify', 'sass', 'callback']);
};<|endoftext|>


<commit_before>
$(document).ready(function(){
    $('.button-collapse').sideNav({
        closeOnClick: true
    });
    $('.button-collapse-right').sideNav({
        edge: 'right',
        closeOnClick: true
    });
    $('.modal-trigger').leanModal();
    $('.dropdown').dropdown();
});

function getQueryString(field, isArray = false) {
    var target = window.location.href;
    var reg = new RegExp('[?&]' + field + '=([^&#]*)', 'ig');

    var values = [];
    while(true) {
        var matches = reg.exec(target);
        if (matches) {
            values.push(matches[1]);
        } else {
            break;
        }
    }

    if (!values.length) {
        return null;
    } else {
        return isArray ? values : values[0];
    }
}

function getQueryStringWithStorageBacking(field, defaultVal, isArray = false) {
    var val = getQueryString(field, isArray);
    if (val === null && sessionStorage.getItem(field)) {
        try {
            val = JSON.parse(sessionStorage.getItem(field));
        } catch(ex) {
            console.warn("Failed to retrieve value of '%s' in sessionStorage. Error: %s", field, ex);
        }
    }

    if (val === null) {
        val = defaultVal;
    }

    trySaveToSessionStorage(field, JSON.stringify(val));

    return val;
}

function trySaveToSessionStorage(field, stringVal) {
    try {
        sessionStorage.setItem(field, stringVal);
    } catch (ex) {
        console.warn("Failed to save value of '%s' in sessionStorage. Error: %s", field, ex);
    }
}

function showBusy(text) {
    $('#busy-message').text(text);
    $('#busy-dialog').openModal({
        dismissible: false
    });
}

function hideBusy() {
    $('#busy-dialog').closeModal();
}

function showConfirmation(title, icon, message, yesCallback) {
    $('#confirmation-title').text(title);
    $('#confirmation-image').text(icon);
    $('#confirmation-message').text(message);
    $('#confirmation-yes')[0].onclick = yesCallback;
    $('#confirmation-dialog').openModal();
}

const API_BASE_PATH = '/api/v1';

function getAsync(url, data = null) {
    return $.ajax({
        url: url,
        method: 'GET',
        contentType: 'application/json',
        dataType: 'json',
        data: data
    });
}

function putAsync(url, data) {
    return $.ajax({
        url: url,
        method: 'POST',
        contentType: 'application/json',
        dataType: 'text',
        processData: false,
        data: data
    });
}

function postAsync(url, data) {
    return $.ajax({
        url: url,
        method: 'POST',
        contentType: 'application/json',
        dataType: 'text',
        processData: false,
        data: data
    });
}

function deleteAsync(url) {
    return $.ajax({
        url: url,
        method: 'DELETE',
        contentType: 'application/json',
        dataType: 'text'
    });
}

function getRecipesAsync(rootUrlPath, searchFilter) {
    return getAsync(rootUrlPath + API_BASE_PATH + '/recipes', searchFilter);
}

function getRecipeAsync(rootUrlPath, recipeId) {
    return getAsync(rootUrlPath + API_BASE_PATH + '/recipes/' + recipeId);
}

function postRecipeAsync(rootUrlPath, recipe) {
    return postAsync(rootUrlPath + API_BASE_PATH + '/recipes', JSON.stringify(recipe));
}

function putRecipeAsync(rootUrlPath, recipe) {
    return putAsync(rootUrlPath + API_BASE_PATH + '/recipes' + recipe.id, JSON.stringify(recipe));
}

function deleteRecipeAsync(rootUrlPath, recipeId) {
    return deleteAsync(rootUrlPath + API_BASE_PATH + '/recipes/' + recipeId);
}

function getRecipeMainImageAsync(rootUrlPath, recipeId) {
    return getAsync(rootUrlPath + API_BASE_PATH + '/recipes/' + recipeId + '/image');
}

function putRecipeMainImageAsync(rootUrlPath, recipeId, imageId) {
    return putAsync(rootUrlPath + API_BASE_PATH + '/recipes/' + recipeId + '/image', imageId);
}

function getRecipeImagesAsync(rootUrlPath, recipeId) {
    return getAsync(rootUrlPath + API_BASE_PATH + '/recipes/' + recipeId + '/images');
}

function postRecipeImageAsync(rootUrlPath, recipeId, imageFormData) {
    return $.ajax({
        url: rootUrlPath + API_BASE_PATH + '/recipes/' + recipeId + '/images',
        method: 'POST',
        enctype: 'multipart/form-data',
        contentType: false,
        dataType: 'text',
        processData: false,
        data: imageFormData
    });
}

function deleteImageAsync(rootUrlPath, imageId) {
    return deleteAsync(rootUrlPath + API_BASE_PATH + '/images/' + imageId);
}

function getRecipeNotesAsync(rootUrlPath, recipeId) {
    return getAsync(rootUrlPath + API_BASE_PATH + '/recipes/' + recipeId + '/notes');
}

function postNoteAsync(rootUrlPath, note) {
    return postAsync(rootUrlPath + API_BASE_PATH + '/notes', JSON.stringify(note));
}

function putNoteAsync(rootUrlPath, note) {
    return putAsync(rootUrlPath + API_BASE_PATH + '/notes/' + note.id, JSON.stringify(note));
}

function deleteNoteAsync(rootUrlPath, noteId) {
    return deleteAsync(rootUrlPath + API_BASE_PATH + '/notes/' + noteId);
}

function putRecipeRatingAsync(rootUrlPath, recipeId, rating) {
    return putAsync(rootUrlPath + API_BASE_PATH + '/recipes/' + recipeId + '/rating', rating);
}

function getTagsAsync(rootUrlPath, tagsFilter) {
    return getAsync(rootUrlPath + API_BASE_PATH + '/tags', tagsFilter);
}
<commit_msg>Fixed a few bugs introducted in last commit<commit_after>
$(document).ready(function(){
    $('.button-collapse').sideNav({
        closeOnClick: true
    });
    $('.button-collapse-right').sideNav({
        edge: 'right',
        closeOnClick: true
    });
    $('.modal-trigger').leanModal();
    $('.dropdown').dropdown();
});

function getQueryString(field, isArray = false) {
    var target = window.location.href;
    var reg = new RegExp('[?&]' + field + '=([^&#]*)', 'ig');

    var values = [];
    while(true) {
        var matches = reg.exec(target);
        if (matches) {
            values.push(matches[1]);
        } else {
            break;
        }
    }

    if (!values.length) {
        return null;
    } else {
        return isArray ? values : values[0];
    }
}

function getQueryStringWithStorageBacking(field, defaultVal, isArray = false) {
    var val = getQueryString(field, isArray);
    if (val === null && sessionStorage.getItem(field)) {
        try {
            val = JSON.parse(sessionStorage.getItem(field));
        } catch(ex) {
            console.warn("Failed to retrieve value of '%s' in sessionStorage. Error: %s", field, ex);
        }
    }

    if (val === null) {
        val = defaultVal;
    }

    trySaveToSessionStorage(field, JSON.stringify(val));

    return val;
}

function trySaveToSessionStorage(field, stringVal) {
    try {
        sessionStorage.setItem(field, stringVal);
    } catch (ex) {
        console.warn("Failed to save value of '%s' in sessionStorage. Error: %s", field, ex);
    }
}

function showBusy(text) {
    $('#busy-message').text(text);
    $('#busy-dialog').openModal({
        dismissible: false
    });
}

function hideBusy() {
    $('#busy-dialog').closeModal();
}

function showConfirmation(title, icon, message, yesCallback) {
    $('#confirmation-title').text(title);
    $('#confirmation-image').text(icon);
    $('#confirmation-message').text(message);
    $('#confirmation-yes')[0].onclick = yesCallback;
    $('#confirmation-dialog').openModal();
}

const API_BASE_PATH = '/api/v1';

function getAsync(url, data = null) {
    return $.ajax({
        url: url,
        method: 'GET',
        contentType: 'application/json',
        dataType: 'json',
        data: data
    });
}

function putAsync(url, data) {
    return $.ajax({
        url: url,
        method: 'PUT',
        contentType: 'application/json',
        dataType: 'text',
        processData: false,
        data: data
    });
}

function postAsync(url, data) {
    return $.ajax({
        url: url,
        method: 'POST',
        contentType: 'application/json',
        dataType: 'text',
        processData: false,
        data: data
    });
}

function deleteAsync(url) {
    return $.ajax({
        url: url,
        method: 'DELETE',
        contentType: 'application/json',
        dataType: 'text'
    });
}

function getRecipesAsync(rootUrlPath, searchFilter) {
    return getAsync(rootUrlPath + API_BASE_PATH + '/recipes', searchFilter);
}

function getRecipeAsync(rootUrlPath, recipeId) {
    return getAsync(rootUrlPath + API_BASE_PATH + '/recipes/' + recipeId);
}

function postRecipeAsync(rootUrlPath, recipe) {
    return postAsync(rootUrlPath + API_BASE_PATH + '/recipes', JSON.stringify(recipe));
}

function putRecipeAsync(rootUrlPath, recipe) {
    return putAsync(rootUrlPath + API_BASE_PATH + '/recipes/' + recipe.id, JSON.stringify(recipe));
}

function deleteRecipeAsync(rootUrlPath, recipeId) {
    return deleteAsync(rootUrlPath + API_BASE_PATH + '/recipes/' + recipeId);
}

function getRecipeMainImageAsync(rootUrlPath, recipeId) {
    return getAsync(rootUrlPath + API_BASE_PATH + '/recipes/' + recipeId + '/image');
}

function putRecipeMainImageAsync(rootUrlPath, recipeId, imageId) {
    return putAsync(rootUrlPath + API_BASE_PATH + '/recipes/' + recipeId + '/image', imageId);
}

function getRecipeImagesAsync(rootUrlPath, recipeId) {
    return getAsync(rootUrlPath + API_BASE_PATH + '/recipes/' + recipeId + '/images');
}

function postRecipeImageAsync(rootUrlPath, recipeId, imageFormData) {
    return $.ajax({
        url: rootUrlPath + API_BASE_PATH + '/recipes/' + recipeId + '/images',
        method: 'POST',
        enctype: 'multipart/form-data',
        contentType: false,
        dataType: 'text',
        processData: false,
        data: imageFormData
    });
}

function deleteImageAsync(rootUrlPath, imageId) {
    return deleteAsync(rootUrlPath + API_BASE_PATH + '/images/' + imageId);
}

function getRecipeNotesAsync(rootUrlPath, recipeId) {
    return getAsync(rootUrlPath + API_BASE_PATH + '/recipes/' + recipeId + '/notes');
}

function postNoteAsync(rootUrlPath, note) {
    return postAsync(rootUrlPath + API_BASE_PATH + '/notes', JSON.stringify(note));
}

function putNoteAsync(rootUrlPath, note) {
    return putAsync(rootUrlPath + API_BASE_PATH + '/notes/' + note.id, JSON.stringify(note));
}

function deleteNoteAsync(rootUrlPath, noteId) {
    return deleteAsync(rootUrlPath + API_BASE_PATH + '/notes/' + noteId);
}

function putRecipeRatingAsync(rootUrlPath, recipeId, rating) {
    return putAsync(rootUrlPath + API_BASE_PATH + '/recipes/' + recipeId + '/rating', rating);
}

function getTagsAsync(rootUrlPath, tagsFilter) {
    return getAsync(rootUrlPath + API_BASE_PATH + '/tags', tagsFilter);
}
<|endoftext|>


<commit_before>module.exports = function(grunt) {
    "use strict";

    grunt.initConfig({
        pkg: grunt.file.readJSON("package.json"),
        bt: {
            dist: 'dist',
            build: {
                files: {
                    'dist/scroll.js': ['src/scroll.js']
                },
                browserifyOptions: {
                    standalone: 'Scroll'
                }
            },
            min: {
                files: {
                    'dist/scroll-min.js': ['dist/scroll.js']
                }
            },
            tests: {
                mocha: {
                    src: ['tests/*.js']
                }
            }
        },
        browserify: {
            dist: {
                files: {
                    'demo/demo-built.js': ['demo/demo.js']
                },
                options: {
                    watch: true,
                    keepAlive: true,
                    browserifyOptions: {
                        debug: true
                    }
                }
            }
        }
    });

    require("load-grunt-tasks")(grunt);
};<commit_msg>Adding scroll listener to build<commit_after>module.exports = function(grunt) {
    "use strict";

    grunt.initConfig({
        pkg: grunt.file.readJSON("package.json"),
        bt: {
            dist: 'dist',
            build: {
                files: {
                    'dist/scroll.js': ['src/scroll.js'],
                    'dist/scroll-listener.js': ['src/scroll-listener.js']
                },
                browserifyOptions: {
                    standalone: 'Scroll'
                }
            },
            min: {
                files: {
                    'dist/scroll-min.js': ['dist/scroll.js'],
                    'dist/scroll-listener-min.js': ['dist/scroll-listener.js']
                }
            },
            tests: {
                mocha: {
                    src: ['tests/*.js']
                }
            }
        },
        browserify: {
            dist: {
                files: {
                    'demo/demo-built.js': ['demo/demo.js']
                },
                options: {
                    watch: true,
                    keepAlive: true,
                    browserifyOptions: {
                        debug: true
                    }
                }
            }
        }
    });

    require("load-grunt-tasks")(grunt);
};<|endoftext|>


<commit_before>var asteriskAttack = (function(aa) {

  (function loadStars() {
    var i
      , width = aa.dom.stars.width()
      , height = aa.dom.stars.height()
      , h
      , sizes = [.2, .3, .4, .5]
      , colors = ['#666', '#777', '#888', '#999']
      , stars = '';

    function biasedTowardZero(min, max) {
      return Math.floor(Math.abs(Math.random() - Math.random()) * (1 + max - min) + min);
    }

    for (i = 0; i < 2000; i++) {
      h = (Math.random() > 0.5) ? height : height * 0.5;
      stars += ''
        + '•'
        + '';
    }

    aa.dom.stars.html(stars);
  })();

  (function loadStarlessAreas() {
    var i
      , numAreas = 7
      , areas = '';

    for (i = 0; i < numAreas; i++) {
      areas += '

';
    }

    aa.dom.starlessAreas.html(areas);
  })();

  (function loadLogo() {
    var i
      , colors = ['yellow', 'yellow', 'gold','orange','orangered','red']
      , logo = [

        '                      __                *       __             __   __               __         ',
        '______   _____ _____ / /_  _____ ____ __ _____ / /_     _____ / /_ / /_  _____ ____ / /_     ___',
        '_____   ___  // ___// __/ / _  // __// // ___//   /    ___  // __// __/ ___  // __//   /    ____',
        '____   / _  //___ // /__ / ___// /  / //___ //   \\_   / _  // /__/ /__ / _  // /__/   \\_   _____',
        '___   /____//____//____//____//_/  /_//____//_/\\__/  /____//_________//____//______/\\__/  ______',
        '________________________________________________________________________________________________'
      ];

    for (i = 0; i < logo.length; i++) {
      logo[i] = logo[i].replace(/ /g, ' ');
      logo[i] = ''
        + logo[i]
        + '
';
    }

    aa.dom.logo.html(logo)
  })();

  (function loadScoreboardHeader() {
    var header = [
      ' __ __ __    __   __ __ __ __ __ __',
      ' / / //_/  // /  /_ /  / //_//_ /_ ',
      '/ /_//    //_/  __//_ /_// \\/_ __/ '
    ];

    aa.dom.scoreboardHeader.html(''
      + '' + header[0].replace(/ /g, ' ') + '
'
      + '' + header[1].replace(/ /g, ' ') + '
'
      + '' + header[2].replace(/ /g, ' ') + '
'
    );
  })();

  (function loadAntenas() {
    var i
      , count = 0
      , antenas = [
        '                                                                                •                                                    ',
        '                                                    •                                                                                ',
        '                                                                                ',
        '                                                                                ',
        '                                                                                ',
        '                                      •                                                                                ',
        '                                                                                •                               ',
        '                                                                                ',
        '                                                                                ',
        '                •                                                                                ',
        '                                                                                ',
        '                                                                                •               '
      ];

    function flashAntenas() {
      var i
        , flashIntervals = [1234,2300,1818,2000,1143,1777]
        , flashDurations = [250,250,500,750,143,200];

      for (i = 0; i < flashIntervals.length; i++) {
        (function(j) {
          aa.loops.antenas[j] = setInterval(function() {
            $('#antena' + (j+1)).css({ 'color': 'fuchsia' })
              .animate({ 'color': '#101010' }, flashDurations[j]);
          }, flashIntervals[j]);
        })(i);
      }
    }

    for (i = 0; i < antenas.length; i++) {
      antenas[i] = antenas[i].replace(/ /g, ' ')
      if (/•/.test(antenas[i])) {
        antenas[i] = antenas[i].replace(/•/, '•');
      }
    }

    aa.dom.antenas.html(antenas.join('
'));
    flashAntenas();
  })();

  (function loadCityscape() {
    var lightsOnColors = ['#777', '#888', '#999']
      , lightsOffColor = '#333'
      , silhouetteColor = '#777'
      , cityscape = [
        '                                                                                ',
        '                                                                                |                                                    ',
        '                                                    |                                      ______|______                                              ',
        '                                                 ___|_|_____                               |           |                                              ',
        '                                                 |         |                               | • • • • • |                                              ',
        '                                                 | • • • • |                               |           |____                                          ',
        '                                      |          |         |                               | • • • • •     |                                          ',
        '                                      |          | • • • • |                        _____________        • |          |                               ',
        '                                 _____|_______   |         |______                  |           |  • •     |         ||                               ',
        '                                 |           |   | • • •         |                  | • • • • • |        • |  _______||____                           ',
        '                |                | • • • • • |   |         • • • |                  |           |  • •     |  |           |                           ',
        '             ___|_______                     |   | • • •     _____________          | • • • • • |        • |  | • • • • • |                           ',
        '             |         |   ___________ • • • |   |         • |           |          |           |  • •     |  |           |           |               ',
        '             | • • • • |   |         |       |   | • • •     | • • • • • |          | • • • • • |             | • • • • • |    _______|__|____        ',
        '     ________|         |   | • • • • |   • • |   |         • |           |   _________          |  •  ___________         |    |             |        ',
        '     |           • • • |   |         |       |   | • •         • • • • • |   |       |  • • • • |     |         |   • • • |    | • • • • • • |        ',
        '     | • • • •         |   | • • • • |   • •     | _____________         |   | • • • |          |  •  | • • • • |         |    |                      ',
        '___________        • • |   |         |           | |           |   • • • |   |       |  • • •         |         |     • • |    | • •   _______________',
        '|         |  •         |       • • • |   •         | • • • • • |         |   | • • • |                | • • • •                |       |             |',
        '  • • • • |          •               |                         |     • •     |       |  • •           |                 •        •     | • • • • • •  ',
        '                                   • |                 • • • • |                     |                | • •                            |              ',
        '                                                               |                                      |                                               '
      ];

    /*
     * Changes a random window in a particular level of the cityscape.
     * @level {Number} An array index representing the level of the cityscape.
     * @color {String} A CSS color, with a hash sign, 3 digits only.
     */
    function changeWindow(level, color) {
      var i
        , count
        , selected;

      count = cityscape[level].split('•').length - 1;

      if (count > 0) {
        selected = aa.randomInRange(1, count);

        for (i = 0; i < cityscape[level].length; i++) {
          if (cityscape[level][i] === '•' && !--selected) {
            cityscape[level] = cityscape[level].substr(0, i-6)
              + color
              + '">•'
              + cityscape[level].substr(i+1, cityscape[level].length);
          }
        }
      }
    }

    /*
     * Colors one window with a lights-on color in each level of the cityscape.
     */
    function setCityscape() {
      var i
        , color; // The window color.

      for (i = 0; i < cityscape.length; i++) {
        cityscape[i] = cityscape[i].replace(/ /g, '&nbsp')
        cityscape[i] = cityscape[i].replace(/\•/g, '•');
        cityscape[i] = '' + cityscape[i] + '
';

        color = lightsOnColors[aa.randomInRange(0, lightsOnColors.length - 1)];
        changeWindow(i, color);
      }

      aa.dom.cityscape.html(cityscape.join(''));
    }

    /*
     * Randomly chooses a level, and a window in the level, to recolor.
     */
    function animateCityscapeWindows() {
      var i
        , level  // Random level of the cityscape.
        , color; // The window color.

      level = aa.randomInRange(0, cityscape.length - 1);

      color = (Math.random() > 0.5) // 50% change of using an on color or the off color.
        ? lightsOffColor
        : lightsOnColors[aa.randomInRange(0, lightsOnColors.length - 1)];

      changeWindow(level, color);

      aa.dom.cityscape.html(cityscape.join(''));

      setTimeout(animateCityscapeWindows, aa.randomInRange(100, 500));
    }

    setCityscape();
    setTimeout(animateCityscapeWindows, aa.randomInRange(200, 500));
  })();

  (function loadAsterisks() {
    var i
      , asterisk
      , quantity = 100
      , colors = ['yellow', 'gold', 'orange', 'orangered', 'red', 'deeppink', 'hotpink', 'fuchsia', 'lightskyblue', 'dodgerblue', 'blue'];

    for (i = 0; i < quantity; i++) {
      asterisk = '
*
';

      asterisk = $(asterisk);
      aa.dom.asterisks.push(asterisk);
      aa.dom.attackZone.prepend(asterisk);
    }
  })();

  (function loadHeatrays() {
    var i
      , heatray
      , quantity = 10;

      for (i = 0; i < quantity; i++) {
        heatray = $('
|
|
|

');

        aa.dom.heatrays.push(heatray);
        aa.dom.zones.prepend(heatray);
      }
  })();

  return aa;

})(asteriskAttack);

<commit_msg>Change antena color (again)<commit_after>var asteriskAttack = (function(aa) {

  (function loadStars() {
    var i
      , width = aa.dom.stars.width()
      , height = aa.dom.stars.height()
      , h
      , sizes = [.2, .3, .4, .5]
      , colors = ['#666', '#777', '#888', '#999']
      , stars = '';

    function biasedTowardZero(min, max) {
      return Math.floor(Math.abs(Math.random() - Math.random()) * (1 + max - min) + min);
    }

    for (i = 0; i < 2000; i++) {
      h = (Math.random() > 0.5) ? height : height * 0.5;
      stars += ''
        + '•'
        + '';
    }

    aa.dom.stars.html(stars);
  })();

  (function loadStarlessAreas() {
    var i
      , numAreas = 7
      , areas = '';

    for (i = 0; i < numAreas; i++) {
      areas += '

';
    }

    aa.dom.starlessAreas.html(areas);
  })();

  (function loadLogo() {
    var i
      , colors = ['yellow', 'yellow', 'gold','orange','orangered','red']
      , logo = [

        '                      __                *       __             __   __               __         ',
        '______   _____ _____ / /_  _____ ____ __ _____ / /_     _____ / /_ / /_  _____ ____ / /_     ___',
        '_____   ___  // ___// __/ / _  // __// // ___//   /    ___  // __// __/ ___  // __//   /    ____',
        '____   / _  //___ // /__ / ___// /  / //___ //   \\_   / _  // /__/ /__ / _  // /__/   \\_   _____',
        '___   /____//____//____//____//_/  /_//____//_/\\__/  /____//_________//____//______/\\__/  ______',
        '________________________________________________________________________________________________'
      ];

    for (i = 0; i < logo.length; i++) {
      logo[i] = logo[i].replace(/ /g, ' ');
      logo[i] = ''
        + logo[i]
        + '
';
    }

    aa.dom.logo.html(logo)
  })();

  (function loadScoreboardHeader() {
    var header = [
      ' __ __ __    __   __ __ __ __ __ __',
      ' / / //_/  // /  /_ /  / //_//_ /_ ',
      '/ /_//    //_/  __//_ /_// \\/_ __/ '
    ];

    aa.dom.scoreboardHeader.html(''
      + '' + header[0].replace(/ /g, ' ') + '
'
      + '' + header[1].replace(/ /g, ' ') + '
'
      + '' + header[2].replace(/ /g, ' ') + '
'
    );
  })();

  (function loadAntenas() {
    var i
      , count = 0
      , antenas = [
        '                                                                                •                                                    ',
        '                                                    •                                                                                ',
        '                                                                                ',
        '                                                                                ',
        '                                                                                ',
        '                                      •                                                                                ',
        '                                                                                •                               ',
        '                                                                                ',
        '                                                                                ',
        '                •                                                                                ',
        '                                                                                ',
        '                                                                                •               '
      ];

    function flashAntenas() {
      var i
        , flashIntervals = [1234,2300,1818,2000,1143,1777]
        , flashDurations = [250,250,500,750,143,200];

      for (i = 0; i < flashIntervals.length; i++) {
        (function(j) {
          aa.loops.antenas[j] = setInterval(function() {
            $('#antena' + (j+1)).css({ 'color': 'white' })
              .animate({ 'color': '#101010' }, flashDurations[j]);
          }, flashIntervals[j]);
        })(i);
      }
    }

    for (i = 0; i < antenas.length; i++) {
      antenas[i] = antenas[i].replace(/ /g, ' ')
      if (/•/.test(antenas[i])) {
        antenas[i] = antenas[i].replace(/•/, '•');
      }
    }

    aa.dom.antenas.html(antenas.join('
'));
    flashAntenas();
  })();

  (function loadCityscape() {
    var lightsOnColors = ['#777', '#888', '#999']
      , lightsOffColor = '#333'
      , silhouetteColor = '#777'
      , cityscape = [
        '                                                                                ',
        '                                                                                |                                                    ',
        '                                                    |                                      ______|______                                              ',
        '                                                 ___|_|_____                               |           |                                              ',
        '                                                 |         |                               | • • • • • |                                              ',
        '                                                 | • • • • |                               |           |____                                          ',
        '                                      |          |         |                               | • • • • •     |                                          ',
        '                                      |          | • • • • |                        _____________        • |          |                               ',
        '                                 _____|_______   |         |______                  |           |  • •     |         ||                               ',
        '                                 |           |   | • • •         |                  | • • • • • |        • |  _______||____                           ',
        '                |                | • • • • • |   |         • • • |                  |           |  • •     |  |           |                           ',
        '             ___|_______                     |   | • • •     _____________          | • • • • • |        • |  | • • • • • |                           ',
        '             |         |   ___________ • • • |   |         • |           |          |           |  • •     |  |           |           |               ',
        '             | • • • • |   |         |       |   | • • •     | • • • • • |          | • • • • • |             | • • • • • |    _______|__|____        ',
        '     ________|         |   | • • • • |   • • |   |         • |           |   _________          |  •  ___________         |    |             |        ',
        '     |           • • • |   |         |       |   | • •         • • • • • |   |       |  • • • • |     |         |   • • • |    | • • • • • • |        ',
        '     | • • • •         |   | • • • • |   • •     | _____________         |   | • • • |          |  •  | • • • • |         |    |                      ',
        '___________        • • |   |         |           | |           |   • • • |   |       |  • • •         |         |     • • |    | • •   _______________',
        '|         |  •         |       • • • |   •         | • • • • • |         |   | • • • |                | • • • •                |       |             |',
        '  • • • • |          •               |                         |     • •     |       |  • •           |                 •        •     | • • • • • •  ',
        '                                   • |                 • • • • |                     |                | • •                            |              ',
        '                                                               |                                      |                                               '
      ];

    /*
     * Changes a random window in a particular level of the cityscape.
     * @level {Number} An array index representing the level of the cityscape.
     * @color {String} A CSS color, with a hash sign, 3 digits only.
     */
    function changeWindow(level, color) {
      var i
        , count
        , selected;

      count = cityscape[level].split('•').length - 1;

      if (count > 0) {
        selected = aa.randomInRange(1, count);

        for (i = 0; i < cityscape[level].length; i++) {
          if (cityscape[level][i] === '•' && !--selected) {
            cityscape[level] = cityscape[level].substr(0, i-6)
              + color
              + '">•'
              + cityscape[level].substr(i+1, cityscape[level].length);
          }
        }
      }
    }

    /*
     * Colors one window with a lights-on color in each level of the cityscape.
     */
    function setCityscape() {
      var i
        , color; // The window color.

      for (i = 0; i < cityscape.length; i++) {
        cityscape[i] = cityscape[i].replace(/ /g, '&nbsp')
        cityscape[i] = cityscape[i].replace(/\•/g, '•');
        cityscape[i] = '' + cityscape[i] + '
';

        color = lightsOnColors[aa.randomInRange(0, lightsOnColors.length - 1)];
        changeWindow(i, color);
      }

      aa.dom.cityscape.html(cityscape.join(''));
    }

    /*
     * Randomly chooses a level, and a window in the level, to recolor.
     */
    function animateCityscapeWindows() {
      var i
        , level  // Random level of the cityscape.
        , color; // The window color.

      level = aa.randomInRange(0, cityscape.length - 1);

      color = (Math.random() > 0.5) // 50% change of using an on color or the off color.
        ? lightsOffColor
        : lightsOnColors[aa.randomInRange(0, lightsOnColors.length - 1)];

      changeWindow(level, color);

      aa.dom.cityscape.html(cityscape.join(''));

      setTimeout(animateCityscapeWindows, aa.randomInRange(100, 500));
    }

    setCityscape();
    setTimeout(animateCityscapeWindows, aa.randomInRange(200, 500));
  })();

  (function loadAsterisks() {
    var i
      , asterisk
      , quantity = 100
      , colors = ['yellow', 'gold', 'orange', 'orangered', 'red', 'deeppink', 'hotpink', 'fuchsia', 'lightskyblue', 'dodgerblue', 'blue'];

    for (i = 0; i < quantity; i++) {
      asterisk = '
*
';

      asterisk = $(asterisk);
      aa.dom.asterisks.push(asterisk);
      aa.dom.attackZone.prepend(asterisk);
    }
  })();

  (function loadHeatrays() {
    var i
      , heatray
      , quantity = 10;

      for (i = 0; i < quantity; i++) {
        heatray = $('
|
|
|

');

        aa.dom.heatrays.push(heatray);
        aa.dom.zones.prepend(heatray);
      }
  })();

  return aa;

})(asteriskAttack);

<|endoftext|>


<commit_before>// Generated on 2014-01-03 using generator-webapp 0.4.6
'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);

    var modRewrite = require('connect-modrewrite');

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

        // Project settings
        yeoman: {
            // Configurable paths
            app: 'app',
            dist: 'dist'
        },

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

        // The actual grunt server settings
        connect: {
            options: {
                port: 9000,
                livereload: 35729,
                // Change this to '0.0.0.0' to access the server from outside
                hostname: '0.0.0.0',
                middleware: function(connect, options, middlewares) {
                    // Rewrite everything that does not contain a '.' to
                    // support pushState
                    middlewares.unshift(modRewrite(['^[^\\.]*$ /index.html [L]']));
                    return middlewares;
                }
            },
            livereload: {
                options: {
                    open: true,
                    base: [
                        '.tmp',
                        '<%= yeoman.app %>',
                        '.',
                        'api/app'
                    ]
                }
            },
            test: {
                options: {
                    port: 9001,
                    base: [
                        '.tmp',
                        'test',
                        '<%= yeoman.app %>',
                        'api/app'
                    ]
                }
            },
            dist: {
                options: {
                    open: true,
                    base: [
                        '<%= yeoman.dist %>',
                        'api/app'
                    ],
                    livereload: false
                }
            }
        },

        // Empties folders to start fresh
        clean: {
            dist: {
                files: [{
                    dot: true,
                    src: [
                        '.tmp',
                        '<%= yeoman.dist %>/*',
                        '!<%= yeoman.dist %>/.git*'
                    ]
                }]
            },
            server: '.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',
                '<%= yeoman.app %>/scripts/**/*.js',
                '!<%= yeoman.app %>/scripts/vendor/*',
                'test/spec/{,*/}*.js'
            ]
        },

        // Mocha testing framework configuration options
        mocha: {
            all: {
                options: {
                    run: true,
                    urls: ['http://<%= connect.test.options.hostname %>:<%= connect.test.options.port %>/index.html']
                }
            }
        },

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

        // Add vendor prefixed styles
        autoprefixer: {
            options: {
                // Commented out to use more extensive autoprefixer defaults
                // browsers: ['last 1 version']
            },
            dist: {
                files: [{
                    expand: true,
                    cwd: '.tmp/styles/',
                    src: '{,*/}*.css',
                    dest: '.tmp/styles/'
                }]
            }
        },

        browserify: {
            all: {
                files: {
                    '.tmp/scripts/main.js': '<%= yeoman.app %>/scripts/main.js'
                },
                options: {
                    bundleOptions: {
                        debug: true
                    },
                    watch: true
                }
            }
        },

        // Renames files for browser caching purposes
        rev: {
            dist: {
                files: {
                    src: [
                        '<%= yeoman.dist %>/scripts/{,*/}*.js',
                        '<%= yeoman.dist %>/styles/{,*/}*.css',
                        '!<%= yeoman.dist %>/styles/slate.min.css',
                        '<%= yeoman.dist %>/images/{,*/}*.{gif,jpeg,jpg,png,webp}',
//                        '<%= yeoman.dist %>/styles/fonts/{,*/}*.*'
                    ]
                }
            }
        },

        // Reads HTML for usemin blocks to enable smart builds that automatically
        // concat, minify and revision files. Creates configurations in memory so
        // additional tasks can operate on them
        useminPrepare: {
            options: {
                dest: '<%= yeoman.dist %>'
            },
            html: '.tmp/index.html'
        },

        // Performs rewrites based on rev and the useminPrepare configuration
        usemin: {
            options: {
                assetsDirs: ['<%= yeoman.dist %>']
            },
            html: ['<%= yeoman.dist %>/{,*/}*.html'],
            css: ['<%= yeoman.dist %>/styles/{,*/}*.css']
        },

        // The following *-min tasks produce minified files in the dist folder
        imagemin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/images',
                    src: '{,*/}*.{gif,jpeg,jpg,png}',
                    dest: '<%= yeoman.dist %>/images'
                }, {
                  expand: true,
                  cwd: '<%= yeoman.app %>/bower_components/select2',
                  src: '*.{gif,png}',
                  dest: '<%= yeoman.dist %>/styles'
                }]
            }
        },
        svgmin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/images',
                    src: '{,*/}*.svg',
                    dest: '<%= yeoman.dist %>/images'
                }]
            }
        },
        htmlmin: {
            dist: {
                options: {
                    collapseBooleanAttributes: true,
                    collapseWhitespace: true,
                    removeAttributeQuotes: true,
                    removeCommentsFromCDATA: true,
                    removeEmptyAttributes: true,
                    removeOptionalTags: true,
                    removeRedundantAttributes: true,
                    useShortDoctype: true
                },
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.dist %>',
                    src: '{,*/}*.html',
                    dest: '<%= yeoman.dist %>'
                }]
            }
        },

        // By default, your `index.html`'s <!-- Usemin block --> will take care of
        // minification. These next options are pre-configured if you do not wish
        // to use the Usemin blocks.
        cssmin: {
            dist: {
                files: {
                    '<%= yeoman.dist %>/styles/exports.css': [
                        '.tmp/styles/exports.css'
                    ]
                }
            }
        },
        // uglify: {
        //     dist: {
        //         files: {
        //             '<%= yeoman.dist %>/scripts/scripts.js': [
        //                 '<%= yeoman.dist %>/scripts/scripts.js'
        //             ]
        //         }
        //     }
        // },
        // concat: {
        //     dist: {}
        // },

        // Copies remaining files to places other tasks can use
        copy: {
            dist: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= yeoman.app %>',
                    dest: '<%= yeoman.dist %>',
                    src: [
                        '*.{config,php}',
                        '*.{ico,png,txt}',
                        '.htaccess',
                        'bower_components/zeroclipboard/dist/ZeroClipboard.swf',
                        'images/{,*/}*.webp',
                        '{,*/}*.html',
                        'scripts/disqus-count.js',
                        'styles/slate.min.css',
                        'styles/*.{gif,png}',
                        'styles/fonts/{,*/}*.*',
                        'vendor/knplabs/knp-snappy/src/**/*.php',
                        'bower_components/font-awesome/fonts/*.*',
                        'bower_components/jquery/dist/jquery.min.*',
                        'bower_components/raven-js/dist/raven.min.*'
                    ]
                }, {
                    expand: true,
                    cwd: '.tmp',
                    dest: '<%= yeoman.dist %>',
                    src: 'index.html'
                }]
            },
            styles: {
                expand: true,
                dot: true,
                cwd: '<%= yeoman.app %>/styles',
                dest: '.tmp/styles/',
                src: '{,*/}*.css'
            },
            tmp: {
                expand: true,
                cwd: '<%= yeoman.app %>',
                dest: '.tmp',
                src: [
                    'bower_components/qtip2/jquery.qtip.css',
                    'bower_components/select2/select2.css',
                    'bower_components/animate.css/animate.min.css',
                    'index.html'
                ]
            }
        },

        // Run some tasks in parallel to speed up build process
        concurrent: {
            server: [
                'compass:server',
                'copy:styles'
            ],
            test: [
                'copy:styles'
            ],
            dist: [
                'compass',
                'copy:styles',
                'imagemin',
                'svgmin'
            ]
        },
        rsync: {
            options: {
                args: ['-cruv']
            },
            'nusmods.com': {
                options: {
                    src: '<%= yeoman.dist %>/*',
                    dest: '~/nusmods.com'
                }
            }
        }
    });

    grunt.registerTask('serve', function (target) {
        if (target === 'dist') {
            return grunt.task.run(['build', 'connect:dist:keepalive']);
        }

        grunt.task.run([
            'clean:server',
            'concurrent:server',
            'autoprefixer',
            'browserify',
            'connect:livereload',
            'watch'
        ]);
    });

    grunt.registerTask('server', function () {
        grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
        grunt.task.run(['serve']);
    });

    grunt.registerTask('test', function(target) {
        if (target !== 'watch') {
            grunt.task.run([
                'clean:server',
                'concurrent:test',
                'autoprefixer'
            ]);
        }

        grunt.task.run([
            'connect:test',
            'mocha'
        ]);
    });

    grunt.registerTask('build', [
        'clean:dist',
        'copy:tmp',
        'useminPrepare',
        'concurrent:dist',
        'autoprefixer',
        'browserify',
        'concat',
        'cssmin',
        'uglify',
        'copy:dist',
        'rev',
        'usemin',
        'htmlmin'
    ]);

    grunt.registerTask('default', [
        'newer:jshint',
        // 'test',
        'build'
    ]);
};
<commit_msg>Rerun browserify task if package.json changes<commit_after>// Generated on 2014-01-03 using generator-webapp 0.4.6
'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);

    var modRewrite = require('connect-modrewrite');

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

        // Project settings
        yeoman: {
            // Configurable paths
            app: 'app',
            dist: 'dist'
        },

        // Watches files for changes and runs tasks based on the changed files
        watch: {
            jstest: {
                files: ['test/spec/{,*/}*.js'],
                tasks: ['test:watch']
            },
            gruntfile: {
                files: ['Gruntfile.js']
            },
            compass: {
                files: ['<%= yeoman.app %>/styles/{,*/}*.{scss,sass}'],
                tasks: ['compass:server', 'autoprefixer']
            },
            styles: {
                files: ['<%= yeoman.app %>/styles/{,*/}*.css'],
                tasks: ['newer:copy:styles', 'autoprefixer']
            },
            livereload: {
                options: {
                    livereload: '<%= connect.options.livereload %>'
                },
                files: [
                    '<%= yeoman.app %>/{,*/}*.html',
                    '.tmp/scripts/main.js',
                    '.tmp/styles/{,*/}*.css',
                    '<%= yeoman.app %>/images/{,*/}*.{gif,jpeg,jpg,png,svg,webp}'
                ]
            },
            packagejson: {
                files: ['package.json'],
                tasks: ['browserify']
            }
        },

        // The actual grunt server settings
        connect: {
            options: {
                port: 9000,
                livereload: 35729,
                // Change this to '0.0.0.0' to access the server from outside
                hostname: '0.0.0.0',
                middleware: function(connect, options, middlewares) {
                    // Rewrite everything that does not contain a '.' to
                    // support pushState
                    middlewares.unshift(modRewrite(['^[^\\.]*$ /index.html [L]']));
                    return middlewares;
                }
            },
            livereload: {
                options: {
                    open: true,
                    base: [
                        '.tmp',
                        '<%= yeoman.app %>',
                        '.',
                        'api/app'
                    ]
                }
            },
            test: {
                options: {
                    port: 9001,
                    base: [
                        '.tmp',
                        'test',
                        '<%= yeoman.app %>',
                        'api/app'
                    ]
                }
            },
            dist: {
                options: {
                    open: true,
                    base: [
                        '<%= yeoman.dist %>',
                        'api/app'
                    ],
                    livereload: false
                }
            }
        },

        // Empties folders to start fresh
        clean: {
            dist: {
                files: [{
                    dot: true,
                    src: [
                        '.tmp',
                        '<%= yeoman.dist %>/*',
                        '!<%= yeoman.dist %>/.git*'
                    ]
                }]
            },
            server: '.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',
                '<%= yeoman.app %>/scripts/**/*.js',
                '!<%= yeoman.app %>/scripts/vendor/*',
                'test/spec/{,*/}*.js'
            ]
        },

        // Mocha testing framework configuration options
        mocha: {
            all: {
                options: {
                    run: true,
                    urls: ['http://<%= connect.test.options.hostname %>:<%= connect.test.options.port %>/index.html']
                }
            }
        },

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

        // Add vendor prefixed styles
        autoprefixer: {
            options: {
                // Commented out to use more extensive autoprefixer defaults
                // browsers: ['last 1 version']
            },
            dist: {
                files: [{
                    expand: true,
                    cwd: '.tmp/styles/',
                    src: '{,*/}*.css',
                    dest: '.tmp/styles/'
                }]
            }
        },

        browserify: {
            all: {
                files: {
                    '.tmp/scripts/main.js': '<%= yeoman.app %>/scripts/main.js'
                },
                options: {
                    bundleOptions: {
                        debug: true
                    },
                    watch: true
                }
            }
        },

        // Renames files for browser caching purposes
        rev: {
            dist: {
                files: {
                    src: [
                        '<%= yeoman.dist %>/scripts/{,*/}*.js',
                        '<%= yeoman.dist %>/styles/{,*/}*.css',
                        '!<%= yeoman.dist %>/styles/slate.min.css',
                        '<%= yeoman.dist %>/images/{,*/}*.{gif,jpeg,jpg,png,webp}',
//                        '<%= yeoman.dist %>/styles/fonts/{,*/}*.*'
                    ]
                }
            }
        },

        // Reads HTML for usemin blocks to enable smart builds that automatically
        // concat, minify and revision files. Creates configurations in memory so
        // additional tasks can operate on them
        useminPrepare: {
            options: {
                dest: '<%= yeoman.dist %>'
            },
            html: '.tmp/index.html'
        },

        // Performs rewrites based on rev and the useminPrepare configuration
        usemin: {
            options: {
                assetsDirs: ['<%= yeoman.dist %>']
            },
            html: ['<%= yeoman.dist %>/{,*/}*.html'],
            css: ['<%= yeoman.dist %>/styles/{,*/}*.css']
        },

        // The following *-min tasks produce minified files in the dist folder
        imagemin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/images',
                    src: '{,*/}*.{gif,jpeg,jpg,png}',
                    dest: '<%= yeoman.dist %>/images'
                }, {
                  expand: true,
                  cwd: '<%= yeoman.app %>/bower_components/select2',
                  src: '*.{gif,png}',
                  dest: '<%= yeoman.dist %>/styles'
                }]
            }
        },
        svgmin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.app %>/images',
                    src: '{,*/}*.svg',
                    dest: '<%= yeoman.dist %>/images'
                }]
            }
        },
        htmlmin: {
            dist: {
                options: {
                    collapseBooleanAttributes: true,
                    collapseWhitespace: true,
                    removeAttributeQuotes: true,
                    removeCommentsFromCDATA: true,
                    removeEmptyAttributes: true,
                    removeOptionalTags: true,
                    removeRedundantAttributes: true,
                    useShortDoctype: true
                },
                files: [{
                    expand: true,
                    cwd: '<%= yeoman.dist %>',
                    src: '{,*/}*.html',
                    dest: '<%= yeoman.dist %>'
                }]
            }
        },

        // By default, your `index.html`'s <!-- Usemin block --> will take care of
        // minification. These next options are pre-configured if you do not wish
        // to use the Usemin blocks.
        cssmin: {
            dist: {
                files: {
                    '<%= yeoman.dist %>/styles/exports.css': [
                        '.tmp/styles/exports.css'
                    ]
                }
            }
        },
        // uglify: {
        //     dist: {
        //         files: {
        //             '<%= yeoman.dist %>/scripts/scripts.js': [
        //                 '<%= yeoman.dist %>/scripts/scripts.js'
        //             ]
        //         }
        //     }
        // },
        // concat: {
        //     dist: {}
        // },

        // Copies remaining files to places other tasks can use
        copy: {
            dist: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= yeoman.app %>',
                    dest: '<%= yeoman.dist %>',
                    src: [
                        '*.{config,php}',
                        '*.{ico,png,txt}',
                        '.htaccess',
                        'bower_components/zeroclipboard/dist/ZeroClipboard.swf',
                        'images/{,*/}*.webp',
                        '{,*/}*.html',
                        'scripts/disqus-count.js',
                        'styles/slate.min.css',
                        'styles/*.{gif,png}',
                        'styles/fonts/{,*/}*.*',
                        'vendor/knplabs/knp-snappy/src/**/*.php',
                        'bower_components/font-awesome/fonts/*.*',
                        'bower_components/jquery/dist/jquery.min.*',
                        'bower_components/raven-js/dist/raven.min.*'
                    ]
                }, {
                    expand: true,
                    cwd: '.tmp',
                    dest: '<%= yeoman.dist %>',
                    src: 'index.html'
                }]
            },
            styles: {
                expand: true,
                dot: true,
                cwd: '<%= yeoman.app %>/styles',
                dest: '.tmp/styles/',
                src: '{,*/}*.css'
            },
            tmp: {
                expand: true,
                cwd: '<%= yeoman.app %>',
                dest: '.tmp',
                src: [
                    'bower_components/qtip2/jquery.qtip.css',
                    'bower_components/select2/select2.css',
                    'bower_components/animate.css/animate.min.css',
                    'index.html'
                ]
            }
        },

        // Run some tasks in parallel to speed up build process
        concurrent: {
            server: [
                'compass:server',
                'copy:styles'
            ],
            test: [
                'copy:styles'
            ],
            dist: [
                'compass',
                'copy:styles',
                'imagemin',
                'svgmin'
            ]
        },
        rsync: {
            options: {
                args: ['-cruv']
            },
            'nusmods.com': {
                options: {
                    src: '<%= yeoman.dist %>/*',
                    dest: '~/nusmods.com'
                }
            }
        }
    });

    grunt.registerTask('serve', function (target) {
        if (target === 'dist') {
            return grunt.task.run(['build', 'connect:dist:keepalive']);
        }

        grunt.task.run([
            'clean:server',
            'concurrent:server',
            'autoprefixer',
            'browserify',
            'connect:livereload',
            'watch'
        ]);
    });

    grunt.registerTask('server', function () {
        grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
        grunt.task.run(['serve']);
    });

    grunt.registerTask('test', function(target) {
        if (target !== 'watch') {
            grunt.task.run([
                'clean:server',
                'concurrent:test',
                'autoprefixer'
            ]);
        }

        grunt.task.run([
            'connect:test',
            'mocha'
        ]);
    });

    grunt.registerTask('build', [
        'clean:dist',
        'copy:tmp',
        'useminPrepare',
        'concurrent:dist',
        'autoprefixer',
        'browserify',
        'concat',
        'cssmin',
        'uglify',
        'copy:dist',
        'rev',
        'usemin',
        'htmlmin'
    ]);

    grunt.registerTask('default', [
        'newer:jshint',
        // 'test',
        'build'
    ]);
};
<|endoftext|>


<commit_before>$(document).ready(function() {
  $('#parse').click(function() {
    try {
      var myCodeMirror = $(".CodeMirror")[0].CodeMirror
      var source = myCodeMirror.getValue()

      out.className = "unhidden";

      // Import: Change: $('#input').val() -> source, i forget it, again
      var tree = calculator.parse(source);
      plegadoConstantes(tree);
      $('#output').html(JSON.stringify(tree,undefined,2));
    } catch (e) {
      $('#output').html('

\n' + String(e) + '\n

');
    }
  });

  $("#examples").change(function(ev) {
    var f = ev.target.files[0];
    var r = new FileReader();
    r.onload = function(e) {
      var contents = e.target.result;

      var myCodeMirror = $('.CodeMirror')[0].CodeMirror;
      myCodeMirror.setValue(contents);
    }
    r.readAsText(f);
  });

});
function plegadoConstantes(tree){
	switch (tree.type){
		case "BLOCK":
		case "procedure":
			if(tree.hasOwnProperty("procs") && tree.procs != "NULL"){
				tree.procs = plegadoConstantes(tree.procs);
			}
			if(tree.hasOwnProperty("stat")){
				for (var i in tree.stat.statement_list){
					tree.stat.statement_list[i] = plegadoConstantes(tree.stat.statement_list[i]);
				}
			}
			break;
		case "=":
			tree.left
			var num = {
				type:"Number",
				value:tree.value
			}
			var treeN = {
				type: "=",
				left: tree.right,
				right: num
			}
			return tree;
			break;
		case "CALL":
			break;
		case "BEGIN":
			break;
		case "IF":
			break;
		case "IFELSE":
			break;
		case "ODD":
			break;
		case "==":
		case "!=":
		case "<=":
		case "<":
		case ">":
		case ">=":
		case "-":
		case "+":
		case "*":
		case "/":

		break;
		case "NUMBER":
			break;
		case "ID":
			break;
	}
}

<commit_msg>change<commit_after>$(document).ready(function() {
  $('#parse').click(function() {
    try {
      var myCodeMirror = $(".CodeMirror")[0].CodeMirror
      var source = myCodeMirror.getValue()

      out.className = "unhidden";

      // Import: Change: $('#input').val() -> source, i forget it, again
      var tree = calculator.parse(source);
      plegadoConstantes(tree);
      $('#output').html(JSON.stringify(tree,undefined,2));
    } catch (e) {
      $('#output').html('

\n' + String(e) + '\n

');
    }
  });

  $("#examples").change(function(ev) {
    var f = ev.target.files[0];
    var r = new FileReader();
    r.onload = function(e) {
      var contents = e.target.result;

      var myCodeMirror = $('.CodeMirror')[0].CodeMirror;
      myCodeMirror.setValue(contents);
    }
    r.readAsText(f);
  });

});
function plegadoConstantes(tree){
	switch (tree.type){
		case "BLOCK":
		case "procedure":
			if(tree.hasOwnProperty("procs") && tree.procs != "NULL"){
				plegadoConstantes(tree.procs);
			}
			if(tree.hasOwnProperty("stat")){
				for (var i in tree.stat.statement_list){
					plegadoConstantes(tree.stat.statement_list[i]);
				}
			}
			break;
		case "=":
			var num = {
				type:"Number",
				value:tree.value
			}
			var treeN = {
				type: "=",
				left: tree.right,
				right: num
			}
			tree.left = treeN;
			break;
		case "CALL":
			break;
		case "BEGIN":
			break;
		case "IF":
			break;
		case "IFELSE":
			break;
		case "ODD":
			break;
		case "==":
		case "!=":
		case "<=":
		case "<":
		case ">":
		case ">=":
		case "-":
		case "+":
		case "*":
		case "/":

		break;
		case "NUMBER":
			break;
		case "ID":
			break;
	}
}

<|endoftext|>


<commit_before>'use strict';

module.exports = function(grunt) {
    // Configuration.
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        jscs: {
            options: {
                config: '.jscsrc'
            },
            bin: 'bin/**/*.js',
            grunt: 'Gruntfile.js',
            lib: 'lib/**/*.js',
            test: '<%= nodeunit.all %>'
        },
        jshint: {
            options: {
                jshintrc: true
            },
            bin: 'bin/**/*.js',
            grunt: 'Gruntfile.js',
            lib: 'lib/**/*.js',
            test: '<%= nodeunit.all %>'
        },
        jsonlint: {
            jshint: ['.jshintrc'],
            npm: ['package.json']
        },
        nodeunit: {
            all: ['test/**/*.js']
        }
    });

    // Load tasks.
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-jscs-checker');
    grunt.loadNpmTasks('grunt-jsonlint');
    grunt.loadNpmTasks('grunt-contrib-nodeunit');
    grunt.loadNpmTasks('grunt-release');

    // Register tasks.
    grunt.registerTask('lint', ['jsonlint', 'jshint', 'jscs']);
    grunt.registerTask('test', ['nodeunit']);
    grunt.registerTask('travis', ['lint', 'test']);
    grunt.registerTask('default', ['lint', 'test']);
};
<commit_msg>Alphabetical order.<commit_after>'use strict';

module.exports = function(grunt) {
    // Configuration.
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        jscs: {
            options: {
                config: '.jscsrc'
            },
            bin: 'bin/**/*.js',
            grunt: 'Gruntfile.js',
            lib: 'lib/**/*.js',
            test: '<%= nodeunit.all %>'
        },
        jshint: {
            options: {
                jshintrc: true
            },
            bin: 'bin/**/*.js',
            grunt: 'Gruntfile.js',
            lib: 'lib/**/*.js',
            test: '<%= nodeunit.all %>'
        },
        jsonlint: {
            jshint: ['.jshintrc'],
            npm: ['package.json']
        },
        nodeunit: {
            all: ['test/**/*.js']
        }
    });

    // Load tasks.
    grunt.loadNpmTasks('grunt-contrib-jshint');
    grunt.loadNpmTasks('grunt-contrib-nodeunit');
    grunt.loadNpmTasks('grunt-jscs-checker');
    grunt.loadNpmTasks('grunt-jsonlint');
    grunt.loadNpmTasks('grunt-release');

    // Register tasks.
    grunt.registerTask('lint', ['jsonlint', 'jshint', 'jscs']);
    grunt.registerTask('test', ['nodeunit']);
    grunt.registerTask('travis', ['lint', 'test']);
    grunt.registerTask('default', ['lint', 'test']);
};
<|endoftext|>


<commit_before>module.exports = function(grunt) {

     var headerComment = "/*! <%= pkg.name %> v<%= pkg.version %> (<%= grunt.template.today() %>)\n" +
                " *  ---------------------------------------------\n" +
                " *  <%= pkg.description %>\n" +
                " *  <%= pkg.homepage %>\n" +

                " *  Licensed under the <%= pkg.license %> license\n" +
                " *  Copyright 2013 <%= pkg.author.name %>\n" +
                " */\n";

    // Project configuration.
    grunt.initConfig({
        pkg: grunt.file.readJSON("package.json"),
        qunit: {
            files: ["test/index.html", "test/index-amd.html"]
        },
        jshint: {
            options: {
                jshintrc: ".jshintrc"
            },
            files: ["<%= pkg.name %>.js", "test/test.js", "test/test-amd.js"]
        },
        csslint: {
            base: {
                src: "<%= pkg.name %>.css",
                rules: {
                    "known-properties": false
                }
            }
        },
        uglify: {
            options: {
                banner: headerComment
            },
            base: {
                files: {
                    "<%= pkg.name %>.min.js" : ["<%= pkg.name %>.js"]
                }
            }
        },
        "qunit-cov": {
            test:
            {
                minimum: 0.75,
                srcDir: "src",
                depDirs: ["test"],
                outDir: "jscoverage",
                testFiles: ["test/index.html"]
            }
        },
        concat: {
            options: {
                banner: headerComment + "\n"
            },
            js: {
                src: ["src/<%= pkg.name %>.js"],
                dest: "<%= pkg.name %>.js"
            }
        }
    });

    grunt.loadNpmTasks("grunt-contrib-jshint");
    grunt.loadNpmTasks("grunt-contrib-qunit");
    grunt.loadNpmTasks("grunt-contrib-uglify");
    grunt.loadNpmTasks("grunt-css");
    grunt.loadNpmTasks("grunt-qunit-cov");
    grunt.loadNpmTasks("grunt-bump");
    //grunt.loadNpmTasks("grunt-replace");
    grunt.loadNpmTasks("grunt-contrib-concat");

    // TO RUN BEFORE COMMIT
    // ====================
    grunt.registerTask("build", ["concat", "jshint", "csslint", "uglify"]);

    // TO RUN JUST BEFORE RELEASING A NEW VERSION
    // ==========================================

    // Task for patch version release
    grunt.registerTask("r", ["concat", "qunit", "qunit-cov", "jshint", "csslint", "bump", "uglify"]);

    // Task for minor version release
    grunt.registerTask("rmin", ["concat", "qunit", "qunit-cov", "jshint", "csslint", "bump:minor", "uglify"]);

    // Task for major version release
    grunt.registerTask("rmaj", ["concat", "qunit", "qunit-cov", "jshint", "csslint", "bump:major", "uglify"]);

    // FOR TRAVIS
    // ==========
    grunt.registerTask("travis", ["qunit", "jshint", "csslint", "qunit-cov"]);
};<commit_msg>Removing qunit-cov task from Travis<commit_after>module.exports = function(grunt) {

     var headerComment = "/*! <%= pkg.name %> v<%= pkg.version %> (<%= grunt.template.today() %>)\n" +
                " *  ---------------------------------------------\n" +
                " *  <%= pkg.description %>\n" +
                " *  <%= pkg.homepage %>\n" +

                " *  Licensed under the <%= pkg.license %> license\n" +
                " *  Copyright 2013 <%= pkg.author.name %>\n" +
                " */\n";

    // Project configuration.
    grunt.initConfig({
        pkg: grunt.file.readJSON("package.json"),
        qunit: {
            files: ["test/index.html", "test/index-amd.html"]
        },
        jshint: {
            options: {
                jshintrc: ".jshintrc"
            },
            files: ["<%= pkg.name %>.js", "test/test.js", "test/test-amd.js"]
        },
        csslint: {
            base: {
                src: "<%= pkg.name %>.css",
                rules: {
                    "known-properties": false
                }
            }
        },
        uglify: {
            options: {
                banner: headerComment
            },
            base: {
                files: {
                    "<%= pkg.name %>.min.js" : ["<%= pkg.name %>.js"]
                }
            }
        },
        "qunit-cov": {
            test:
            {
                minimum: 0.75,
                srcDir: "src",
                depDirs: ["test"],
                outDir: "jscoverage",
                testFiles: ["test/index.html"]
            }
        },
        concat: {
            options: {
                banner: headerComment + "\n"
            },
            js: {
                src: ["src/<%= pkg.name %>.js"],
                dest: "<%= pkg.name %>.js"
            }
        }
    });

    grunt.loadNpmTasks("grunt-contrib-jshint");
    grunt.loadNpmTasks("grunt-contrib-qunit");
    grunt.loadNpmTasks("grunt-contrib-uglify");
    grunt.loadNpmTasks("grunt-css");
    grunt.loadNpmTasks("grunt-qunit-cov");
    grunt.loadNpmTasks("grunt-bump");
    //grunt.loadNpmTasks("grunt-replace");
    grunt.loadNpmTasks("grunt-contrib-concat");

    // TO RUN BEFORE COMMIT
    // ====================
    grunt.registerTask("quick-build", ["concat", "jshint", "csslint", "uglify"]);

    // Full build without version bump
    grunt.registerTask("build", ["concat", "qunit", "qunit-cov", "jshint", "csslint", "uglify"]);

    // TO RUN JUST BEFORE RELEASING A NEW VERSION
    // ==========================================

    // Task for patch version release
    grunt.registerTask("r", ["concat", "qunit", "qunit-cov", "jshint", "csslint", "bump", "uglify"]);

    // Task for minor version release
    grunt.registerTask("rmin", ["concat", "qunit", "qunit-cov", "jshint", "csslint", "bump:minor", "uglify"]);

    // Task for major version release
    grunt.registerTask("rmaj", ["concat", "qunit", "qunit-cov", "jshint", "csslint", "bump:major", "uglify"]);

    // FOR TRAVIS
    // ==========
    grunt.registerTask("travis", ["qunit", "jshint", "csslint"]);
};<|endoftext|>