From b208bdfb08b3513169980d7d67d2f8ef58009df7 Mon Sep 17 00:00:00 2001 From: Nick Sullivan Date: Fri, 12 Oct 2012 12:12:28 -0700 Subject: [PATCH 1/5] initial travis.yml file for ci testing with travis-ci.org --- .travis.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..f2c49b67 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,17 @@ +language: node_js + +# test on these node.js versions +node_js: + - 0.9 + +before_script: + # Run lint on every commit + - grunt lint + +notifications: + email: + recipients: + - dbrans@gmail.com + - nick@sullivanflock.com + on_success: [change] + on_failure: [always] From 41abace0f60001e18ffa067da6c529cbabf4d6fd Mon Sep 17 00:00:00 2001 From: Nick Sullivan Date: Fri, 12 Oct 2012 12:15:57 -0700 Subject: [PATCH 2/5] grunt added, lint task setup --- grunt.js | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ package.json | 4 +++- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 grunt.js diff --git a/grunt.js b/grunt.js new file mode 100644 index 00000000..f0676da4 --- /dev/null +++ b/grunt.js @@ -0,0 +1,56 @@ +module.exports = function(grunt) { + + // Project configuration. + grunt.initConfig({ + pkg: '', + + // run jshint on the files, with the options described below. Different globals defined based on file type + // 'node' for files that are run by node.js (module, process, etc.) + // 'browser' for files that are run by a browser (window, document, etc.) + lint: { + node: ['grunt.js'], + browser: ['postscribe.js'] + }, + jshint: { + // Apply to all js files + options: { + curly: true, + eqeqeq: true, + expr: true, + forin: true, + indent: 2, + latedef: false, + newcap: true, + noarg: true, + noempty: true, // debatable + sub: true, + undef: true, // Really. Leave it + unused: true + }, + globals: {}, + // Just for the 'node' src files + node: { + globals: {console: true, process: true, module:true, require: true, __dirname: true, exports: true} + }, + // Just for the 'browser' src files + browser: { + // Let's be very strict here + options: { + loopfunc: true, + expr: true, + evil: true, // Reluctantly added + eqnull: true + }, + globals: {} + } + } + + }); + + // Alias test + grunt.registerTask('test', 'qunit'); + + // This is what gets run when you don't specify an argument for grunt. + grunt.registerTask('default', 'lint'); + +}; diff --git a/package.json b/package.json index caac0ea7..c4b04e3a 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,9 @@ } ], "dependencies": {}, - "devDependencies": {}, + "devDependencies": { + "grunt": "~0.3.16" + }, "homepage": "https://github.com/krux/postscribe", "os": [], "cpu": [], From eb822522f3a92d7f90731e3b29214ca85465ad3c Mon Sep 17 00:00:00 2001 From: Nick Sullivan Date: Fri, 12 Oct 2012 12:24:03 -0700 Subject: [PATCH 3/5] Run qunit tests with grunt --- grunt.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/grunt.js b/grunt.js index f0676da4..3086126d 100644 --- a/grunt.js +++ b/grunt.js @@ -43,6 +43,10 @@ module.exports = function(grunt) { }, globals: {} } + }, + + qunit: { + files: ['test/test.html'] } }); @@ -51,6 +55,6 @@ module.exports = function(grunt) { grunt.registerTask('test', 'qunit'); // This is what gets run when you don't specify an argument for grunt. - grunt.registerTask('default', 'lint'); + grunt.registerTask('default', 'lint test'); }; From cf811e843ff4c79b28c27d6c4b3cbff3d622c59e Mon Sep 17 00:00:00 2001 From: Nick Sullivan Date: Fri, 12 Oct 2012 12:24:43 -0700 Subject: [PATCH 4/5] alias npm test to grunt test (for travis) --- package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index c4b04e3a..d56f4f26 100644 --- a/package.json +++ b/package.json @@ -44,5 +44,7 @@ "engines": { "node": ">=0.8" }, - "scripts": {} + "scripts": { + "test": "grunt test" + } } From a2a4f59d14849459ed9c6c3710589b3d6cc09916 Mon Sep 17 00:00:00 2001 From: Nick Sullivan Date: Fri, 12 Oct 2012 12:28:30 -0700 Subject: [PATCH 5/5] build status on the readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index d41e1b69..3c9f8f4c 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ # First! + +Build Status: [![Build Status](https://secure.travis-ci.org/krux/postscribe.png)](http://travis-ci.org/krux/postscribe)