diff --git a/.travis.yml b/.travis.yml index 60bbd48..9353a60 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 \ No newline at end of file diff --git a/package.json b/package.json index a33eb2d..fbf77a8 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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" diff --git a/tasks/rev.js b/tasks/rev.js index f6f77c2..a9cec8f 100644 --- a/tasks/rev.js +++ b/tasks/rev.js @@ -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); }