Skip to content

Commit d9b0882

Browse files
committed
Merge branch 'release/1.0.6'
2 parents f8e28d0 + b11a3dd commit d9b0882

File tree

5 files changed

+45
-10
lines changed

5 files changed

+45
-10
lines changed

.jscs.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"preset": "google",
3+
"disallowMultipleLineBreaks": false,
4+
"excludeFiles": [
5+
"coverage",
6+
"node_modules"
7+
]
8+
}

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# v1.0.6
2+
3+
###### February 11, 2016
4+
5+
#### Maintenance
6+
7+
* Minor code style fixes in [index.js][index].
8+
9+
#### Development Features
10+
11+
* Add [CHANGELOG.md][changelog].
12+
* Add [JSHint][jshint] as a development dependency.
13+
* Add [JSCS][jscs] code-style support.
14+
15+
[changelog]: CHANGELOG.md
16+
[index]: index.js
17+
[jscs]: http://jscs.info/
18+
[jshint]: http://jshint.com/about/

index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ inherits(GulpTransformStream, Transform);
3030

3131
GulpTransformStream.prototype._transform = function(file, encoding, next) {
3232
if (file.isBuffer()) {
33-
file.contents = transformContents(this.transformFn, file.contents, file, this.options);
33+
file.contents = transformContents(
34+
this.transformFn, file.contents, file, this.options);
3435
}
3536

3637
if (file.isStream()) {
37-
file.contents = file.contents.pipe(new FileStream(this.transformFn, file, this.options));
38+
file.contents = file.contents.pipe(
39+
new FileStream(this.transformFn, file, this.options));
3840
}
3941

4042
next(null, file);
@@ -59,7 +61,8 @@ FileStream.prototype._transform = function(chunk, encoding, next) {
5961

6062
FileStream.prototype._flush = function(done) {
6163
var contents = Buffer.concat(this.data);
62-
this.push(transformContents(this.transformFn, contents, this.file, this.options));
64+
this.push(transformContents(
65+
this.transformFn, contents, this.file, this.options));
6366
done();
6467
};
6568

package.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gulp-transform",
3-
"version": "1.0.5",
3+
"version": "1.0.6",
44
"description": "Gulp plugin for performing arbitrary transformations on the contents of files.",
55
"main": "index.js",
66
"files": [
@@ -9,10 +9,14 @@
99
"README.md"
1010
],
1111
"scripts": {
12-
"test": "mocha",
12+
"test": "npm run jshint && npm run jscs && npm run mocha",
13+
"jshint": "jshint . --exclude-path .gitignore",
14+
"jscs": "jscs .",
15+
"mocha": "istanbul cover _mocha",
16+
"coverage": "npm test && open ./coverage/lcov-report/index.html",
1317
"clean": "rm -rf ./node_modules ./coverage",
14-
"coverage": "istanbul cover _mocha && open ./coverage/lcov-report/index.html",
15-
"coveralls": "istanbul cover _mocha && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage"
18+
"coveralls": "cat ./coverage/lcov.info | coveralls",
19+
"preversion": "npm run test"
1620
},
1721
"engines": {
1822
"node": ">=0.10"
@@ -48,6 +52,8 @@
4852
"event-stream": "^3.3.2",
4953
"gulp": "^3.9.1",
5054
"istanbul": "^0.4.2",
55+
"jscs": "^2.9.0",
56+
"jshint": "^2.9.1",
5157
"mocha": "^2.4.5",
5258
"rimraf": "^2.5.1",
5359
"sinon": "^1.17.3",

test/index.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('plugin:gulpTransform()', function() {
2626

2727
describe('param:transformFn', function() {
2828

29-
var fn, file;
29+
var fn; var file;
3030
beforeEach(function() {
3131
file = fixt.file.buffered();
3232
fn = fixt.fn.transform();
@@ -41,7 +41,7 @@ describe('plugin:gulpTransform()', function() {
4141
expect(transform.bind(null, 'paralysis')).to.throw(gutil.PluginError);
4242
});
4343

44-
it('throws PluginError if return value is not a String or Buffer', function() {
44+
it('throws PluginError if return value is not a ctring/Buffer', function() {
4545
expect(function() {
4646
transform(fixt.fn.bufferReturn()).write(fixt.file.buffered());
4747
}).not.to.throw(gutil.PluginError);
@@ -65,7 +65,7 @@ describe('plugin:gulpTransform()', function() {
6565

6666
describe('param:options', function() {
6767

68-
var fn, file;
68+
var fn; var file;
6969
beforeEach(function() {
7070
file = fixt.file.buffered();
7171
fn = fixt.fn.transform();

0 commit comments

Comments
 (0)