<commit_before>'use strict';
var util      = require('util')
  , path      = require('path')
  , yeoman    = require('yeoman-generator')
  , github    = require('../lib/github');

var ClutchGenerator = module.exports = function ClutchGenerator(args, options, config) {
  yeoman.generators.Base.apply(this, arguments);

  this.on('end', function () {
    this.installDependencies({ bower: false, skipInstall: options['skip-install'] });
  });

  this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json')));
};

util.inherits(ClutchGenerator, yeoman.generators.Base);

ClutchGenerator.prototype.askFor = function askFor() {
  var cb = this.async();

  // have Yeoman greet the user.
  console.log(this.yeoman);

  var prompts = [{
    name: 'githubUser',
    message: 'Would you mind telling me your username on Github?',
    default: 'someuser'
  },{
    name: 'appName',
    message: 'What would you like to call your app?'
  },{
    name: 'appDescription',
    message: 'How your you describe your project?'
  },{
    name: 'version',
    message: 'What is the starting version number you\'d like to use?',
    default: '0.1.0'
  }];

  this.prompt(prompts, function (props) {
    this.githubUser = props.githubUser;
    this.appName = props.appName;
    this.appDescription = props.appDescription;
    this.version = props.version;

    cb();
  }.bind(this));
};

ClutchGenerator.prototype.userInfo = function userInfo() {
  var self = this
    , done = this.async();

  github.githubUserInfo(this.githubUser, function (res) {
    /*jshint camelcase:false */
    self.realname = res.name;
    self.email = res.email;
    self.githubUrl = res.html_url;
    done();
  });
};

ClutchGenerator.prototype.fetchBoilerplate = function fetchBoilerplate() {
  var self = this
    , done = this.async();

  this.remote('duro', 'clutch-boilerplate', function(err, remote) {
    self.sourceRoot(remote.cachePath);
    done();
  });
};

ClutchGenerator.prototype.buildSkeleton = function buildSkeleton() {
  var self = this;
  this.directory('.','.');

};
<commit_msg>Moving back to json parse method of creating package.json<commit_after>'use strict';
var util      = require('util')
  , path      = require('path')
  , yeoman    = require('yeoman-generator')
  , github    = require('../lib/github');

var ClutchGenerator = module.exports = function ClutchGenerator(args, options, config) {
  yeoman.generators.Base.apply(this, arguments);

  this.on('end', function () {
    this.installDependencies({ bower: false, skipInstall: options['skip-install'] });
  });

  this.pkg = JSON.parse(this.readFileAsString(path.join(__dirname, '../package.json')));
};

util.inherits(ClutchGenerator, yeoman.generators.Base);

ClutchGenerator.prototype.askFor = function askFor() {
  var cb = this.async();

  // have Yeoman greet the user.
  console.log(this.yeoman);

  var prompts = [{
    name: 'githubUser',
    message: 'Would you mind telling me your username on Github?',
    default: 'someuser'
  },{
    name: 'appName',
    message: 'What would you like to call your app?'
  },{
    name: 'appDescription',
    message: 'How your you describe your project?'
  },{
    name: 'version',
    message: 'What is the starting version number you\'d like to use?',
    default: '0.1.0'
  }];

  this.prompt(prompts, function (props) {
    this.githubUser = props.githubUser;
    this.appName = props.appName;
    this.appDescription = props.appDescription;
    this.version = props.version;

    cb();
  }.bind(this));
};

ClutchGenerator.prototype.userInfo = function userInfo() {
  var self = this
    , done = this.async();

  github.githubUserInfo(this.githubUser, function (res) {
    /*jshint camelcase:false */
    self.realname = res.name;
    self.email = res.email;
    self.githubUrl = res.html_url;
    done();
  });
};

ClutchGenerator.prototype.fetchBoilerplate = function fetchBoilerplate() {
  var self = this
    , done = this.async();

  this.remote('duro', 'clutch-boilerplate', function(err, remote) {
    self.sourceRoot(remote.cachePath);
    done();
  });
};

ClutchGenerator.prototype.buildSkeleton = function buildSkeleton() {
  var self = this;

  this.directory('.','.', function(data, filePath, filename){
    // Transform the package.json
    if (filePath == path.join(self.sourceRoot(), 'package.json')) {
      data              = JSON.parse(data);
      data.name         = self.appName;
      data.author       = self.realname;
      data.description  = self.appDescription;
      data.version      = self.version;
      return JSON.stringify(data, null, 2);
    }
    return data;
  });

};

{'fraction_non_alphanumeric': 0.14957910641053312, 'fraction_numerical': 0.00151090006475286, 'mean_word_length': 3.371698113207547, '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': '2913175', 'n_tokens_mistral': 1489, 'n_tokens_neox': 1437, 'n_words': 332}