Skip to content

Commit

Permalink
Update for Grunt v0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
shama committed Nov 21, 2012
1 parent ef71b4b commit 08693d0
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 54 deletions.
15 changes: 15 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"curly": true,
"eqeqeq": true,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"sub": true,
"undef": true,
"unused": true,
"boss": true,
"eqnull": true,
"node": true,
"es5": true
}
30 changes: 30 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
module.exports = function(grunt) {
'use strict';
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jam: {
dist: {
src: ['test/fixtures/**/*.js'],
dest: 'test/output/<%= pkg.name %>.js'
}
},
nodeunit: {
files: ['test/*.js']
},
jshint: {
files: ['Gruntfile.js', 'tasks/*.js', 'test/*.js'],
options: {
jshintrc: '.jshintrc'
}
},
watch: {
files: '<%= jshint.files %>',
tasks: ['default']
}
});
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadTasks('tasks');
grunt.registerTask('default', ['jam', 'jshint', 'nodeunit']);
};
41 changes: 0 additions & 41 deletions grunt.js

This file was deleted.

13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"url": "https://github.com/shama/grunt-jam/blob/master/LICENSE-MIT"
}
],
"main": "grunt.js",
"main": "Gruntfile.js",
"bin": "bin/grunt-jam",
"engines": {
"node": "*"
Expand All @@ -29,12 +29,15 @@
"test": "jam install jquery && grunt"
},
"dependencies": {
"grunt-lib-contrib": "~0.3.0",
"jamjs": "~0.2.11"
"jamjs": "~0.2.11",
"grunt-lib-contrib": "~0.4.0"
},
"devDependencies": {
"grunt": "~0.3.15",
"rimraf": "~2.0.2"
"grunt": "~0.4.0a",
"rimraf": "~2.0.2",
"grunt-contrib-jshint": "~0.1.0",
"grunt-contrib-nodeunit": "~0.1.1",
"grunt-contrib-watch": "~0.1.4"
},
"keywords": [
"gruntplugin",
Expand Down
6 changes: 3 additions & 3 deletions tasks/jam.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ module.exports = function(grunt) {

grunt.verbose.writeflags(options, 'Options');

// TODO: ditch this when grunt v0.4 is released
this.files = this.files || helpers.normalizeMultiTaskFiles(this.data, this.target);
// TODO: change this when grunt v0.4 is released
var files = helpers.normalizeMultiTaskFiles(this.data, this.target);

var done = this.async();

grunt.util.async.forEachSeries(this.files, function(file, next) {
grunt.util.async.forEachSeries(files, function(file, next) {
options.output = path.normalize(file.dest);

file.src = file.src || [];
Expand Down
6 changes: 1 addition & 5 deletions test/jam_test.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
'use strict';

var grunt = require('grunt');
var fs = require('fs');
var path = require('path');
var rimraf = require('rimraf');
var jam = require('../tasks/lib/jam').init(grunt);

// node v0.8/6 compat
var existsSync = fs.existsSync || path.existsSync;

exports.jam = {
tearDown: function(done) {
rimraf.sync(path.join('test', 'output'));
Expand All @@ -29,7 +25,7 @@ exports.jam = {
jam.compile(opts, function(err) {
if (err) {throw err;}
var result = grunt.file.read(path.join('test', 'output', 'testing.js'));
test.ok((result.indexOf('http://jquery.com/') !== -1));
test.ok((result.indexOf('jquery.com') !== -1));
test.done();
});
}
Expand Down

0 comments on commit 08693d0

Please sign in to comment.