<commit_before>'use strict';

var generators = require('yeoman-generator');
var path = require('path');

var underscoreString = require('underscore.string');

var Generator = module.exports = generators.Base.extend({
	constructor: function () {
		generators.Base.apply(this, arguments);

		this.argument('statename', { type: String, required: false });

		this.s = underscoreString;
	},

	initializing: function() {
		this.pkg = require('../../package.json');
	},

	configuring: function() {
		this.config.set('script-language', this.scriptLanguage);

		this.config.save();
	},

	prompting: {
		name: function() {
			if (this.statename) {
				return;
			}

			var done = this.async();

			this.prompt(
				{
					type: 'input',
					name: 'statename',
					message: 'State Name',
					default: this.statename
				},
				function (answers) {
					this.statename = answers.statename || 'state';

					done();
				}.bind(this)
			);
		},

		scriptLanguage: function() {
			if (this.config.get('script-language')) {
				this.scriptLanguage = this.config.get('script-language');

				return;
			}

			var done = this.async();

			this.prompt(
				{
					type: 'list',
					name: 'scriptLanguage',
					message: 'Boilerplate Scripting Language',
					choices: [
						{
							value: 'javascript',
							name: 'Javascript'
						},
						{
							value: 'typescript',
							name: 'Typescript'
						}
					]
				},
				function (answers) {
					this.scriptLanguage = answers.scriptLanguage;

					done();
				}.bind(this)
			);

		},
	},

	writing: function() {
		var inputFilename;
		var outputFilename;

		if (this.scriptLanguage === 'javascript') {
			inputFilename = 'state.js';
			outputFilename = this.s(this.statename).slugify().value() + '.js';

		} else if (this.scriptLanguage === 'typescript') {
			inputFilename = 'State.ts';
			outputFilename = this.s(this.statename).classify().value() + '.ts';
		}

		this.fs.copyTpl(
			this.templatePath(path.join('scripts/', this.scriptLanguage, inputFilename)),
			this.destinationPath(path.join('assets/scripts/Game/States/', outputFilename)),
			this
		);
	},

});<commit_msg>put the state in the right folder<commit_after>'use strict';

var generators = require('yeoman-generator');
var path = require('path');

var underscoreString = require('underscore.string');

var Generator = module.exports = generators.Base.extend({
	constructor: function () {
		generators.Base.apply(this, arguments);

		this.argument('statename', { type: String, required: false });

		this.s = underscoreString;
	},

	initializing: function() {
		this.pkg = require('../../package.json');
	},

	configuring: function() {
		this.config.set('script-language', this.scriptLanguage);

		this.config.save();
	},

	prompting: {
		name: function() {
			if (this.statename) {
				return;
			}

			var done = this.async();

			this.prompt(
				{
					type: 'input',
					name: 'statename',
					message: 'State Name',
					default: this.statename
				},
				function (answers) {
					this.statename = answers.statename || 'state';

					done();
				}.bind(this)
			);
		},

		scriptLanguage: function() {
			if (this.config.get('script-language')) {
				this.scriptLanguage = this.config.get('script-language');

				return;
			}

			var done = this.async();

			this.prompt(
				{
					type: 'list',
					name: 'scriptLanguage',
					message: 'Boilerplate Scripting Language',
					choices: [
						{
							value: 'javascript',
							name: 'Javascript'
						},
						{
							value: 'typescript',
							name: 'Typescript'
						}
					]
				},
				function (answers) {
					this.scriptLanguage = answers.scriptLanguage;

					done();
				}.bind(this)
			);

		},
	},

	writing: function() {
		var inputFilename;
		var outputFilename;

		if (this.scriptLanguage === 'javascript') {
			inputFilename = 'state.js';
			outputFilename = this.s(this.statename).slugify().value() + '.js';

		} else if (this.scriptLanguage === 'typescript') {
			inputFilename = 'State.ts';
			outputFilename = this.s(this.statename).classify().value() + '.ts';
		}

		this.fs.copyTpl(
			this.templatePath(path.join('scripts/', this.scriptLanguage, inputFilename)),
			this.destinationPath(path.join('src/assets/scripts/Game/States/', outputFilename)),
			this
		);
	},

});
{'fraction_non_alphanumeric': 0.1658091674462114, 'fraction_numerical': 0.0, 'mean_word_length': 2.9823091247672253, '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': '7525250', 'n_tokens_mistral': 1757, 'n_tokens_neox': 1340, 'n_words': 256}