<commit_before>'use strict';

/**
 * module dependencies
 */

var Templates = require('templates');
var debug = Templates.debug;
var utils = require('./utils');

/**
 * Create an `assemble` application. This is the main function exported
 * by the assemble module.
 *
 * ```js
 * var assemble = require('assemble');
 * var app = assemble();
 * ```
 * @param {Object} `options` Optionally pass default options to use.
 * @api public
 */

function Assemble(options) {
  if (!(this instanceof Assemble)) {
    return new Assemble(options);
  }

  Templates.call(this, options);
  this.is('assemble');
  debug(this);

  /**
   * Load core plugins
   */

  this.use(utils.tasks(this.name));
  this.use(utils.streams());
  this.use(utils.render());
  this.use(utils.fs());
}

/**
 * `Assemble` prototype methods
 */

Templates.extend(Assemble);

/**
 * Expose the `Assemble` constructor
 */

module.exports = Assemble;

/**
 * Expose static properties for unit tests
 */

Assemble.debug = Templates.debug;
Assemble.utils = Templates.utils;
Assemble._ = Templates._;
<commit_msg>emit `preInit` before plugins are loaded and `init` after plugins are loaded<commit_after>'use strict';

/**
 * module dependencies
 */

var Templates = require('templates');
var debug = Templates.debug;
var utils = require('./utils');

/**
 * Create an `assemble` application. This is the main function exported
 * by the assemble module.
 *
 * ```js
 * var assemble = require('assemble');
 * var app = assemble();
 * ```
 * @param {Object} `options` Optionally pass default options to use.
 * @api public
 */

function Assemble(options) {
  if (!(this instanceof Assemble)) {
    return new Assemble(options);
  }

  Templates.call(this, options);
  this.is(Assemble);
  debug(this);
  this.initAssembleCore();
}

/**
 * `Assemble` prototype methods
 */

Templates.extend(Assemble);
Templates.bubble(Assemble);

/**
 * Load core plugins
 */

Assemble.prototype.initAssembleCore = function() {
  Assemble.emit('preInit', this);

  this.use(utils.tasks(this.name));
  this.use(utils.streams());
  this.use(utils.render());
  this.use(utils.fs());

  Assemble.emit('init', this);
};

/**
 * Expose the `Assemble` constructor
 */

module.exports = Assemble;

/**
 * Expose static properties for unit tests
 */

Assemble.debug = Templates.debug;
Assemble.utils = Templates.utils;
Assemble._ = Templates._;

{'fraction_non_alphanumeric': 0.16, 'fraction_numerical': 0.0, 'mean_word_length': 3.9397089397089395, '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': '5156235', 'n_tokens_mistral': 756, 'n_tokens_neox': 747, 'n_words': 193}