From dce27c2af10abbcac163432afc4f1d83073d7925 Mon Sep 17 00:00:00 2001 From: Christoph Zuleger Date: Thu, 17 May 2018 13:19:45 +0200 Subject: [PATCH] Changed first letter of "require('tar').extract" method from upper to lower case; Trimmed empty text lines --- index.js | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/index.js b/index.js index 6e30472..3528848 100755 --- a/index.js +++ b/index.js @@ -11,7 +11,7 @@ var glob = require('glob'); var fs = require('fs'); var Plugin = function () { - + }; Plugin.prototype = nodeExtend(Plugin.prototype, { @@ -39,7 +39,7 @@ Plugin.prototype = nodeExtend(Plugin.prototype, { }); } }, - + getStyles: function (styles) { styles.push(fse.readFileSync( path.resolve(__dirname, './web/ngplugin.less'), 'utf8' )); }, @@ -48,21 +48,21 @@ Plugin.prototype = nodeExtend(Plugin.prototype, { var deferred = Q.defer(); promises.push(deferred.promise); if(configuration.showAngularDocs) { - + var dest = 'downloaded/angular/'; var version = configuration.showAngularDocs === true ? 'master' : 'v' + configuration.showAngularDocs; console.log("Fetching angular source code for documentation"); - + request({url: 'https://github.com/angular/angular.js/archive/' + version + '.tar.gz', encoding: null}) .on('error', deferred.reject) .pipe(zlib.Unzip()) .on('error', deferred.reject) - .pipe(require('tar').Extract( { path: dest } ) ) + .pipe(require('tar').extract( { path: dest } ) ) .on('error', deferred.reject) .on('end', function () { console.log("Adding Angular docs to configuration"); var version = configuration.showAngularDocs === true ? 'master' : configuration.showAngularDocs; - + configuration.groups.push({ groupTitle: 'Angular Docs', groupId: 'angular', @@ -101,37 +101,37 @@ Plugin.prototype = nodeExtend(Plugin.prototype, { } ] }); - + deferred.resolve(); }); - + } else { deferred.resolve(); } - + }, - + setupConfig: function (configuration, promises) { configuration.angularModules.push('docular.plugin.ngdoc'); configuration.javascript.push('resources/plugins/ngdoc/ngplugin.js'); }, - + copyFiles: function (webappDir) { fse.ensureDirSync(webappDir + '/resources/plugins/ngdoc'); fse.copySync(path.resolve(__dirname, './web'), webappDir + '/resources/plugins/ngdoc'); }, - + backfillData: function (fileData, allFiles) { var parser = new Parser(); if(fileData.extension === 'ngdoc' || fileData.extension === 'js') { parser.backfill(fileData, allFiles); } }, - + parseFile: function (fileData, allFiles, promises) { var deferred = Q.defer(), parser = new Parser(); promises.push(deferred.promise); - + var results = false; if(fileData.extension === 'ngdoc' || fileData.extension === 'js') { results = parser.parse(fileData, allFiles); @@ -140,15 +140,15 @@ Plugin.prototype = nodeExtend(Plugin.prototype, { deferred.resolve(); return; } - + for(var i = 0, l = results.length; i < l; i++) { if(results[i]) { - fileData.docs.push(results[i]); + fileData.docs.push(results[i]); } } - + deferred.resolve(); } }); -module.exports = Plugin; \ No newline at end of file +module.exports = Plugin;