Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules/
app/templates/
test/tmp/
9 changes: 9 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"rules": {
"strict": [2, "global"],
"quotes": [2, "single"]
},
"env": {
"node": true
}
}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,3 @@ npm-debug.log
.idea
*.iml
test/tmp
.jshintignore
32 changes: 0 additions & 32 deletions .jshintrc

This file was deleted.

2 changes: 1 addition & 1 deletion app/src/mock-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* This module gets default yo options from options.json into a hash
* to be reused in tests and other places that requires default options
*
*
*/

var options = require('../options.json');
Expand Down
18 changes: 9 additions & 9 deletions app/src/prompts.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,20 @@ module.exports = function(GulpAngularGenerator) {
* Check if the default option is set, if it is, use defaults props and log them
*/
GulpAngularGenerator.prototype.defaultOption = function defaultOption() {
if (this.options['default']) {
if (this.options.default) {
this.props = _.merge(this.props, mockPrompts.defaults);

this.log('__________________________');
this.log('You use ' + chalk.green('--default') + ' option:');

_.forEach(this.props, function(prop, key) {
_.forEach(this.props, function(propOrProps, key) {
var prompt = _.find(prompts, {name: key});
if(_.isArray(prop)) {
prop.forEach(function(prop) {
if(_.isArray(propOrProps)) {
propOrProps.forEach(function(prop) {
logChoice.call(this, prompt, prop);
}, this);
} else {
logChoice.call(this, prompt, prop);
logChoice.call(this, prompt, propOrProps);
}
}, this);

Expand All @@ -46,12 +46,12 @@ module.exports = function(GulpAngularGenerator) {
GulpAngularGenerator.prototype.checkYoRc = function checkYoRc() {
var done = this.async();

if(this.config.get('props') && !this.options['default']) {
if(this.config.get('props') && !this.options.default) {
this.prompt([{
type: 'confirm',
name: 'skipConfig',
message: 'Existing ' + chalk.green('.yo-rc') + ' configuration found, would you like to use it?',
default: true,
default: true
}], function (answers) {
this.skipConfig = answers.skipConfig;

Expand All @@ -73,7 +73,7 @@ module.exports = function(GulpAngularGenerator) {
* Complete responses with null answers for questions not asked
*/
GulpAngularGenerator.prototype.askQuestions = function askQuestions() {
if (this.skipConfig || this.options['default']) {
if (this.skipConfig || this.options.default) {
return;
}

Expand Down Expand Up @@ -121,7 +121,7 @@ module.exports = function(GulpAngularGenerator) {
this.qrCode = false;

if (this.skipConfig || !this.options.advanced) {
return ;
return;
}

var done = this.async();
Expand Down
2 changes: 1 addition & 1 deletion app/src/techs.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = function(GulpAngularGenerator) {
.replace(/\n/g, '\n ');

usedTechs.forEach(function(value) {
var path ='src/assets/images/' + listTechs[value].logo;
var path = 'src/assets/images/' + listTechs[value].logo;

this.files.push({
src: path,
Expand Down
2 changes: 0 additions & 2 deletions app/src/write.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

var utils = require('./utils');

var _ = require('lodash');

module.exports = function(GulpAngularGenerator) {

/**
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"coveralls": "~2.11.2",
"cross-spawn": "~0.4.1",
"ejs": "~2.3.1",
"eslint": "^0.24.0",
"fixture-stdout": "~0.2.1",
"istanbul": "~0.3.15",
"js-beautify": "~1.5.6",
Expand Down
8 changes: 8 additions & 0 deletions test/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"rules": {
"no-unused-expressions": 0
},
"env": {
"mocha": true
}
}
1 change: 0 additions & 1 deletion test/inception/test-inception.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
/* jshint expr:true */

var inception = require('../inception');

Expand Down
12 changes: 6 additions & 6 deletions test/mute.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ var fixtureErr = new Fixture({
stream: process.stderr
});

var _writesOut = [];
var _writesErr = [];
var writesOut = [];
var writesErr = [];

// Mute
module.exports.mute = function () {
fixtureOut.capture(function onWrite(string) {
_writesOut.push({
writesOut.push({
string: string
});

Expand All @@ -36,7 +36,7 @@ module.exports.mute = function () {


fixtureErr.capture(function onWrite(string) {
_writesErr.push({
writesErr.push({
string: string
});

Expand All @@ -54,7 +54,7 @@ module.exports.unmute = function () {
// Return the output that was captured
module.exports.getMutedWrites = function () {
return {
out: _writesOut,
err: _writesErr
out: writesOut,
err: writesErr
};
};
2 changes: 1 addition & 1 deletion test/node/mock-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require('yeoman-generator');
var _ = require('lodash');

module.exports = function() {
module.exports = function() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is diff ?! 😥

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose it was non breakable space. Mac unfortunatly allow to create them really to easily (alt-space)

this._ = _;
this.log = function() {};
this.async = function() {
Expand Down
1 change: 0 additions & 1 deletion test/node/test-files.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
/* jshint expr:true */

var chai = require('chai');
var sinon = require('sinon');
Expand Down
1 change: 0 additions & 1 deletion test/node/test-index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
/* jshint expr:true */

var chai = require('chai');
var sinon = require('sinon');
Expand Down
6 changes: 1 addition & 5 deletions test/node/test-modules.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
'use strict';
/* jshint expr:true */

var chai = require('chai');
var sinon = require('sinon');
var sinonChai = require('sinon-chai');
chai.should();
chai.use(sinonChai);

var _ = require('lodash');

var Generator = require('./mock-generator');
var generator;

Expand All @@ -34,7 +30,7 @@ describe('gulp-angular generator modules script', function () {
router: { module: 'testModule1' },
ui: { module: 'testModule2' },
bootstrapComponents: { module: 'testModule3' },
foundationComponents: { module: 'testModule4' },
foundationComponents: { module: 'testModule4' }
};
generator.computeModules();
generator.modulesDependencies.should.match(/\', \'/);
Expand Down
1 change: 0 additions & 1 deletion test/node/test-paths.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
/* jshint expr:true */

var chai = require('chai');
var sinon = require('sinon');
Expand Down
1 change: 0 additions & 1 deletion test/node/test-preprocessors.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
/* jshint expr:true */

var chai = require('chai');
var sinonChai = require('sinon-chai');
Expand Down
3 changes: 1 addition & 2 deletions test/node/test-prompts.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
/* jshint expr:true */

var chai = require('chai');
var sinon = require('sinon');
Expand Down Expand Up @@ -36,7 +35,7 @@ describe('gulp-angular generator prompts script', function () {

it('should use default props if option is set', function() {
sinon.spy(generator, 'log');
generator.options['default'] = true;
generator.options.default = true;
generator.defaultOption();
generator.props.should.be.deep.equal(mockPrompts.defaults);
var logLines = 3 + _.flatten(_.values(generator.props)).length;
Expand Down
1 change: 0 additions & 1 deletion test/node/test-router.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
/* jshint expr:true */

var chai = require('chai');
var sinon = require('sinon');
Expand Down
5 changes: 2 additions & 3 deletions test/node/test-techs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
/* jshint expr:true */

var chai = require('chai');
var sinonChai = require('sinon-chai');
Expand Down Expand Up @@ -35,8 +34,8 @@ describe('gulp-angular generator techs script', function () {
ui: { key: 'tech-name-2' },
bootstrapComponents: { key: null },
foundationComponents: { key: 'none' },
cssPreprocessor: { extension: 'default' },
jsPreprocessor: { extension: 'css' },
cssPreprocessor: { extension: 'default' },
jsPreprocessor: { extension: 'css' },
htmlPreprocessor: { extension: 'official' }
};
generator.files = [];
Expand Down
13 changes: 6 additions & 7 deletions test/node/test-ui.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
/* jshint expr:true */

var chai = require('chai');
chai.should();
Expand All @@ -24,7 +23,7 @@ describe('gulp-angular generator ui script', function () {
generator.props = {
router: { module: null },
ui: { key: 'none' },
cssPreprocessor: { key: 'none', extension: 'css' }
cssPreprocessor: { key: 'none', extension: 'css' }
};
generator.files = [];
generator.uiFiles();
Expand All @@ -39,7 +38,7 @@ describe('gulp-angular generator ui script', function () {
generator.props = {
router: { module: 'ngRoute' },
ui: { key: 'bootstrap' },
cssPreprocessor: { key: 'notnone', extension: 'scss' }
cssPreprocessor: { key: 'notnone', extension: 'scss' }
};
generator.files = [];
generator.uiFiles();
Expand All @@ -58,7 +57,7 @@ describe('gulp-angular generator ui script', function () {
jQuery: { key: 'jquery1' },
ui: { key: 'bootstrap' },
bootstrapComponents: { key: 'angular-bootstrap' },
cssPreprocessor: { extension: 'scss' }
cssPreprocessor: { extension: 'scss' }
};
generator.computeWiredepExclusions();
generator.wiredepExclusions[0].should.be.equal('/bootstrap\.js$/');
Expand All @@ -71,7 +70,7 @@ describe('gulp-angular generator ui script', function () {
jQuery: { key: 'jquery1' },
ui: { key: 'bootstrap' },
bootstrapComponents: { key: 'angular-bootstrap' },
cssPreprocessor: { extension: 'less' }
cssPreprocessor: { extension: 'less' }
};
generator.computeWiredepExclusions();
generator.wiredepExclusions[0].should.be.equal('/bootstrap\.js$/');
Expand All @@ -83,7 +82,7 @@ describe('gulp-angular generator ui script', function () {
jQuery: { key: 'jquery1' },
ui: { key: 'foundation' },
foundationComponents: { key: 'angular-foundation' },
cssPreprocessor: { extension: 'scss' }
cssPreprocessor: { extension: 'scss' }
};
generator.computeWiredepExclusions();
generator.wiredepExclusions[0].should.be.equal('/foundation\\.js/');
Expand All @@ -95,7 +94,7 @@ describe('gulp-angular generator ui script', function () {
jQuery: { key: 'jquery1' },
ui: { key: 'foundation' },
foundationComponents: { key: 'angular-foundation' },
cssPreprocessor: { extension: 'notscss' }
cssPreprocessor: { extension: 'notscss' }
};
generator.computeWiredepExclusions();
generator.wiredepExclusions[0].should.be.equal('/foundation\\.js/');
Expand Down
1 change: 0 additions & 1 deletion test/node/test-writes.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
/* jshint expr:true */

var chai = require('chai');
var sinon = require('sinon');
Expand Down
3 changes: 1 addition & 2 deletions test/template-tools.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
/* jshint camelcase:false */

var fs = require('mz/fs');
var Promise = require('bluebird');
Expand Down Expand Up @@ -46,7 +45,7 @@ function compile(fileName) {
fs.readFile(sourceFilePath)
]).then(function(results) {
var content = results[1].toString();
var sourceContent = sourceHeader + beautify(compileEjs(content), { indent_size: 2 }) + sourceFooter;
var sourceContent = sourceHeader + beautify(compileEjs(content), { 'indent_size': 2 }) + sourceFooter;
sourceContent = sourceContent.replace('with(locals || {})', 'with(locals)');
return fs.writeFile(destinationFilePath, sourceContent);
});
Expand Down
2 changes: 1 addition & 1 deletion test/template/mock-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require('yeoman-generator');
var _ = require('lodash');
var mockPrompts = require('../../app/src/mock-prompts');

module.exports = function() {
module.exports = function() {
var props = _.extend(_.cloneDeep(mockPrompts.defaults), {
paths: {
src: null,
Expand Down
1 change: 0 additions & 1 deletion test/template/test-bower.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use strict';
/* jshint expr:true */

var chai = require('chai');
var sinonChai = require('sinon-chai');
Expand Down
Loading