diff --git a/.travis.yml b/.travis.yml index 09e2c20d0c..3c6198ae58 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,4 +18,5 @@ script: - npm run test-cov after_script: + - npm install coveralls - cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js \ No newline at end of file diff --git a/bin/hexo b/bin/hexo index 569c814649..7344e8dfba 100755 --- a/bin/hexo +++ b/bin/hexo @@ -2,4 +2,4 @@ 'use strict'; -require('hexo-cli')(); \ No newline at end of file +require('hexo-cli')(); diff --git a/lib/box/file.js b/lib/box/file.js index 663ddcd1ff..6558da18c2 100644 --- a/lib/box/file.js +++ b/lib/box/file.js @@ -52,7 +52,7 @@ File.prototype.read = function(options, callback) { if (options.escape) return resolve(escapeContent(result)); resolve(result); - }).nodeify(callback); + }).asCallback(callback); }; File.prototype.readSync = function(options) { @@ -89,7 +89,7 @@ File.prototype.stat = function(options, callback) { if (stats && cache) return resolve(stats); fs.stat(self.source).then(resolve, reject); - }).nodeify(callback); + }).asCallback(callback); }; File.prototype.statSync = function(options) { diff --git a/lib/box/index.js b/lib/box/index.js index 03f0e7a8cb..50b3a2412b 100644 --- a/lib/box/index.js +++ b/lib/box/index.js @@ -56,7 +56,7 @@ function Box(ctx, base, options) { text: content, path: self.source }, options); - }).nodeify(callback); + }).asCallback(callback); }; _File.prototype.renderSync = function(options) { @@ -99,7 +99,7 @@ Box.prototype.process = function(callback) { return self._process(files).finally(function() { files.length = 0; }); - }).nodeify(callback); + }).asCallback(callback); }; Box.prototype.load = Box.prototype.process; @@ -360,7 +360,7 @@ Box.prototype.watch = function(callback) { }); return watcher; - }).nodeify(callback); + }).asCallback(callback); }; Box.prototype.unwatch = function() { diff --git a/lib/hexo/index.js b/lib/hexo/index.js index da46eec3ff..bbcf1f05ea 100644 --- a/lib/hexo/index.js +++ b/lib/hexo/index.js @@ -193,7 +193,7 @@ Hexo.prototype.call = function(name, args, callback) { } else { reject(new Error('Console `' + name + '` has not been registered yet!')); } - }).nodeify(callback); + }).asCallback(callback); }; Hexo.prototype.model = function(name, schema) { @@ -227,7 +227,7 @@ Hexo.prototype.loadPlugin = function(path, callback) { var fn = vm.runInThisContext(script, path); return fn(module.exports, require, module, path, pathFn.dirname(path), self); - }).nodeify(callback); + }).asCallback(callback); }; Hexo.prototype._showDrafts = function() { @@ -245,7 +245,7 @@ Hexo.prototype.load = function(callback) { ]); }).then(function() { return self._generate({cache: true}); - }).nodeify(callback); + }).asCallback(callback); }; Hexo.prototype.watch = function(callback) { @@ -263,7 +263,7 @@ Hexo.prototype.watch = function(callback) { }).then(function() { self.on('processAfter', generate); return generate(); - }).nodeify(callback); + }).asCallback(callback); }; Hexo.prototype.unwatch = function() { diff --git a/lib/hexo/post.js b/lib/hexo/post.js index dbe946f402..18e76fc226 100644 --- a/lib/hexo/post.js +++ b/lib/hexo/post.js @@ -119,7 +119,7 @@ Post.prototype.create = function(data, replace, callback) { ]).then(function() { ctx.emit('new', result); }).thenReturn(result); - }).nodeify(callback); + }).asCallback(callback); }; function prepareFrontMatter(data) { @@ -226,7 +226,7 @@ Post.prototype.publish = function(data, replace, callback) { return fs.rmdir(assetSrc); }); }); - }).thenReturn(result).nodeify(callback); + }).thenReturn(result).asCallback(callback); }; Post.prototype.render = function(source, data, callback) { diff --git a/lib/hexo/render.js b/lib/hexo/render.js index 1d769abe8d..19abf7a072 100644 --- a/lib/hexo/render.js +++ b/lib/hexo/render.js @@ -62,7 +62,7 @@ Render.prototype.render = function(data, options, callback) { context: ctx, args: [data] }); - }).nodeify(callback); + }).asCallback(callback); }; Render.prototype.renderSync = function(data, options) { diff --git a/lib/hexo/scaffold.js b/lib/hexo/scaffold.js index 1cfb9225ed..bccb80bcc8 100644 --- a/lib/hexo/scaffold.js +++ b/lib/hexo/scaffold.js @@ -55,7 +55,7 @@ Scaffold.prototype.get = function(name, callback) { } return self.defaults[name]; - }).nodeify(callback); + }).asCallback(callback); }; Scaffold.prototype.set = function(name, content, callback) { @@ -66,7 +66,7 @@ Scaffold.prototype.set = function(name, content, callback) { if (!pathFn.extname(path)) path += '.md'; return fs.writeFile(path, content); - }).nodeify(callback); + }).asCallback(callback); }; Scaffold.prototype.remove = function(name, callback) { @@ -74,7 +74,7 @@ Scaffold.prototype.remove = function(name, callback) { if (!item) return; return fs.unlink(item.path); - }).nodeify(callback); + }).asCallback(callback); }; module.exports = Scaffold; diff --git a/lib/theme/view.js b/lib/theme/view.js index 49a27b9809..76b04ff7fe 100644 --- a/lib/theme/view.js +++ b/lib/theme/view.js @@ -37,7 +37,7 @@ View.prototype.render = function(options, callback) { layoutLocals.layout = false; return layoutView.render(layoutLocals, callback); - }).nodeify(callback); + }).asCallback(callback); }; View.prototype.renderSync = function(options) { diff --git a/package.json b/package.json index 38f94361de..38f58a1929 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "eslint": "eslint .", "jscs": "jscs .", "test": "mocha test/index.js", - "test-cov": "istanbul cover --print both _mocha -- test/index.js && istanbul check-coverage" + "test-cov": "istanbul cover --print both _mocha -- test/index.js" }, "directories": { "lib": "./lib", @@ -31,41 +31,40 @@ "author": "Tommy Chen (http://zespia.tw)", "license": "MIT", "dependencies": { - "abbrev": "^1.0.5", + "abbrev": "^1.0.7", "archy": "^1.0.0", - "bluebird": "^2.9.8", - "bunyan": "^1.3.3", - "chalk": "^1.0.0", + "bluebird": "^3.0.3", + "bunyan": "^1.5.1", + "chalk": "^1.1.1", "cheerio": "^0.19.0", - "hexo-cli": "^0.1.6", - "hexo-front-matter": "^0.2.1", - "hexo-fs": "^0.1.3", + "hexo-cli": "^0.1.8", + "hexo-front-matter": "^0.2.2", + "hexo-fs": "^0.1.4", "hexo-i18n": "^0.2.1", "hexo-util": "^0.1.7", - "js-yaml": "^3.2.5", - "lodash": "^3.2.0", - "minimatch": "^2.0.1", - "moment": "~2.10.3", - "moment-timezone": "^0.4.0", + "js-yaml": "^3.4.3", + "lodash": "^3.10.1", + "minimatch": "^3.0.0", + "moment": "~2.10.6", + "moment-timezone": "^0.4.1", "nunjucks": "^2.1.0", - "pretty-hrtime": "^1.0.0", - "strip-indent": "^1.0.0", + "pretty-hrtime": "^1.0.1", + "strip-indent": "^1.0.1", "swig": "1.4.2", "swig-extras": "0.0.1", "text-table": "^0.2.0", "through2": "^2.0.0", - "tildify": "^1.0.0", + "tildify": "^1.1.2", "titlecase": "^1.0.2", - "warehouse": "^1.0.2" + "warehouse": "^1.0.3" }, "devDependencies": { - "chai": "^3.2.0", - "coveralls": "^2.11.2", - "eslint": "^1.5.0", - "hexo-renderer-marked": "^0.2.3", - "istanbul": "^0.3.20", - "jscs": "^2.1.1", - "mocha": "^2.0.1", - "sinon": "^1.12.2" + "chai": "^3.4.0", + "eslint": "^1.8.0", + "hexo-renderer-marked": "^0.2.5", + "istanbul": "^0.4.0", + "jscs": "^2.5.0", + "mocha": "^2.3.3", + "sinon": "^1.17.2" } } diff --git a/test/scripts/helpers/gravatar.js b/test/scripts/helpers/gravatar.js index 90b19ae353..e3166b2823 100644 --- a/test/scripts/helpers/gravatar.js +++ b/test/scripts/helpers/gravatar.js @@ -14,11 +14,11 @@ describe('gravatar', function() { var hash = md5(email); it('default', function() { - gravatar(email).should.eql('http://www.gravatar.com/avatar/' + hash); + gravatar(email).should.eql('https://www.gravatar.com/avatar/' + hash); }); it('size', function() { - gravatar(email, 100).should.eql('http://www.gravatar.com/avatar/' + hash + '?s=100'); + gravatar(email, 100).should.eql('https://www.gravatar.com/avatar/' + hash + '?s=100'); }); it('options', function() { @@ -26,6 +26,6 @@ describe('gravatar', function() { s: 200, r: 'pg', d: 'mm' - }).should.eql('http://www.gravatar.com/avatar/' + hash + '?s=200&r=pg&d=mm'); + }).should.eql('https://www.gravatar.com/avatar/' + hash + '?s=200&r=pg&d=mm'); }); });