<commit_before>'use strict';

var chalk   = require('chalk');
var latest  = require('github-latest');
var path    = require('path');
var request = require('request');
var util    = require('util');
var yeoman  = require('yeoman-generator');
var yosay   = require('yosay');

var EvolveGenerator = yeoman.generators.Base.extend({
  init: function() {
    if (this.args.length) {
      this.framework = this.args[0];
    }

    if (this.framework && this.framework.indexOf('#') > 0) {
      this.branch = this.framework.split('#').pop() || 'master';
    }
  },

  listFrameworks: function() {
    if (this.framework) {
      return false;
    }

    var done    = this.async();
    var options = {
      url: 'https://api.github.com/orgs/evolution/repos',
      headers: {
        'User-Agent': 'evolution/generator-evolve',
      },
    };

    request(options, function(err, response, body) {
      if (err || response.statusCode !== 200) {
        console.error(response);

        throw err;
      }

      this.frameworks = JSON.parse(body).map(function(repo) {
        return repo.name;
      }).filter(function(name) {
        return name.match(/^\w+$/);
      });

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

  promptForFramework: function() {
    if (this.framework || !this.frameworks) {
      return false;
    }

    if (this.frameworks.length === 1) {
      this.framework = this.frameworks[0];

      return true;
    }

    var done = this.async();

    this.prompt([
      {
        type: 'list',
        name: 'framework',
        message: 'Select a framework',<commit_msg>Always choose a framework<commit_after>'use strict';

var chalk   = require('chalk');
var latest  = require('github-latest');
var path    = require('path');
var request = require('request');
var util    = require('util');
var yeoman  = require('yeoman-generator');
var yosay   = require('yosay');

var EvolveGenerator = yeoman.generators.Base.extend({
  init: function() {
    if (this.args.length) {
      this.framework = this.args[0];
    }

    if (this.framework && this.framework.indexOf('#') > 0) {
      this.branch = this.framework.split('#').pop() || 'master';
    }
  },

  listFrameworks: function() {
    if (this.framework) {
      return false;
    }

    var done    = this.async();
    var options = {
      url: 'https://api.github.com/orgs/evolution/repos',
      headers: {
        'User-Agent': 'evolution/generator-evolve',
      },
    };

    request(options, function(err, response, body) {
      if (err || response.statusCode !== 200) {
        console.error(response);

        throw err;
      }

      this.frameworks = JSON.parse(body).map(function(repo) {
        return repo.name;
      }).filter(function(name) {
        return name.match(/^\w+$/);
      });

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

  promptForFramework: function() {
    if (this.framework || !this.frameworks) {
      return false;
    }

    var done = this.async();

    this.prompt([
      {
        type: 'list',
        name: 'framework',
        message: 'Select a framework',
{'fraction_non_alphanumeric': 0.16829745596868884, 'fraction_numerical': 0.003913894324853229, 'mean_word_length': 2.4344904815229564, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 2, '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': '6456486', 'n_tokens_mistral': 989, 'n_tokens_neox': 940, 'n_words': 197}