Skip to content

Commit 318136a

Browse files
committed
initial commit
0 parents  commit 318136a

File tree

3 files changed

+86
-0
lines changed

3 files changed

+86
-0
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.log
2+
node_modules

index.js

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
'use strict';
2+
3+
var es = require('event-stream');
4+
var vfs = require('vinyl-fs');
5+
var through2 = require('through2');
6+
var gutil = require('gulp-util');
7+
var JadeInheritance = require('jade-inheritance');
8+
var PLUGIN_NAME = 'gulp-jade-inheritance';
9+
10+
var stream;
11+
12+
function gulpJadeInheritance(options) {
13+
options = options || {};
14+
15+
if (!options.basedir) {
16+
options.basedir = '';
17+
}
18+
19+
var files = [];
20+
21+
function writeStream(currentFile) {
22+
if (currentFile) {
23+
var jadeInheritance = new JadeInheritance(currentFile.path, options.basedir, options);
24+
25+
for (var i = 0; i < jadeInheritance.files.length; i++) {
26+
files.push(options.basedir + "/" + jadeInheritance.files[i]);
27+
}
28+
}
29+
}
30+
31+
function endStream() {
32+
vfs.src(files)
33+
.pipe(es.through(
34+
function (f) {
35+
stream.emit('data', f);
36+
},
37+
function () {
38+
stream.emit('end');
39+
}
40+
));
41+
}
42+
43+
stream = es.through(writeStream, endStream);
44+
45+
return stream;
46+
};
47+
48+
module.exports = gulpJadeInheritance;

package.json

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "gulp-jade-inheritance",
3+
"version": "0.0.0",
4+
"description": "Rebuild only changed jade files and all it dependencies",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "mocha"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "[email protected]:juanfran/gulp-jade-inheritance.git"
12+
},
13+
"keywords": [
14+
"gulpplugin",
15+
"jade",
16+
"jade-inheritance"
17+
],
18+
"author": "Juanfran Alcántara",
19+
"license": "MIT",
20+
"bugs": {
21+
"url": "https://github.com/juanfran/gulp-jade-inheritance/issues"
22+
},
23+
"homepage": "https://github.com/juanfran/gulp-jade-inheritance",
24+
"devDependencies": {
25+
"chai": "~1.9.1",
26+
"mocha": "~1.18.2",
27+
"proxyquire": "^1.0.1",
28+
"sinon": "^1.10.2"
29+
},
30+
"dependencies": {
31+
"event-stream": "^3.1.7",
32+
"gulp-util": "^3.0.0",
33+
"jade-inheritance": "^0.1.0",
34+
"vinyl-fs": "^0.3.6"
35+
}
36+
}

0 commit comments

Comments
 (0)