<commit_before>'use strict';
var util = require('util');
var GeneratorBase = require('../generator-base.js');

var _ = require('lodash');

var Generator = module.exports = function Generator() {
  GeneratorBase.apply(this, arguments);

};

util.inherits(Generator, GeneratorBase);

Generator.prototype.askFor = function askFor() {

	var done = this.async();
	var currentModule = this.config.get('currentModule');
	currentModule = currentModule ? currentModule : "app";

	var prompts = [{
		type: 'list',
		name: 'type',
		message: "What kind of module would you like to make?",
		choices: ['module', 'controller', 'directive'],
		default: 'module'
	}, {
		when: function (r) {return r.type!=='module';},
		type: 'input',
		name: 'module',
		message: "Module: ",
		default: currentModule
	}, {
		type: 'input',
		name: 'name',
		message: "Name: "
	}, {
		type: 'input',
		name: 'dependencies',
		message: "Dependencies (separate with a space): "
	}, {
		when: function (r) {return r.type==='controller';},
		type: 'confirm',
		name: 'hasRoute',
		message: "Does the module have a route?",
		default: true
	}];

	this.prompt(prompts, function (results) {

		results.dependencies = _.compact(results.dependencies.split(" "));
		this.createModule(results);

		done();
	}.bind(this));
};<commit_msg>Updated module generator to include more dialog.<commit_after>'use strict';
var util = require('util');
var GeneratorBase = require('../generator-base.js');

var _ = require('lodash');

var Generator = module.exports = function Generator() {
  GeneratorBase.apply(this, arguments);

};

util.inherits(Generator, GeneratorBase);

Generator.prototype.listModules = function listModules() {
	var modules = this.config.get('modules');

	var msg = "\nMODULE GENERATOR " +
	"\nUse this generator to scaffold your application." +
	"\nWhen you are done making modules, use \'yo build\'" +
	"\nto compile modules, resolve dependencies, and add" +
	"\nscripts to index.html file." +
	"\n";

	console.log(msg);

	console.log("Current modules:\n");

	_.each(modules, function (module, key) {
		console.log(key);
		_.each(module, function (j, key) {
			console.log("    " + key);
		});
	});

	console.log("\n");
};

Generator.prototype.askFor = function askFor() {

	var done = this.async();
	var currentModule = this.config.get('currentModule');
	
	currentModule = currentModule ? currentModule : "app";

	var prompts = [{
		type: 'list',
		name: 'type',
		message: "What kind of module would you like to make?",
		choices: ['module', 'controller', 'directive'],
		default: 'module'
	}, {
		when: function (r) {return r.type!=='module';},
		type: 'input',
		name: 'module',
		message: "Module: ",
		default: currentModule
	}, {
		type: 'input',
		name: 'name',
		message: "Name: "
	}, {
		type: 'input',
		name: 'dependencies',
		message: "Dependencies (separate with a space): "
	}, {
		when: function (r) {return r.type==='controller';},
		type: 'confirm',
		name: 'hasRoute',
		message: "Does the module have a route?",
		default: true
	}];

	this.prompt(prompts, function (results) {

		results.dependencies = _.compact(results.dependencies.split(" "));
		this.createModule(results);

		done();
	}.bind(this));
};
{'fraction_non_alphanumeric': 0.17630509534229447, 'fraction_numerical': 0.0, 'mean_word_length': 4.3156146179401995, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '5346791', 'n_tokens_mistral': 1117, 'n_tokens_neox': 1020, 'n_words': 277}