-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from tschaub/dest-mtime
Check mtime of dest file if present. This only has an effect in cases where a target has multiple dest files and a previous run failed after one or more of the dest files had been created.
- Loading branch information
Showing
10 changed files
with
166 additions
and
19 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
var path = require('path'); | ||
|
||
|
||
/** | ||
* @param {Object} grunt Grunt. | ||
*/ | ||
module.exports = function(grunt) { | ||
|
||
var log = []; | ||
|
||
grunt.initConfig({ | ||
newer: { | ||
options: { | ||
timestamps: path.join(__dirname, '.cache') | ||
} | ||
}, | ||
modified: { | ||
one: { | ||
files: [{ | ||
expand: true, | ||
cwd: 'src/', | ||
src: 'one.coffee', | ||
dest: 'dest/', | ||
ext: '.js' | ||
}] | ||
}, | ||
all: { | ||
files: [{ | ||
expand: true, | ||
cwd: 'src/', | ||
src: '**/*.coffee', | ||
dest: 'dest/', | ||
ext: '.js' | ||
}] | ||
}, | ||
none: { | ||
src: [] | ||
} | ||
}, | ||
log: { | ||
all: { | ||
files: [{ | ||
expand: true, | ||
cwd: 'src/', | ||
src: '**/*.coffee', | ||
dest: 'dest/', | ||
ext: '.js' | ||
}], | ||
getLog: function() { | ||
return log; | ||
} | ||
} | ||
}, | ||
assert: { | ||
that: { | ||
getLog: function() { | ||
return log; | ||
} | ||
} | ||
} | ||
}); | ||
|
||
grunt.loadTasks('../../../tasks'); | ||
grunt.loadTasks('../../../test/tasks'); | ||
|
||
grunt.registerTask('default', function() { | ||
|
||
grunt.task.run([ | ||
// run the log task with newer, expect all files | ||
'newer:log', | ||
'assert:that:modified:all', | ||
|
||
// HFS+ filesystem mtime resolution | ||
'wait:1001', | ||
|
||
// modify one file | ||
'modified:one', | ||
|
||
// run assert task again, expect one file | ||
'newer:log', | ||
'assert:that:modified:one', | ||
|
||
// HFS+ filesystem mtime resolution | ||
'wait:1001', | ||
|
||
// modify nothing, expect no files | ||
'newer:log', | ||
'assert:that:modified:none' | ||
|
||
]); | ||
|
||
}); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
coffee = | ||
is: 'good' | ||
hot: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
semicolons = true | ||
coffee = true | ||
semicolons = false if coffee |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
var path = require('path'); | ||
|
||
var helper = require('./helper'); | ||
|
||
var name = 'newer-dest'; | ||
var gruntfile = path.join(name, 'gruntfile.js'); | ||
|
||
describe(name, function() { | ||
var fixture; | ||
|
||
it('runs the default task (see ' + gruntfile + ')', function(done) { | ||
this.timeout(3000); | ||
helper.buildFixture(name, function(error, dir) { | ||
fixture = dir; | ||
done(error); | ||
}); | ||
}); | ||
|
||
after(function(done) { | ||
helper.afterFixture(fixture, done); | ||
}); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters