Skip to content

Commit bfc57ee

Browse files
committed
Fixes #8. Closes #10. Stable Version 2.2.0.
1 parent 078d765 commit bfc57ee

File tree

8 files changed

+255
-213
lines changed

8 files changed

+255
-213
lines changed

.jshintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"node": false,
33
"browser": true,
44
"esnext": true,
5+
"asi": true,
56
"bitwise": true,
67
"camelcase": true,
78
"curly": true,

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
##### 2.2.0 - 09 September 2015
2+
3+
###### Backwards compatible API changes
4+
- #8 - Added support for changing host and port
5+
16
##### 2.1.0 - 10 July 2015
27

38
###### Backwards compatible API changes

CONTRIBUTING.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributing Guide
22

3-
First, support is handled via the [Mailing List](https://groups.io/org/groupsio/jsdata). Ask your questions there.
3+
First, support is handled via the [Gitter Channel](https://gitter.im/js-data/js-data) and the [Mailing List](https://groups.io/org/groupsio/jsdata). Ask your questions there.
44

55
When submitting issues on GitHub, please include as much detail as possible to make debugging quick and easy.
66

@@ -10,14 +10,15 @@ When submitting issues on GitHub, please include as much detail as possible to m
1010

1111
[Github Issues](https://github.com/js-data/js-data-redis/issues).
1212

13-
#### Pull Requests
13+
#### Submitting Pull Requests
1414

15-
1. Contribute to the issue that is the reason you'll be developing in the first place
15+
1. Contribute to the issue/discussion that is the reason you'll be developing in the first place
1616
1. Fork js-data-redis
17-
1. `git clone https://github.com/<you>/js-data-redis.git`
17+
1. `git clone git@github.com:<you>/js-data-redis.git`
1818
1. `cd js-data-redis; npm install; bower install;`
19-
1. `grunt go` (builds and starts a watch)
20-
1. (in another terminal) `grunt karma:dev` (runs the tests)
2119
1. Write your code, including relevant documentation and tests
22-
1. Submit a PR and we'll review
23-
20+
1. Run `grunt test` (build and test)
21+
1. Your code will be linted and checked for formatting, the tests will be run
22+
1. The `dist/` folder & files will be generated, do NOT commit `dist/*`! They will be committed when a release is cut.
23+
1. Submit your PR and we'll review!
24+
1. Thanks!

Gruntfile.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,27 @@ module.exports = function (grunt) {
6868
}
6969
});
7070

71+
grunt.registerTask('standard', function () {
72+
var child_process = require('child_process');
73+
var done = this.async();
74+
grunt.log.writeln('Linting for correcting formatting...');
75+
child_process.exec('node node_modules/standard/bin/cmd.js --parser babel-eslint src/index.js', function (err, stdout) {
76+
console.log(stdout);
77+
if (err) {
78+
grunt.log.writeln('Failed due to ' + (stdout.split('\n').length - 2) + ' lint errors!');
79+
done(err);
80+
} else {
81+
grunt.log.writeln('Done linting.');
82+
done();
83+
}
84+
});
85+
});
86+
7187
grunt.registerTask('n', ['mochaTest']);
7288

7389
grunt.registerTask('test', ['build', 'n']);
7490
grunt.registerTask('build', [
91+
'standard',
7592
'webpack'
7693
]);
7794
grunt.registerTask('go', ['build', 'watch:dist']);

README.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ __Latest Release:__ [![Latest Release](https://img.shields.io/github/release/js-
1313

1414
__Status:__
1515

16-
[![Dependency Status](https://img.shields.io/gemnasium/js-data/js-data-redis.svg?style=flat-square)](https://gemnasium.com/js-data/js-data-redis) [![Codacity](https://img.shields.io/codacy/64cca2890a594370a5c9f4d5c0e3fcc3.svg?style=flat-square)](https://www.codacy.com/public/jasondobry/js-data-redis/dashboard)
16+
[![Codacity](https://img.shields.io/codacy/64cca2890a594370a5c9f4d5c0e3fcc3.svg?style=flat-square)](https://www.codacy.com/public/jasondobry/js-data-redis/dashboard)
1717

1818
__Supported Platforms:__
1919

@@ -28,7 +28,10 @@ var DSRedisAdapter = require('js-data-redis');
2828

2929
var store = new JSData.DS();
3030

31-
var adapter = new DSRedisAdapter();
31+
var adapter = new DSRedisAdapter({
32+
host: 'my.domain.com',
33+
port: 3333
34+
});
3235

3336
store.registerAdapter('redis', adapter, { default: true });
3437

@@ -48,7 +51,7 @@ store.registerAdapter('redis', adapter, { default: true });
4851

4952
### Contributing
5053

51-
First, support is handled via the [Mailing List](https://groups.io/org/groupsio/jsdata). Ask your questions there.
54+
First, support is handled via the [Gitter Channel](https://gitter.im/js-data/js-data) and the [Mailing List](https://groups.io/org/groupsio/jsdata). Ask your questions there.
5255

5356
When submitting issues on GitHub, please include as much detail as possible to make debugging quick and easy.
5457

@@ -58,16 +61,18 @@ When submitting issues on GitHub, please include as much detail as possible to m
5861

5962
[Github Issues](https://github.com/js-data/js-data-redis/issues).
6063

61-
#### Pull Requests
64+
#### Submitting Pull Requests
6265

63-
1. Contribute to the issue that is the reason you'll be developing in the first place
66+
1. Contribute to the issue/discussion that is the reason you'll be developing in the first place
6467
1. Fork js-data-redis
65-
1. `git clone https://github.com/<you>/js-data-redis.git`
68+
1. `git clone git@github.com:<you>/js-data-redis.git`
6669
1. `cd js-data-redis; npm install; bower install;`
67-
1. `grunt go` (builds and starts a watch)
68-
1. (in another terminal) `grunt karma:dev` (runs the tests)
6970
1. Write your code, including relevant documentation and tests
70-
1. Submit a PR and we'll review
71+
1. Run `grunt test` (build and test)
72+
1. Your code will be linted and checked for formatting, the tests will be run
73+
1. The `dist/` folder & files will be generated, do NOT commit `dist/*`! They will be committed when a release is cut.
74+
1. Submit your PR and we'll review!
75+
1. Thanks!
7176

7277
### License
7378

dist/js-data-redis.js

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ module.exports =
6666
var emptyStore = new JSData.DS();
6767
var filter = emptyStore.defaults.defaultFilter;
6868

69-
var getPath = function getPath(resourceConfig) {
69+
function getPath(resourceConfig) {
7070
if (resourceConfig) {
7171
return resourceConfig.table || underscore(resourceConfig.name);
7272
}
73-
};
73+
}
7474

7575
var Defaults = function Defaults() {
7676
_classCallCheck(this, Defaults);
@@ -81,9 +81,15 @@ module.exports =
8181
_classCallCheck(this, DSRedisAdapter);
8282

8383
options = options || {};
84+
85+
var host = options.hasOwnProperty('host') ? options.host : '127.0.0.1';
86+
delete options.host;
87+
var port = options.hasOwnProperty('port') ? options.port : 6379;
88+
delete options.port;
89+
8490
this.defaults = new Defaults();
8591
DSUtils.deepMixIn(this.defaults, options);
86-
this.client = redis.createClient(this.defaults);
92+
this.client = redis.createClient(port, host, this.defaults);
8793
}
8894

8995
_createClass(DSRedisAdapter, [{
@@ -417,37 +423,37 @@ module.exports =
417423

418424
/***/ },
419425
/* 1 */
420-
/***/ function(module, exports, __webpack_require__) {
426+
/***/ function(module, exports) {
421427

422428
module.exports = require("js-data");
423429

424430
/***/ },
425431
/* 2 */
426-
/***/ function(module, exports, __webpack_require__) {
432+
/***/ function(module, exports) {
427433

428434
module.exports = require("redis");
429435

430436
/***/ },
431437
/* 3 */
432-
/***/ function(module, exports, __webpack_require__) {
438+
/***/ function(module, exports) {
433439

434440
module.exports = require("mout/array/map");
435441

436442
/***/ },
437443
/* 4 */
438-
/***/ function(module, exports, __webpack_require__) {
444+
/***/ function(module, exports) {
439445

440446
module.exports = require("mout/array/unique");
441447

442448
/***/ },
443449
/* 5 */
444-
/***/ function(module, exports, __webpack_require__) {
450+
/***/ function(module, exports) {
445451

446452
module.exports = require("mout/string/underscore");
447453

448454
/***/ },
449455
/* 6 */
450-
/***/ function(module, exports, __webpack_require__) {
456+
/***/ function(module, exports) {
451457

452458
module.exports = require("mout/random/guid");
453459

package.json

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "js-data-redis",
33
"description": "Redis adapter for js-data.",
4-
"version": "2.1.0",
4+
"version": "2.2.0",
55
"homepage": "http://www.js-data.io/docs/dsredisadapter",
66
"repository": {
77
"type": "git",
@@ -22,19 +22,21 @@
2222
"redis"
2323
],
2424
"devDependencies": {
25-
"babel-core": "5.6.17",
26-
"babel-loader": "5.3.1",
27-
"bluebird": "2.9.33",
28-
"chai": "3.0.0",
25+
"babel-core": "5.8.23",
26+
"babel-eslint": "^4.1.1",
27+
"babel-loader": "5.3.2",
28+
"bluebird": "2.10.0",
29+
"chai": "3.2.0",
2930
"grunt": "0.4.5",
3031
"grunt-contrib-watch": "0.6.1",
31-
"grunt-karma-coveralls": "2.5.3",
32+
"grunt-karma-coveralls": "2.5.4",
3233
"grunt-mocha-test": "0.12.7",
3334
"grunt-webpack": "1.0.11",
3435
"jit-grunt": "0.9.1",
3536
"jshint": "2.8.0",
3637
"jshint-loader": "0.8.3",
37-
"sinon": "1.15.4",
38+
"sinon": "1.16.1",
39+
"standard": "^5.2.2",
3840
"time-grunt": "1.2.1",
3941
"webpack-dev-server": "1.10.1"
4042
},

0 commit comments

Comments
 (0)