diff --git a/.editorconfig b/.editorconfig index 88423f2..4a7ea30 100644 --- a/.editorconfig +++ b/.editorconfig @@ -3,7 +3,7 @@ root = true [*] indent_style = space indent_size = 2 -end_of_line = crlf +end_of_line = lf charset = utf-8 trim_trailing_whitespace = true insert_final_newline = true diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..986eb72 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,15 @@ +language: node_js +node_js: + - '6' + - '6.1' + - '6.2' +after_success: + - npm run coverage +deploy: + provider: npm + email: mguilarducci@gmail.com + api_key: + secure: a/9QXR5A1vUFQdO9b7slOjNgyaWvn9CZHm3uirl1R4iW5+8bhcdXFw/2BiDJu6jOw0FeaTBTmI9DtqHyRqA1Ccf5O65BwG/fJqUjOmgPWLItHLyeb+n0AzQuF0Ia4Y+ln4Sri5mvs8tIGSGU0M6gY+XZSo3wGtkqwZ/4x3Bgh6HOQZTIHiGOkm1pQ6Y0K9G9FXYTBaMiiiKwPmnf9IDyGkciDvrvF18cwYS8LpgRE+xnxP1uL7tb2fXxp7+RZTzfrSsc6K49rYyWlySLYd0oXDA3fmBf3kkSj5p09Nusrq+FJMgkmeP+0gJagjZ+Fez0AZ8AcpndsHY6GT3eSOH1B2HqpCt0p3s6+3Yx0yTMgHornUZZcW+UoXihPk9+/AAHjjq40aDEfJRoJN1VyHHewJ+Y2S4LX0iWOyhMm5VBO5laGQ6CXN7qTTEIhsw4aagPx9K8W7qYaLuaZEgSpiluZHipEAlppswpogZFW1hMMvo3H1zlNEHhG2xebKhyI+Y0bQzwAtiC2vqIjLxs/ZYmiKvRktzWuYtDpIp6THJtB88CuD0w4Dwhl+S2tb/9fo5YUZyNMIu4TKo0+PXTjJreHPyNAw0V9LXirZeXyclEuiqLTOyUTlKenQl1abnt0U3ngQM7vUvaICnfHIxvX8N2uEf3UrNx02YxTFME7pDkLpY= + on: + tags: true + repo: mguilarducci/tabeliao-node diff --git a/README.md b/README.md index 3c20672..1f49482 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ # tabelião node -[![Codeship Build][ci-url-badge-master]][ci-url] -[![Coverage Status][coverage-url-badge-master]][coverage-url] +[![Build Status][ci-image]][ci-url] +[![Coverage Status][coverage-image]][coverage-url] +[![Dependencies][dependencies-image]][dependencies-url] +[![Dev dependencies][dependencies-dev-image]][dependencies-dev-url] Biblioteca do [tabelião][tabeliao] para nodejs. @@ -101,7 +103,11 @@ E o result será: ``` [tabeliao]: https://bitbucket.org/stonepayments/tabeliao/ -[ci-url]: https://codeship.com/projects/161445 -[ci-url-badge-master]: https://codeship.com/projects/641f9b50-245d-0134-f619-3a36b972b11f/status?branch=master -[coverage-url]: https://coveralls.io/bitbucket/stonepayments/tabeliao-node -[coverage-url-badge-master]: https://coveralls.io/repos/bitbucket/stonepayments/tabeliao-node/badge.svg?branch=master&t=zxE2x8 +[ci-url]: https://travis-ci.org/mguilarducci/tabeliao-node +[ci-image]: https://travis-ci.org/mguilarducci/tabeliao-node.svg?branch=master +[coverage-url]: https://coveralls.io/github/mguilarducci/tabeliao-node?branch=master +[coverage-image]: https://coveralls.io/repos/mguilarducci/tabeliao-node/badge.svg?branch=master&service=github +[dependencies-url]: https://david-dm.org/mguilarducci/tabeliao-node +[dependencies-image]: https://david-dm.org/mguilarducci/tabeliao-node.svg +[dependencies-dev-url]: https://david-dm.org/mguilarducci/tabeliao-node#info=devDependencies&view=table +[dependencies-dev-image]: https://david-dm.org/mguilarducci/tabeliao-node/dev-status.svg diff --git a/lib/tabeliao.js b/lib/tabeliao.js index 8c073d6..8f37b89 100644 --- a/lib/tabeliao.js +++ b/lib/tabeliao.js @@ -29,11 +29,11 @@ function getServiceId(pkg) { } function getPort(options) { - return options && options.port || 3000; + return (options && options.port) || 3000; } function getHost(options) { - return options && options.host || 'localhost'; + return (options && options.host) || 'localhost'; } function getProtocol(options) { @@ -92,7 +92,7 @@ function register(options, cb) { function getKeyValue(result, key, cb) { /* eslint no-param-reassign: 0 */ consul.kv.get(key, function res(err, data) { - var value = !err && data && data.Value || null; + var value = (!err && data && data.Value) || null; try { result[key] = JSON.parse(value); } catch (ex) { diff --git a/package.json b/package.json index a27a52b..bc3706b 100644 --- a/package.json +++ b/package.json @@ -10,11 +10,11 @@ "devDependencies": { "chai": "^3.5.0", "coveralls": "^2.11.9", - "eslint": "^2.13.1", - "eslint-config-airbnb-base": "^3.0.1", - "eslint-plugin-import": "^1.9.2", + "eslint": "^3.1.1", + "eslint-config-airbnb-base": "^4.0.2", + "eslint-plugin-import": "^1.11.0", "grunt": "^1.0.1", - "grunt-eslint": "^18.1.0", + "grunt-eslint": "^19.0.0", "grunt-mocha-test": "^0.12.7", "istanbul": "^0.4.4", "load-grunt-tasks": "^3.5.0",