Skip to content

Commit 8a079e1

Browse files
committed
Conform to sindresorhus/gulp-plugin-boilerplate
1 parent 62e52d2 commit 8a079e1

9 files changed

+58
-36
lines changed

.editorconfig

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
root = true
22

33
[*]
4-
indent_style = space
5-
indent_size = 2
4+
indent_style = tab
65
end_of_line = lf
76
charset = utf-8
87
trim_trailing_whitespace = true
98
insert_final_newline = true
109

10+
[{package.json,*.yml}]
11+
indent_style = space
12+
indent_size = 2
13+
1114
[*.md]
1215
trim_trailing_whitespace = false

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/node_modules
1+
node_modules

.jshintrc

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"node": true,
3+
"esnext": true,
4+
"bitwise": true,
5+
"curly": true,
6+
"immed": true,
7+
"newcap": true,
8+
"noarg": true,
9+
"undef": true,
10+
"unused": "vars",
11+
"strict": true,
12+
"mocha": true
13+
}

.travis.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
language: node_js
22
sudo: false
33
node_js:
4-
- "0.12"
4+
- 'iojs'
5+
- '0.10'
6+
- '0.12'
57
notifications:
68
email: false

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ Gulp plugin to run [json-server](https://github.com/typicode/json-server).
1111

1212
## License
1313

14-
[MIT License](./LICENSE)
14+
[MIT](./LICENSE) © [Conor McNamara](https://github.com/conortm)

index.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ module.exports = function(options) {
77
if (!options) {
88
throw new gutil.PluginError('gulp-json-server', 'Missing options.');
99
}
10-
var server = jsonServer.create();
11-
var router = jsonServer.router(options.router);
12-
server.use(jsonServer.defaults);
13-
server.use(router);
14-
server.listen(options.port);
15-
gutil.log('JSON server started at', gutil.colors.cyan('http://localhost:' + options.port));
10+
var server = jsonServer.create();
11+
var router = jsonServer.router(options.router);
12+
server.use(jsonServer.defaults);
13+
server.use(router);
14+
server.listen(options.port);
15+
gutil.log('JSON server started at', gutil.colors.cyan('http://localhost:' + options.port));
1616
};

package.json

+15-12
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,24 @@
22
"name": "gulp-json-server",
33
"version": "0.0.1",
44
"description": "Gulp plugin to run json-server",
5-
"main": "index.js",
5+
"license": "MIT",
6+
"repository": "conortm/gulp-json-server",
7+
"author": {
8+
"name": "Conor McNamara",
9+
"email": "[email protected]",
10+
"url": "https://github.com/conortm"
11+
},
12+
"homepage": "https://github.com/conortm/gulp-json-server",
13+
"bugs": {
14+
"url": "https://github.com/conortm/gulp-json-server/issues"
15+
},
16+
"engines": {
17+
"node": ">=0.10.0"
18+
},
619
"scripts": {
720
"test": "mocha"
821
},
9-
"repository": "conortm/gulp-json-server",
22+
"main": "index.js",
1023
"keywords": [
1124
"gulpplugin",
1225
"json-server",
@@ -25,16 +38,6 @@
2538
"dummy",
2639
"sandbox"
2740
],
28-
"author": {
29-
"name": "Conor McNamara",
30-
"email": "[email protected]",
31-
"url": "https://github.com/conortm"
32-
},
33-
"license": "MIT",
34-
"bugs": {
35-
"url": "https://github.com/conortm/gulp-json-server/issues"
36-
},
37-
"homepage": "https://github.com/conortm/gulp-json-server",
3841
"dependencies": {
3942
"gulp-util": "^3.0.5",
4043
"json-server": "^0.7.13"

test.js

+13-13
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ var jsonServer = require('./');
55

66
describe('gulp-json-server', function() {
77

8-
it('should work', function(done) {
8+
it('should work', function(done) {
99

10-
jsonServer({
11-
router: 'fixtures/db.json',
12-
port: 3000
13-
});
10+
jsonServer({
11+
router: 'fixtures/db.json',
12+
port: 3000
13+
});
1414

15-
request('http://localhost:3000')
16-
.get('/posts/1')
17-
.expect(200, '{\n "id": 1,\n "title": "json-server",\n "author": "typicode"\n}')
18-
.end(function(err) {
19-
if (err) return done(err);
20-
done(err);
21-
});
15+
request('http://localhost:3000')
16+
.get('/posts/1')
17+
.expect(200, '{\n "id": 1,\n "title": "json-server",\n "author": "typicode"\n}')
18+
.end(function(err) {
19+
if (err) { return done(err); }
20+
done(err);
21+
});
2222

23-
});
23+
});
2424
});

0 commit comments

Comments
 (0)