diff --git a/.gitignore b/.gitignore index 7cb20102..012b2508 100644 --- a/.gitignore +++ b/.gitignore @@ -12,4 +12,5 @@ Gemfile.lock pkg/* .sass-cache/* src/html/.sass-cache/* -node_modules/ \ No newline at end of file +node_modules/ +*.swp diff --git a/Gruntfile.js b/Gruntfile.js index 1dc6824d..b0939d27 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -15,6 +15,8 @@ module.exports = function(grunt) { grunt.loadNpmTasks('grunt-contrib-compass'); grunt.loadNpmTasks('grunt-contrib-compress'); + grunt.loadTasks('grunt/tasks'); + grunt.registerTask('default', ['jshint:all']); var version = require('./grunt/tasks/version.js'); @@ -35,24 +37,6 @@ module.exports = function(grunt) { ] ); - grunt.registerTask("build:compileSpecRunner", - "Processes the spec runner template and writes to a tmp file", - standaloneBuilder.compileSpecRunner - ); - - grunt.registerTask("build:cleanSpecRunner", - "Deletes the tmp spec runner file", - standaloneBuilder.cleanSpecRunner - ); - - grunt.registerTask("buildStandaloneDist", - "Builds a standalone distribution", - [ - "build:compileSpecRunner", - "compress:standalone", - "build:cleanSpecRunner" - ] - ); var spec = require('./grunt/tasks/spec.js'); @@ -61,4 +45,4 @@ module.exports = function(grunt) { spec.execSpecsInNode ); -}; \ No newline at end of file +}; diff --git a/grunt/tasks/build_standalone.js b/grunt/tasks/build_standalone.js index 84482b8d..e700c12a 100644 --- a/grunt/tasks/build_standalone.js +++ b/grunt/tasks/build_standalone.js @@ -1,17 +1,30 @@ var grunt = require("grunt"); function standaloneTmpDir(path) { return "dist/tmp/" + path; } + +grunt.registerTask("build:compileSpecRunner", + "Processes the spec runner template and writes to a tmp file", + function() { + var runnerHtml = grunt.template.process( + grunt.file.read("grunt/templates/SpecRunner.html.jst"), + { data: { jasmineVersion: global.jasmineVersion }}); -module.exports = { - compileSpecRunner: function() { - var runnerHtml = grunt.template.process( - grunt.file.read("grunt/templates/SpecRunner.html.jst"), - { data: { jasmineVersion: global.jasmineVersion }}); + grunt.file.write(standaloneTmpDir("SpecRunner.html"), runnerHtml); + } +); - grunt.file.write(standaloneTmpDir("SpecRunner.html"), runnerHtml); - }, +grunt.registerTask("build:cleanSpecRunner", + "Deletes the tmp spec runner file", + function() { + grunt.file.delete(standaloneTmpDir("")); + } +); - cleanSpecRunner: function() { - grunt.file.delete(standaloneTmpDir("")); - } -}; +grunt.registerTask("buildStandaloneDist", + "Builds a standalone distribution", + [ + "build:compileSpecRunner", + "compress:standalone", + "build:cleanSpecRunner" + ] +);