Skip to content

Commit

Permalink
Merge branch 'release/1.0.6'
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmath committed Feb 11, 2016
2 parents f8e28d0 + b11a3dd commit d9b0882
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 10 deletions.
8 changes: 8 additions & 0 deletions .jscs.json
@@ -0,0 +1,8 @@
{
"preset": "google",
"disallowMultipleLineBreaks": false,
"excludeFiles": [
"coverage",
"node_modules"
]
}
18 changes: 18 additions & 0 deletions CHANGELOG.md
@@ -0,0 +1,18 @@
# v1.0.6

###### February 11, 2016

#### Maintenance

* Minor code style fixes in [index.js][index].

#### Development Features

* Add [CHANGELOG.md][changelog].
* Add [JSHint][jshint] as a development dependency.
* Add [JSCS][jscs] code-style support.

[changelog]: CHANGELOG.md
[index]: index.js
[jscs]: http://jscs.info/
[jshint]: http://jshint.com/about/
9 changes: 6 additions & 3 deletions index.js
Expand Up @@ -30,11 +30,13 @@ inherits(GulpTransformStream, Transform);

GulpTransformStream.prototype._transform = function(file, encoding, next) {
if (file.isBuffer()) {
file.contents = transformContents(this.transformFn, file.contents, file, this.options);
file.contents = transformContents(
this.transformFn, file.contents, file, this.options);
}

if (file.isStream()) {
file.contents = file.contents.pipe(new FileStream(this.transformFn, file, this.options));
file.contents = file.contents.pipe(
new FileStream(this.transformFn, file, this.options));
}

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

FileStream.prototype._flush = function(done) {
var contents = Buffer.concat(this.data);
this.push(transformContents(this.transformFn, contents, this.file, this.options));
this.push(transformContents(
this.transformFn, contents, this.file, this.options));
done();
};

Expand Down
14 changes: 10 additions & 4 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "gulp-transform",
"version": "1.0.5",
"version": "1.0.6",
"description": "Gulp plugin for performing arbitrary transformations on the contents of files.",
"main": "index.js",
"files": [
Expand All @@ -9,10 +9,14 @@
"README.md"
],
"scripts": {
"test": "mocha",
"test": "npm run jshint && npm run jscs && npm run mocha",
"jshint": "jshint . --exclude-path .gitignore",
"jscs": "jscs .",
"mocha": "istanbul cover _mocha",
"coverage": "npm test && open ./coverage/lcov-report/index.html",
"clean": "rm -rf ./node_modules ./coverage",
"coverage": "istanbul cover _mocha && open ./coverage/lcov-report/index.html",
"coveralls": "istanbul cover _mocha && cat ./coverage/lcov.info | coveralls && rm -rf ./coverage"
"coveralls": "cat ./coverage/lcov.info | coveralls",
"preversion": "npm run test"
},
"engines": {
"node": ">=0.10"
Expand Down Expand Up @@ -48,6 +52,8 @@
"event-stream": "^3.3.2",
"gulp": "^3.9.1",
"istanbul": "^0.4.2",
"jscs": "^2.9.0",
"jshint": "^2.9.1",
"mocha": "^2.4.5",
"rimraf": "^2.5.1",
"sinon": "^1.17.3",
Expand Down
6 changes: 3 additions & 3 deletions test/index.test.js
Expand Up @@ -26,7 +26,7 @@ describe('plugin:gulpTransform()', function() {

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

var fn, file;
var fn; var file;
beforeEach(function() {
file = fixt.file.buffered();
fn = fixt.fn.transform();
Expand All @@ -41,7 +41,7 @@ describe('plugin:gulpTransform()', function() {
expect(transform.bind(null, 'paralysis')).to.throw(gutil.PluginError);
});

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

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

var fn, file;
var fn; var file;
beforeEach(function() {
file = fixt.file.buffered();
fn = fixt.fn.transform();
Expand Down

0 comments on commit d9b0882

Please sign in to comment.