<commit_before>'use strict';

var yeoman = require('yeoman-generator');
var helper = require('./../helper');
var chalk = require('chalk');
var yosay = require('yosay');
var util = require('util');
var path = require('path');

module.exports = yeoman.generators.Base.extend({
  initializing: function () {
    this.pkg = require('../package.json');
  },
  prompting:    function () {
    var done = this.async();
    this.log(yosay('Welcome to the marvelous ' + chalk.red('Hirsch') + ' generator!'));
    var prompts = [
      {
        type:    'string',
        name:    'appTitle',
        message: 'How would u like to call your app?',
        default: path.basename(process.cwd())
      },
      {
        type:    'string',
        name:    'appName',
        message: 'Angualar app name: ',
        default: path.basename(process.cwd())
      },
      {
        type:    'string',
        name:    'appSign',
        message: 'Angualar app prefix sign like ng(2chars): ',
        default: 'my'
      },
      {
        type:    'string',
        name:    'description',
        message: 'Describe your app: '
      },
      {
        type:    'string',
        name:    'author',
        message: 'How is the author?',
        default: '<NAME> <<EMAIL>>'
      }
    ];
    this.prompt(prompts, function (props) {
      this.appTitle = props.appTitle;
      this.appName = props.appName;
      this.appSign = props.appSign;
      this.description = props.description;
      this.author = props.author;
      if (this.appName !== path.basename(process.cwd())) {
        this.destinationRoot(this.appName)
      }
      done();
    }.bind(this));
  },
  writing:      {
    app: function () {
      this.directory(
        this.templatePath('grunt'),
        this.destinationPath('grunt')
      );
      var pathConfig = require(this.templatePath('grunt/config/paths.json'));

      /**
       * Build projext infos
       */
      function getCreationDate() {
        var today = new Date();
        var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October",
          "November", "December"];
        return monthNames[today.getMonth()] + ', ' + today.getFullYear();
      }

      var context = {
        appTitle:    this.appTitle,
        appName:     this.appName,
        appSign:     this.appSign,
        author:      this.author,
        description: this.description,
        date:        getCreationDate(),
        main:        helper.joinPath([pathConfig.srcDir, pathConfig.main]),
        bowerDir:    helper.joinPath([pathConfig.srcDir, pathConfig.libDir]),
        mediaDir:    helper.joinPath([pathConfig.asset.mediaDir]),
        appDir:      pathConfig.appDir,
        routesDir:   pathConfig.app.routesDir
      };

      this.fs.copy(
        this.templatePath('favicon.ico'),
        this.destinationPath(helper.joinPath([pathConfig.srcDir, pathConfig.asset.mediaDir]) + '/favicon.ico')
      );

      this.mkdir(helper.joinPath([pathConfig.srcDir, pathConfig.asset.cssDir]));

      this.fs.copy(
        this.templatePath('_en.json'),
        this.destinationPath(helper.joinPath([pathConfig.srcDir, pathConfig.asset.i18nDir]) + '/en.json')
      );

      this.fs.copy(
        this.templatePath('gitkeep'),
        this.destinationPath(helper.joinPath([pathConfig.srcDir, pathConfig.asset.fontDir]) + '/.gitkeep')
      );

      this.fs.copy(
        this.templatePath('gitkeep'),
        this.destinationPath(helper.joinPath([pathConfig.srcDir, pathConfig.app.common.serviceDir]) + '/.gitkeep')
      );

      this.fs.copy(
        this.templatePath('gitkeep'),
        this.destinationPath(helper.joinPath([pathConfig.srcDir, pathConfig.app.common.directiveDir]) + '/.gitkeep')
      );

      this.fs.copy(
        this.templatePath('gitkeep'),
        this.destinationPath(helper.joinPath([pathConfig.srcDir, pathConfig.app.common.filterDir]) + '/.gitkeep')
      );

      this.fs.copy(
        this.templatePath('gitkeep'),
        this.destinationPath(helper.joinPath([pathConfig.srcDir, pathConfig.app.common.templateDir]) + '/.gitkeep')
      );

      this.directory(
        this.templatePath('less'),
        this.destinationPath(helper.joinPath([pathConfig.srcDir, pathConfig.asset.lessDir]))
      );


      this.fs.copy(
        this.templatePath(helper.joinPath([pathConfig.srcDir, pathConfig.app.layoutDir]) + '/HeaderDirective.html'),
        this.destinationPath(helper.joinPath([pathConfig.srcDir, pathConfig.app.layoutDir]) + '/HeaderDirective.html')
      );

      this.fs.copyTpl(
        this.templatePath(helper.joinPath([pathConfig.srcDir, pathConfig.app.layoutDir + '/HeaderDirective.js'])),
        this.destinationPath(helper.joinPath([pathConfig.srcDir, pathConfig.app.layoutDir + '/HeaderDirective.js'])), context
      );


      this.mkdir(pathConfig.testDir);
      // ToDo
      // this.directory(
      //     this.templatePath('test'),
      //     this.destinationPath('test')
      // );
<commit_msg>removed templates dir<commit_after>'use strict';

var yeoman = require('yeoman-generator');
var helper = require('./../helper');
var chalk = require('chalk');
var yosay = require('yosay');
var util = require('util');
var path = require('path');

module.exports = yeoman.generators.Base.extend({
  initializing: function () {
    this.pkg = require('../package.json');
  },
  prompting:    function () {
    var done = this.async();
    this.log(yosay('Welcome to the marvelous ' + chalk.red('Hirsch') + ' generator!'));
    var prompts = [
      {
        type:    'string',
        name:    'appTitle',
        message: 'How would u like to call your app?',
        default: path.basename(process.cwd())
      },
      {
        type:    'string',
        name:    'appName',
        message: 'Angualar app name: ',
        default: path.basename(process.cwd())
      },
      {
        type:    'string',
        name:    'appSign',
        message: 'Angualar app prefix sign like ng(2chars): ',
        default: 'my'
      },
      {
        type:    'string',
        name:    'description',
        message: 'Describe your app: '
      },
      {
        type:    'string',
        name:    'author',
        message: 'How is the author?',
        default: '<NAME> <<EMAIL>>'
      }
    ];
    this.prompt(prompts, function (props) {
      this.appTitle = props.appTitle;
      this.appName = props.appName;
      this.appSign = props.appSign;
      this.description = props.description;
      this.author = props.author;
      if (this.appName !== path.basename(process.cwd())) {
        this.destinationRoot(this.appName)
      }
      done();
    }.bind(this));
  },
  writing:      {
    app: function () {
      this.directory(
        this.templatePath('grunt'),
        this.destinationPath('grunt')
      );
      var pathConfig = require(this.templatePath('grunt/config/paths.json'));

      /**
       * Build projext infos
       */
      function getCreationDate() {
        var today = new Date();
        var monthNames = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October",
          "November", "December"];
        return monthNames[today.getMonth()] + ', ' + today.getFullYear();
      }

      var context = {
        appTitle:    this.appTitle,
        appName:     this.appName,
        appSign:     this.appSign,
        author:      this.author,
        description: this.description,
        date:        getCreationDate(),
        main:        helper.joinPath([pathConfig.srcDir, pathConfig.main]),
        bowerDir:    helper.joinPath([pathConfig.srcDir, pathConfig.libDir]),
        mediaDir:    helper.joinPath([pathConfig.asset.mediaDir]),
        appDir:      pathConfig.appDir,
        routesDir:   pathConfig.app.routesDir
      };

      this.fs.copy(
        this.templatePath('favicon.ico'),
        this.destinationPath(helper.joinPath([pathConfig.srcDir, pathConfig.asset.mediaDir]) + '/favicon.ico')
      );

      this.mkdir(helper.joinPath([pathConfig.srcDir, pathConfig.asset.cssDir]));

      this.fs.copy(
        this.templatePath('_en.json'),
        this.destinationPath(helper.joinPath([pathConfig.srcDir, pathConfig.asset.i18nDir]) + '/en.json')
      );

      this.fs.copy(
        this.templatePath('gitkeep'),
        this.destinationPath(helper.joinPath([pathConfig.srcDir, pathConfig.asset.fontDir]) + '/.gitkeep')
      );

      this.fs.copy(
        this.templatePath('gitkeep'),
        this.destinationPath(helper.joinPath([pathConfig.srcDir, pathConfig.app.common.serviceDir]) + '/.gitkeep')
      );

      this.fs.copy(
        this.templatePath('gitkeep'),
        this.destinationPath(helper.joinPath([pathConfig.srcDir, pathConfig.app.common.directiveDir]) + '/.gitkeep')
      );

      this.fs.copy(
        this.templatePath('gitkeep'),
        this.destinationPath(helper.joinPath([pathConfig.srcDir, pathConfig.app.common.filterDir]) + '/.gitkeep')
      );

      this.directory(
        this.templatePath('less'),
        this.destinationPath(helper.joinPath([pathConfig.srcDir, pathConfig.asset.lessDir]))
      );


      this.fs.copy(
        this.templatePath(helper.joinPath([pathConfig.srcDir, pathConfig.app.layoutDir]) + '/HeaderDirective.html'),
        this.destinationPath(helper.joinPath([pathConfig.srcDir, pathConfig.app.layoutDir]) + '/HeaderDirective.html')
      );

      this.fs.copyTpl(
        this.templatePath(helper.joinPath([pathConfig.srcDir, pathConfig.app.layoutDir + '/HeaderDirective.js'])),
        this.destinationPath(helper.joinPath([pathConfig.srcDir, pathConfig.app.layoutDir + '/HeaderDirective.js'])), context
      );


      this.mkdir(pathConfig.testDir);
      // ToDo
      // this.directory(
      //     this.templatePath('test'),
      //     this.destinationPath('test')
      // );

{'fraction_non_alphanumeric': 0.1528424033987457, 'fraction_numerical': 0.000606918875177018, 'mean_word_length': 2.4163787145818936, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '560535', 'n_tokens_mistral': 3027, 'n_tokens_neox': 2968, 'n_words': 473}