Added gulp task to concat /examples/*.js into ./examples.md
This commit is contained in:
parent
12e7101ffa
commit
11b391820d
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,25 @@
|
||||||
|
var gulp = require('gulp'),
|
||||||
|
concat = require('gulp-concat'),
|
||||||
|
path = require('path'),
|
||||||
|
es = require('event-stream');
|
||||||
|
|
||||||
|
var format = es.through(
|
||||||
|
function (file) {
|
||||||
|
if (file.isNull()) return this.emit('data', file); // pass along
|
||||||
|
if (file.isStream()) return this.emit('error', new Error('Streaming not supported'));
|
||||||
|
|
||||||
|
//add indentation
|
||||||
|
var contents = "\t" + file.contents.toString("utf8").split("\n").join("\n\t");
|
||||||
|
//add header
|
||||||
|
contents = ["#", path.basename(file.path), "\n", contents].join("");
|
||||||
|
file.contents = new Buffer(contents, "utf8");
|
||||||
|
this.emit('data', file);
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('examples', function () {
|
||||||
|
//concat .js files from ./examples folder into ./examples.md
|
||||||
|
return gulp.src("./examples/*.js").pipe(format).pipe(concat('examples.md')).pipe(gulp.dest('./'));
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
gulp.task('default', ["examples"]);
|
|
@ -56,7 +56,7 @@
|
||||||
"grunt-contrib-watch": "~0.5.3",
|
"grunt-contrib-watch": "~0.5.3",
|
||||||
"grunt-markdown": "~0.5.0",
|
"grunt-markdown": "~0.5.0",
|
||||||
"grunt-mocha-test": "~0.8.2",
|
"grunt-mocha-test": "~0.8.2",
|
||||||
"grunt-shell": "~0.6.4",
|
"grunt-shell": "~0.6.4",
|
||||||
"coveralls": "^2.10.0",
|
"coveralls": "^2.10.0",
|
||||||
"istanbul": "~0.2.6",
|
"istanbul": "~0.2.6",
|
||||||
"commander": "~2.2.0",
|
"commander": "~2.2.0",
|
||||||
|
@ -77,7 +77,10 @@
|
||||||
"brfs": "=1.0.0",
|
"brfs": "=1.0.0",
|
||||||
"chai": "=1.9.1",
|
"chai": "=1.9.1",
|
||||||
"uglifyify": "=1.2.3",
|
"uglifyify": "=1.2.3",
|
||||||
"async": "~0.2.10"
|
"async": "~0.2.10",
|
||||||
|
"event-stream": "~3.1.5",
|
||||||
|
"gulp-concat": "~2.2.0",
|
||||||
|
"gulp": "~3.8.2"
|
||||||
},
|
},
|
||||||
"testling": {
|
"testling": {
|
||||||
"harness": "mocha-bdd",
|
"harness": "mocha-bdd",
|
||||||
|
|
Loading…
Reference in New Issue