gulp-sassdoc
Advanced tools
Comparing version 1.1.1 to 1.2.0
# gulp-sassdoc changelog | ||
## 1.2.0 | ||
(2014-12-31) | ||
* Refactor, ensure both folders and glob patterns as source are supoorted. | ||
## 1.1.0 | ||
@@ -4,0 +9,0 @@ (2014-10-27) |
33
index.js
@@ -1,2 +0,2 @@ | ||
/* | ||
/** | ||
* gulp-sassdoc | ||
@@ -15,10 +15,9 @@ * | ||
var gutil = require('gulp-util'); | ||
var chalk = require('chalk'); | ||
var _ = require('lodash'); | ||
var PluginError = gutil.PluginError; | ||
var color = gutil.colors; | ||
var PLUGIN_NAME = 'gulp-sassdoc'; | ||
function fileExists() { | ||
@@ -29,6 +28,5 @@ var filePath = path.join.apply(path, arguments); | ||
function loadJSON(filePath) { | ||
if (!fileExists(filePath)) { | ||
throw new PluginError(PLUGIN_NAME, 'Source file "' + chalk.cyan(filePath) + '" not found.'); | ||
throw new PluginError(PLUGIN_NAME, 'Source file "' + color.cyan(filePath) + '" not found.'); | ||
return false; | ||
@@ -41,3 +39,2 @@ } | ||
function handleOptions(options) { | ||
@@ -93,3 +90,2 @@ // Defaults. | ||
function gulpSassDoc(options) { | ||
@@ -102,14 +98,16 @@ options = handleOptions(options || {}); | ||
var stream = through.obj(function (file, enc, cb) { | ||
var self = this; | ||
var src; | ||
if (file.isStream()) { | ||
this.emit('error', new PluginError(PLUGIN_NAME, 'Streams are not supported!')); | ||
return cb(); | ||
var transform = function (file, enc, cb) { | ||
if (!src) { | ||
src = file.isDirectory() ? file.path : file.base; | ||
} | ||
sassdoc.documentize(file.path, options.dest, options) | ||
cb(null, file); | ||
} | ||
var flush = function (cb) { | ||
sassdoc.documentize(src, options.dest, options) | ||
.then(function () { | ||
gutil.log('SassDoc documentation successfully generated.'); | ||
self.push(file); | ||
cb(); | ||
@@ -119,12 +117,9 @@ }) | ||
self.emit('error', new PluginError(PLUGIN_NAME, err)); | ||
self.push(file); | ||
cb(err); | ||
}); | ||
} | ||
}); | ||
return stream; | ||
return through.obj(transform, flush);; | ||
} | ||
module.exports = gulpSassDoc; |
{ | ||
"name": "gulp-sassdoc", | ||
"title": "gulp-sassdoc", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "SassDoc gulp task", | ||
@@ -25,7 +25,12 @@ "keywords": [ | ||
}, | ||
"files": [ | ||
"CHANGELOG.md", | ||
"index.js", | ||
"README.md", | ||
"UNLICENSE" | ||
], | ||
"dependencies": { | ||
"sassdoc": "^1.2.0", | ||
"gulp-util": "^3.0.0", | ||
"through2": "^0.5.1", | ||
"chalk": "^0.5.1", | ||
"through2": "^0.6.3", | ||
"lodash": "^2.4.1" | ||
@@ -36,7 +41,7 @@ }, | ||
"gulp": "^3.8.6", | ||
"gulp-eslint": "^0.1.8", | ||
"gulp-eslint": "^0.2.0", | ||
"gulp-shell": "^0.2.8", | ||
"rimraf": "^2.2.8", | ||
"run-sequence": "^0.3.6", | ||
"tape": "^2.13.4" | ||
"run-sequence": "^1.0.2", | ||
"tape": "^3.0.3" | ||
}, | ||
@@ -52,4 +57,5 @@ "engines": { | ||
"scripts": { | ||
"rebuild": "rm -rf node_modules && npm install", | ||
"test": "gulp test" | ||
} | ||
} |
6207
4
+ Addedthrough2@0.6.5(transitive)
- Removedchalk@^0.5.1
- Removedthrough2@0.5.1(transitive)
- Removedxtend@3.0.0(transitive)
Updatedthrough2@^0.6.3