<commit_before>'use strict';
var yeoman = require('yeoman-generator');
var chalk = require('chalk');
var yosay = require('yosay');
var mkdirp = require('mkdirp');
var _s = require('underscore.string');

module.exports = yeoman.generators.Base.extend({
  prompting: function () {
    var done = this.async();

    // Have Yeoman greet the user
    this.log(yosay(
      'Welcome to the sweet ' + chalk.red('Magento 1 module') + ' generator!'
    ));

    var prompts = [
      {
        type: 'input',
        name: 'namespace',
        message: 'What is your namespace?',
        default: 'Medialounge'
      },
      {
        type: 'input',
        name: 'moduleName',
        message: 'What is your module name?',
        default: 'MyModule'
      },
      {
        type: 'list',
        name: 'codePool',
        message: 'What is the module codepool?',
        choices: ['local', 'community'],
        default: 'local'
      }
    ];

    this.prompt(prompts, function (props) {
      this.props = props;

      this.codePool = props.codePool;
      this.namespace = _s.classify(props.namespace);
      this.moduleName = _s.classify(props.moduleName);

      this.modulePath = 'app/code/' + this.codePool + '/' + this.namespace + '/' + this.moduleName;

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

  writing: {
    folders: function () {
      mkdirp('app/code/' + this.codePool);
      mkdirp('app/code/' + this.codePool + '/' + this.namespace);
      mkdirp('app/code/' + this.codePool + '/' + this.namespace + '/' + this.moduleName);

      mkdirp('app/code/' + this.codePool + '/' + this.namespace + '/' + this.moduleName + '/etc');
    },

    config: function () {
      this.fs.copyTpl(
        this.templatePath('config.xml'),
        this.destinationPath(this.modulePath + '/etc/config.xml'),
        {
          moduleId: this.namespace.toLowerCase() + '_' + this.moduleName.toLowerCase()
        }
      );
    },

    activate: function () {
      this.fs.copyTpl(
        this.templatePath('module.xml'),
        this.destinationPath('app/etc/modules/' + this.namespace + '_' + this.moduleName + '.xml'),
        {<commit_msg>Refactor module path<commit_after>'use strict';
var yeoman = require('yeoman-generator');
var chalk = require('chalk');
var yosay = require('yosay');
var mkdirp = require('mkdirp');
var _s = require('underscore.string');

module.exports = yeoman.generators.Base.extend({
  prompting: function () {
    var done = this.async();

    // Have Yeoman greet the user
    this.log(yosay(
      'Welcome to the sweet ' + chalk.red('Magento 1 module') + ' generator!'
    ));

    var prompts = [
      {
        type: 'input',
        name: 'namespace',
        message: 'What is your namespace?',
        default: 'Medialounge'
      },
      {
        type: 'input',
        name: 'moduleName',
        message: 'What is your module name?',
        default: 'MyModule'
      },
      {
        type: 'list',
        name: 'codePool',
        message: 'What is the module codepool?',
        choices: ['local', 'community'],
        default: 'local'
      }
    ];

    this.prompt(prompts, function (props) {
      this.props = props;

      this.codePool = props.codePool;
      this.namespace = _s.classify(props.namespace);
      this.moduleName = _s.classify(props.moduleName);

      this.modulePath = 'app/code/' + this.codePool + '/' + this.namespace + '/' + this.moduleName;

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

  writing: {
    folders: function () {
      mkdirp(this.modulePath);
      mkdirp(this.modulePath + '/etc');
    },

    config: function () {
      this.fs.copyTpl(
        this.templatePath('config.xml'),
        this.destinationPath(this.modulePath + '/etc/config.xml'),
        {
          moduleId: this.namespace.toLowerCase() + '_' + this.moduleName.toLowerCase()
        }
      );
    },

    activate: function () {
      this.fs.copyTpl(
        this.templatePath('module.xml'),
        this.destinationPath('app/etc/modules/' + this.namespace + '_' + this.moduleName + '.xml'),
        {
{'fraction_non_alphanumeric': 0.16260162601626016, 'fraction_numerical': 0.0004927322000492732, 'mean_word_length': 2.3008130081300813, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '202189', 'n_tokens_mistral': 1288, 'n_tokens_neox': 1254, 'n_words': 251}