<commit_before>/*!
 * generator-sense-extension <https://github.com/stefanwalther/generator-sense-extension>
 *
 * Copyright (c) 2015, <NAME>.
 * Licensed under the MIT License.
 */

'use strict';

var yeoman = require( 'yeoman-generator' );
var chalk = require( 'chalk' );
var _ = require( 'lodash' );
var moment = require( 'moment' );
var utils = require( './utils' );
var yoPrompts = require('./prompts.js');

module.exports = yeoman.generators.Base.extend( {

	constructor: function () {
		yeoman.generators.Base.apply( this, arguments );
		this.pkg = require( "../package.json" );

	},

	init: {},

	prompting: function () {
		var done = this.async();

		this.log( chalk.magenta( 'You\'re using sense-extension generator. Have fun!' ) );
		this.prompt( yoPrompts, function ( props ) {

			this.prompts = {};

			this.prompts.extName = props.extName;
			this.prompts.extDescription = props.extDescription;
			this.prompts.extNamespace = props.extNamespace;
			this.prompts.extNameSafe = props.extName.replace( /\s/g, "" );
			this.prompts.extNamespace = _.isEmpty( props.extNamespace ) ? '' : props.extNamespace + '-';
			this.prompts.extDescription = props.extDescription;

			// Advanced, if not used, fallback to default values in prompts definition
			this.prompts.extLic = props.extLic ||  _.findWhere(yoPrompts, {name: 'extLic'} ).default;
			this.prompts.extType = props.extType ||  _.findWhere(yoPrompts, {name: 'extType'} ).default;
			this.prompts.useLess = props.useLess ||  _.findWhere(yoPrompts, {name: 'useLess'} ).default;
			this.prompts.useVerb = props.useVerb ||  _.findWhere(yoPrompts, {name: 'useVerb'} ).default;

			var d = new Date();
			this.prompts.publishingYear = d.getFullYear();
			this.prompts.creationDate = moment( d ).format( 'YYYY-MM-DD' );

			done();

		}.bind( this ) );

	},

	writing: function () {

	},

	templates: function () {

	},

	test: function () {

	},

	install: function () {
		console.log('done/install');
		//this.installDependencies( {bower: true, npm: true} )
	},

	saveConfig: function () {
		this.config.set (this.prompts);
		this.config.save();
	}

} );
<commit_msg>Update index.js<commit_after>/*!
 * generator-sense-extension <https://github.com/stefanwalther/generator-sense-extension>
 *
 * Copyright (c) 2015, <NAME>.
 * Licensed under the MIT License.
 */

'use strict';


var yeoman = require( 'yeoman-generator' );
var chalk = require( 'chalk' );
var _ = require( 'lodash' );
var moment = require( 'moment' );
var utils = require( './utils' );
var yoPrompts = require('./prompts.js');

module.exports = yeoman.generators.Base.extend( {

	constructor: function () {
		yeoman.generators.Base.apply( this, arguments );
		this.pkg = require( "../package.json" );

	},

	init: {},

	prompting: function () {
		var done = this.async();

		this.log( chalk.magenta( 'You\'re using sense-extension generator. Have fun!' ) );
		this.prompt( yoPrompts, function ( props ) {

			this.prompts = {};

			this.prompts.extName = props.extName;
			this.prompts.extDescription = props.extDescription;
			this.prompts.extNamespace = props.extNamespace;
			this.prompts.extNameSafe = props.extName.replace( /\s/g, "" );
			this.prompts.extNamespace = _.isEmpty( props.extNamespace ) ? '' : props.extNamespace + '-';
			this.prompts.extDescription = props.extDescription;

			// Advanced, if not used, fallback to default values in prompts definition
			this.prompts.extLic = props.extLic ||  _.findWhere(yoPrompts, {name: 'extLic'} ).default;
			this.prompts.extType = props.extType ||  _.findWhere(yoPrompts, {name: 'extType'} ).default;
			this.prompts.useLess = props.useLess ||  _.findWhere(yoPrompts, {name: 'useLess'} ).default;
			this.prompts.useVerb = props.useVerb ||  _.findWhere(yoPrompts, {name: 'useVerb'} ).default;

			var d = new Date();
			this.prompts.publishingYear = d.getFullYear();
			this.prompts.creationDate = moment( d ).format( 'YYYY-MM-DD' );

			done();

		}.bind( this ) );

	},

	writing: function () {

	},

	templates: function () {

	},

	test: function () {

	},

	install: function () {
		console.log('done/install');
		//this.installDependencies( {bower: true, npm: true} )
	},

	saveConfig: function () {
		this.config.set (this.prompts);
		this.config.save();
	}

} );

{'fraction_non_alphanumeric': 0.1706973467950223, 'fraction_numerical': 0.0018783752054472881, 'mean_word_length': 3.681318681318681, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '856290', 'n_tokens_mistral': 1571, 'n_tokens_neox': 1411, 'n_words': 297}