<commit_before>'use strict';
var yeoman = require('yeoman-generator');
var chalk = require('chalk');
var yosay = require('yosay');

module.exports = yeoman.generators.Base.extend({
  init: function () {
    this.log(yosay(
      'Welcome to the Node.js HTTPS site generator!'
      ));
    
    // global configuration
    this.genConfig = {};
  },

  /**
   * Prompt for the name of the project.
   */
  askProjectName: function () {
    var done = this.async();

    var prompts = [{
      name: 'projName',
      message: 'What is the name of this project',
      default: 'ProjectName'
    }];

    this.prompt(prompts, function (props) {
      this.genConfig.projName = props.projName;
      done();
    }.bind(this));
  },

  /**
   * Get the SSL port the site will listen on.
   */
  askSslPort: function () {
    var done = this.async();

    var prompts = [{
      name: 'sslPort',
      message: 'What port will the site run on?',
      default: 8443
    }];

    this.prompt(prompts, function (props) {
      this.genConfig.sslPort = props.sslPort;
      done();
    }.bind(this));
  },

  /**
   * Write out files.
   */
  writing: {
    // copy project files over
    app: function () {
      this.fs.copyTpl(
        this.templatePath('src/_package.json'),
        this.destinationPath('package.json'),
        this.genConfig
        );
    },
    
    // copy static site
    site: function(){
      this.fs.copyTpl(
        this.templatePath('src/server/server.js'),
        this.destinationPath('src/server/server.js'),
        this.genConfig
        );
      this.fs.copyTpl(
        this.templatePath('src/public/index.html'),
        this.destinationPath('src/public/index.html'),
        this.genConfig
        );
      this.fs.copyTpl(
        this.templatePath('src/public/content/site.css'),
        this.destinationPath('src/public/content/site.css'),
        this.genConfig
        );
    }
  },

  /**
   * Execute NPM & Bower installs.
   */
  install: function () {
    var self = this;
    
    this.installDependencies({
      bower: false,
      npm: true,
      skipInstall: false,
      callback: function () { 
        self.log(yosay('All done, but there\'s work for you to do...'));
        
        console.log('  You need to update the server.js file to reference the your SSL key and');
        console.log('    certificate, the private/public pair that is used to serve the site as HTTPS.');
        console.log('  Refer to this for more information: ' + chalk.blue('https://www.github.com/andrewconnell/generator-nodehttps/docs/setup-https.md'));
        console.log('');
      }
    });
    
  }
});<commit_msg>updated logging to use yeoman so doesn't show when running tests<commit_after>'use strict';
var yeoman = require('yeoman-generator');
var chalk = require('chalk');
var yosay = require('yosay');

module.exports = yeoman.generators.Base.extend({
  init: function () {
    this.log(yosay(
      'Welcome to the Node.js HTTPS site generator!'
      ));
    
    // global configuration
    this.genConfig = {};
  },

  /**
   * Prompt for the name of the project.
   */
  askProjectName: function () {
    var done = this.async();

    var prompts = [{
      name: 'projName',
      message: 'What is the name of this project',
      default: 'ProjectName'
    }];

    this.prompt(prompts, function (props) {
      this.genConfig.projName = props.projName;
      done();
    }.bind(this));
  },

  /**
   * Get the SSL port the site will listen on.
   */
  askSslPort: function () {
    var done = this.async();

    var prompts = [{
      name: 'sslPort',
      message: 'What port will the site run on?',
      default: 8443
    }];

    this.prompt(prompts, function (props) {
      this.genConfig.sslPort = props.sslPort;
      done();
    }.bind(this));
  },

  /**
   * Write out files.
   */
  writing: {
    // copy project files over
    app: function () {
      this.fs.copyTpl(
        this.templatePath('src/_package.json'),
        this.destinationPath('package.json'),
        this.genConfig
        );
    },
    
    // copy static site
    site: function(){
      this.fs.copyTpl(
        this.templatePath('src/server/server.js'),
        this.destinationPath('src/server/server.js'),
        this.genConfig
        );
      this.fs.copyTpl(
        this.templatePath('src/public/index.html'),
        this.destinationPath('src/public/index.html'),
        this.genConfig
        );
      this.fs.copyTpl(
        this.templatePath('src/public/content/site.css'),
        this.destinationPath('src/public/content/site.css'),
        this.genConfig
        );
    }
  },

  /**
   * Execute NPM & Bower installs.
   */
  install: function () {
    var thisGenerator = this;
    
    this.installDependencies({
      bower: false,
      npm: true,
      skipInstall: false,
      callback: function () { 
        thisGenerator.log(yosay('All done, but there\'s work for you to do...'));
        
        thisGenerator.log('  You need to update the server.js file to reference the your SSL key and');
        thisGenerator.log('    certificate, the private/public pair that is used to serve the site as HTTPS.');
        thisGenerator.log('  Refer to this for more information: ' + chalk.blue('https://www.github.com/andrewconnell/generator-nodehttps/docs/setup-https.md'));
        thisGenerator.log('');
      }
    });
    
  }
});
{'fraction_non_alphanumeric': 0.1413224671235414, 'fraction_numerical': 0.0014817558807186516, 'mean_word_length': 2.200948429164197, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '6851543', 'n_tokens_mistral': 1688, 'n_tokens_neox': 1640, 'n_words': 390}