From 615b117d60bedfdb4423202417d6e1ff5820dd64 Mon Sep 17 00:00:00 2001 From: logeshpaul Date: Thu, 2 Apr 2015 12:46:59 +0530 Subject: [PATCH] Quick commands naming convention and formatting --- app/templates/js/_angular_application.js | 16 +++++++-------- controller/index.js | 14 ++++++------- directive/index.js | 25 ++++++++++++------------ filter/index.js | 12 ++++++------ service/index.js | 10 ++++------ 5 files changed, 35 insertions(+), 42 deletions(-) diff --git a/app/templates/js/_angular_application.js b/app/templates/js/_angular_application.js index 050eaf5..c434aec 100644 --- a/app/templates/js/_angular_application.js +++ b/app/templates/js/_angular_application.js @@ -1,19 +1,17 @@ /*================================================================ - App <%= site_name %> +App <%= site_name %> ==================================================================*/ -/*global angular*/ - 'use strict'; var app = angular.module('<%= site_name %>', ['ngRoute']); app.config(['$routeProvider', function($routeProvider) { - $routeProvider - .when('', { - controller: '', - templateUrl: '' - }) + $routeProvider + .when('', { + controller: '', + templateUrl: '' + }) - .otherwise({ redirectTo: '/' }); + .otherwise({ redirectTo: '/' }); }]); diff --git a/controller/index.js b/controller/index.js index 436c79a..85d9916 100644 --- a/controller/index.js +++ b/controller/index.js @@ -1,11 +1,10 @@ 'use strict'; var util = require('util'), - chalk = require('chalk'); + chalk = require('chalk'); var ScriptBase = require('../script-base.js'); - -var Generator = module.exports = function Generator() { +var smacssGenerator = module.exports = function smacssGenerator() { ScriptBase.apply(this, arguments); // if the controller name is suffixed with ctrl, remove the suffix @@ -15,12 +14,11 @@ var Generator = module.exports = function Generator() { } }; -util.inherits(Generator, ScriptBase); +util.inherits(smacssGenerator, ScriptBase); -//Function to create controller -Generator.prototype.createControllerFiles = function createControllerFiles() { - - this.log(chalk.yellow('Creating controller, please wait...... \n')); +// Function to create controller +smacssGenerator.prototype.createControllerFiles = function createControllerFiles() { + this.log(chalk.yellow('Creating controller, please wait...... \n\n')); this.generateSourceAndTest( '_controller', // controller template name diff --git a/directive/index.js b/directive/index.js index eaefe03..b3effb1 100644 --- a/directive/index.js +++ b/directive/index.js @@ -1,23 +1,22 @@ 'use strict'; var util = require('util'), - chalk = require('chalk'); - + chalk = require('chalk'); + var ScriptBase = require('../script-base.js'); -var Generator = module.exports = function Generator() { - ScriptBase.apply(this, arguments); +var smacssGenerator = module.exports = function smacssGenerator() { + ScriptBase.apply(this, arguments); }; -util.inherits(Generator, ScriptBase); - -Generator.prototype.createDirectiveFiles = function createDirectiveFiles() { +util.inherits(smacssGenerator, ScriptBase); +smacssGenerator.prototype.createDirectiveFiles = function createDirectiveFiles() { this.log(chalk.yellow('Creating directive, please wait...... \n')); - this.generateSourceAndTest( - '_directive', - 'spec/directive', - 'directives', - this.options['add-index'] || false - ); + this.generateSourceAndTest( + '_directive', + 'spec/directive', + 'directives', + this.options['add-index'] || false + ); }; \ No newline at end of file diff --git a/filter/index.js b/filter/index.js index 9966835..ccefeef 100644 --- a/filter/index.js +++ b/filter/index.js @@ -1,18 +1,18 @@ 'use strict'; var util = require('util'), - chalk = require('chalk'); - + chalk = require('chalk'); + var ScriptBase = require('../script-base.js'); -var Generator = module.exports = function Generator() { +var smacssGenerator = module.exports = function smacssGenerator() { ScriptBase.apply(this, arguments); }; -util.inherits(Generator, ScriptBase); +util.inherits(smacssGenerator, ScriptBase); -Generator.prototype.createFilterFiles = function createFilterFiles() { +smacssGenerator.prototype.createFilterFiles = function createFilterFiles() { - this.log(chalk.yellow('Creating filter, please wait...... \n')); + this.log(chalk.yellow('Creating filter, please wait...... \n')); this.generateSourceAndTest( '_filter', diff --git a/service/index.js b/service/index.js index a2c026b..3b89c6d 100644 --- a/service/index.js +++ b/service/index.js @@ -1,18 +1,16 @@ 'use strict'; var util = require('util'), - chalk = require('chalk'); + chalk = require('chalk'); var ScriptBase = require('../script-base.js'); - -var Generator = module.exports = function Generator() { +var smacssGenerator = module.exports = function smacssGenerator() { ScriptBase.apply(this, arguments); }; -util.inherits(Generator, ScriptBase); +util.inherits(smacssGenerator, ScriptBase); -Generator.prototype.createServiceFiles = function createServiceFiles() { - +smacssGenerator.prototype.createServiceFiles = function createServiceFiles() { this.log(chalk.yellow('Creating service, please wait...... \n')); this.generateSourceAndTest(