Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
language: node_js
node_js:
- "0.8"
- "0.10"
before_script:
- npm update -q
- npm --version
- npm install -g grunt-cli
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "grunt-rev",
"description": "Static file asset revisioning through content hashing",
"version": "0.1.0",
"version": "0.1.1",
"homepage": "https://github.com/cbas/grunt-rev",
"author": {
"name": "Sebastiaan Deckers",
Expand All @@ -23,17 +23,17 @@
],
"main": "Gruntfile.js",
"engines": {
"node": ">= 0.8.0"
"node": ">= 0.10.0"
},
"scripts": {
"test": "grunt test"
},
"devDependencies": {
"grunt-contrib-copy": "0.4.0",
"grunt-contrib-jshint": "0.1.1rc6",
"grunt-contrib-clean": "0.4.0rc6",
"grunt-contrib-nodeunit": "0.1.2rc6",
"grunt": "0.4.0rc6"
"grunt-contrib-copy": ">=0.8.0",
"grunt-contrib-jshint": ">=0.11.1",
"grunt-contrib-clean": ">=0.6.0",
"grunt-contrib-nodeunit": ">=0.4.1",
"grunt": ">=0.4.0"
},
"keywords": [
"gruntplugin"
Expand Down
6 changes: 4 additions & 2 deletions tasks/rev.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ var fs = require('fs'),
module.exports = function(grunt) {

function md5(filepath, algorithm, encoding, fileEncoding) {
var hash = crypto.createHash(algorithm);
var hash = crypto.createHash(algorithm),
fsOptions = {encoding: fileEncoding};

grunt.log.verbose.write('Hashing ' + filepath + '...');
hash.update(grunt.file.read(filepath), fileEncoding);
hash.update(fs.readFileSync(filepath, fsOptions), fileEncoding);
return hash.digest(encoding);
}

Expand Down