<commit_before>'use strict';

/**
 * module dependencies
 */

var path = require('path');
var Core = require('assemble-core');
var utils = require('./lib/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);
  }
  Core.apply(this, arguments);
  this.initAssemble();
}

/**
 * Inherit assemble-core
 */

Core.extend(Assemble);

/**
 * Initialize Assemble defaults
 */

Assemble.prototype.initAssemble = function() {
  this.isAssemble = true;
  this.use(utils.loader());

  var exts = this.options.exts || ['md', 'hbs', 'html'];
  var regex = utils.extRegex(exts);

  /**
   * Default engine
   */

  this.engine(exts, require('engine-handlebars'));

  /**
   * Middleware for parsing front matter
   */

  this.onLoad(regex, function(view, next) {
    utils.matter.parse(view, next);
  });

  /**
   * Define default view collections
   *  | partials
   *  | layouts
   *  | pages
   *  | files
   */

  var engine = this.options.defaultEngine || 'hbs';

  if (this.options.init !== false) {
    this.create('partials', {
      engine: engine,
      viewType: 'partial',
      renameKey: function(fp) {
        return path.basename(fp, path.extname(fp));
      }
    });

    this.create('layouts', {
      engine: engine,
      viewType: 'layout',
      renameKey: function(fp) {
        return path.basename(fp, path.extname(fp));
      }
    });

    this.create('pages', {
      engine: engine,
      renameKey: function(fp) {
        return fp;
      }
    });
  }
};


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

module.exports = Assemble;
<commit_msg>remove condition around default template types.<commit_after>'use strict';

/**
 * module dependencies
 */

var path = require('path');
var Core = require('assemble-core');
var utils = require('./lib/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);
  }
  Core.apply(this, arguments);
  this.initAssemble();
}

/**
 * Inherit assemble-core
 */

Core.extend(Assemble);

/**
 * Initialize Assemble defaults
 */

Assemble.prototype.initAssemble = function() {
  this.isAssemble = true;
  this.use(utils.loader());

  var exts = this.options.exts || ['md', 'hbs', 'html'];
  var regex = utils.extRegex(exts);

  /**
   * Default engine
   */

  this.engine(exts, require('engine-handlebars'));

  /**
   * Middleware for parsing front matter
   */

  this.onLoad(regex, function(view, next) {
    utils.matter.parse(view, next);
  });

  /**
   * Define default view collections
   *  | partials
   *  | layouts
   *  | pages
   *  | files
   */

  var engine = this.options.defaultEngine || 'hbs';

  this.create('partials', {
    engine: engine,
    viewType: 'partial',
    renameKey: function(fp) {
      return path.basename(fp, path.extname(fp));
    }
  });

  this.create('layouts', {
    engine: engine,
    viewType: 'layout',
    renameKey: function(fp) {
      return path.basename(fp, path.extname(fp));
    }
  });

  this.create('pages', {
    engine: engine,
    renameKey: function(fp) {
      return fp;
    }
  });
};


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

module.exports = Assemble;

{'fraction_non_alphanumeric': 0.1623359228502545, 'fraction_numerical': 0.0, 'mean_word_length': 2.934668071654373, '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': '3029516', 'n_tokens_mistral': 1236, 'n_tokens_neox': 1205, 'n_words': 280}