gulp-concat-filenames
Advanced tools
Comparing version 1.1.1 to 1.2.0
@@ -14,3 +14,3 @@ 'use strict'; | ||
.pipe(istanbul()) | ||
.on('finish', function () { | ||
.on('finish', function() { | ||
gulp | ||
@@ -47,3 +47,3 @@ .src(['test/main.js']) | ||
function lcov(){ | ||
function lcov() { | ||
gulp | ||
@@ -64,2 +64,2 @@ .src('coverage/**/lcov.info') | ||
.task('coveralls', lcov) | ||
.task('ci', ci); | ||
.task('ci', ci); |
26
index.js
@@ -10,9 +10,8 @@ var through = require('through'); | ||
var identity = function(x) { | ||
function identity(x) { | ||
return x; | ||
}; | ||
} | ||
var error = { | ||
noFilename: 'Missing fileName option for gulp-concat-filenames', | ||
noStreaming: 'Streaming not supported', | ||
badTemplate: 'Error in template function' | ||
@@ -36,11 +35,2 @@ }; | ||
function bufferContents(file) { | ||
if (file.isNull()) { | ||
return; | ||
} | ||
if (file.isStream()) { | ||
var errorNoStream = new PluginError('gulp-concat-filenames', error.noStreaming); | ||
return this.emit('error', errorNoStream); | ||
} | ||
firstfile = firstfile || file; | ||
@@ -71,7 +61,7 @@ | ||
var thisRequire = [ | ||
opts.prepend || '', | ||
safeTemplate.call(this, requirePath.replace(/\\/g, '\/')), | ||
opts.append || '', | ||
opts.newLine | ||
].join(''); | ||
opts.prepend || '', | ||
safeTemplate.call(this, requirePath.replace(/\\/g, '\/')), | ||
opts.append || '', | ||
opts.newLine | ||
].join(''); | ||
@@ -103,2 +93,2 @@ buffer.push(new Buffer(thisRequire)); | ||
module.exports = concatFilenames; | ||
module.exports = concatFilenames; |
@@ -0,0 +0,0 @@ The MIT License (MIT) |
{ | ||
"name": "gulp-concat-filenames", | ||
"description": "Similar to concat, but creates a file with a list of filenames,not file contents.", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"homepage": "http://jesseharlin.net", | ||
@@ -14,2 +14,5 @@ "repository": "https://github.com/the-simian/gulp-concat-filenames", | ||
"email" : "noam@younger.mn" | ||
}, { | ||
"name" : "Rainfore Zhao", | ||
"email" : "rainforest92@126.com" | ||
}], | ||
@@ -27,2 +30,3 @@ "main": "./index.js", | ||
}, | ||
"typings": "index.d.ts", | ||
"devDependencies": { | ||
@@ -32,6 +36,6 @@ "chai": "*", | ||
"gulp-coveralls": "^0.1.3", | ||
"gulp-istanbul": "^0.10.3", | ||
"gulp-mocha": "^2.0.1", | ||
"gulp-istanbul": "^1.1.1", | ||
"gulp-mocha": "^3.0.1", | ||
"gulp-plato": "^1.0.2", | ||
"gulp-sourcemaps": "1.x.x", | ||
"gulp-sourcemaps": "2.x.x", | ||
"istanbul": "*", | ||
@@ -38,0 +42,0 @@ "mocha": "*", |
@@ -1,22 +0,15 @@ | ||
[![Build Status](https://travis-ci.org/the-simian/gulp-concat-filenames.svg?branch=master)](https://travis-ci.org/the-simian/gulp-concat-filenames) | ||
[![Coverage Status](https://coveralls.io/repos/the-simian/gulp-concat-filenames/badge.png?branch=coveralls)](https://coveralls.io/r/the-simian/gulp-concat-filenames?branch=coveralls) | ||
[![Code Climate](https://codeclimate.com/github/the-simian/gulp-concat-filenames/badges/gpa.svg)](https://codeclimate.com/github/the-simian/gulp-concat-filenames) | ||
[![Codeship Status for the-simian/gulp-concat-filenames](https://www.codeship.io/projects/b7aaf400-3b02-0132-083a-261a2707f8ca/status)](https://www.codeship.io/projects/42521) | ||
[![Dependency Status](https://david-dm.org/the-simian/gulp-concat-filenames.svg)](https://david-dm.org/the-simian/gulp-concat-filenames) | ||
[![Reference Status](https://www.versioneye.com/nodejs/gulp-concat-filenames/reference_badge.svg?style=flat)](https://www.versioneye.com/nodejs/gulp-concat-filenames/references) | ||
# Information | ||
| | | | ||
| Package | gulp-concat-filenames | | ||
|--------------|------------------------------------------------------------------------------------------------------| | ||
| Package | gulp-concat-filenames | | ||
| Description | Similar to concat, but creates a list of names in the output file, rather than contents being merged.| | ||
| Node Version | >= 0.10 | | ||
[![Build Status](https://travis-ci.org/the-simian/gulp-concat-filenames.svg?branch=master)](https://travis-ci.org/the-simian/gulp-concat-filenames) [![Coverage Status](https://coveralls.io/repos/the-simian/gulp-concat-filenames/badge.png?branch=coveralls)](https://coveralls.io/r/the-simian/gulp-concat-filenames?branch=coveralls) [![Code Climate](https://codeclimate.com/github/the-simian/gulp-concat-filenames/badges/gpa.svg)](https://codeclimate.com/github/the-simian/gulp-concat-filenames) [![Codeship Status for the-simian/gulp-concat-filenames](https://app.codeship.com/projects/b7aaf400-3b02-0132-083a-261a2707f8ca/status?branch=master)](https://app.codeship.com/projects/42521) [![Dependency Status](https://david-dm.org/the-simian/gulp-concat-filenames.svg)](https://david-dm.org/the-simian/gulp-concat-filenames) [![Reference Status](https://www.versioneye.com/nodejs/gulp-concat-filenames/reference_badge.svg?style=flat)](https://www.versioneye.com/nodejs/gulp-concat-filenames/references) | ||
--- | ||
![gulp-concat-filenames](https://cloud.githubusercontent.com/assets/954596/12309992/609d63da-ba13-11e5-8698-b06ea035f07b.png) | ||
@@ -23,0 +16,0 @@ |
@@ -33,12 +33,37 @@ 'use strict'; | ||
describe('When I do provide a filename', function () { | ||
it('Then it should ignore null files', function (done) { | ||
var stream = concatFilenames('example.js'); | ||
stream | ||
.pipe(assert.length(0)) | ||
it('Then it should support null files', function (done) { | ||
var expectedFilenames = ([ | ||
path.join(__dirname, 'fixtures/fork.txt'), | ||
path.join(__dirname, 'fixtures/knife.js'), | ||
path.join(__dirname, 'fixtures/spoon.html'), | ||
] | ||
.join('\n') + '\n') | ||
.replace(/\\/g, '\/') | ||
.toString(); | ||
gulp | ||
.src(fixtures('*'), { | ||
read: false | ||
}) | ||
.pipe(concatFilenames('example.js')) | ||
.pipe(assert.first(function (d) { | ||
var contents = d.contents.toString(); | ||
expect(contents) | ||
.to | ||
.equal(expectedFilenames); | ||
})) | ||
.pipe(assert.end(done)); | ||
stream.write(new File()); | ||
stream.end(); | ||
}); | ||
it('Then it emit an error in streamed files', function (done) { | ||
it('Then it support streamed files', function (done) { | ||
var expectedFilenames = ([ | ||
path.join(__dirname, 'fixtures/fork.txt'), | ||
path.join(__dirname, 'fixtures/knife.js'), | ||
path.join(__dirname, 'fixtures/spoon.html'), | ||
] | ||
.join('\n') + '\n') | ||
.replace(/\\/g, '\/') | ||
.toString(); | ||
gulp | ||
@@ -49,6 +74,10 @@ .src(fixtures('*'), { | ||
.pipe(concatFilenames('example.js')) | ||
.on('error', function (err) { | ||
expect(err.message).to.equal('Streaming not supported'); | ||
done(); | ||
}); | ||
.pipe(assert.first(function (d) { | ||
var contents = d.contents.toString(); | ||
expect(contents) | ||
.to | ||
.equal(expectedFilenames); | ||
})) | ||
.pipe(assert.end(done)); | ||
}); | ||
@@ -224,2 +253,2 @@ | ||
}); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22364
13
354
138