<commit_before>var path = require('path');
var fs   = require('fs');
var mergeTrees = require('broccoli-merge-trees');
var fileRemover = require('broccoli-file-remover');

var manifest = require('./manifest');

module.exports = {
  name: 'broccoli-manifest',

  config: function(environment, appConfig) {
    var options = appConfig.manifest || {};
    var defaultOptions = {
      enabled: appConfig.environment === 'production',
      appcacheFile: "/manifest.appcache",
      excludePaths: ['index.html', 'tests/'],
      includePaths: [],
      network: ['*']
    }

    for (var option in defaultOptions) {
      if (!options.hasOwnProperty(option)) {
        options[option] = defaultOptions[option];
      }
    }

    this.manifestOptions = options;
  },  

  postprocessTree: function (type, tree) {
    var options = this.manifestOptions;  

    if (type === 'all' && options.enabled) {
      manifestTree = fileRemover(tree, {
        paths: options.excludePaths
      });
      return mergeTrees([tree, manifest(manifestTree, options)]);<commit_msg>this addon was broken with ember-cli 0.1.12<commit_after>var path = require('path');
var fs   = require('fs');
var mergeTrees = require('broccoli-merge-trees');
var fileRemover = require('broccoli-file-remover');

var manifest = require('./manifest');

module.exports = {
  name: 'broccoli-manifest',
  
  included: function (app) {
    this.app = app;
    this.initializeOptions();
  },
  
  initializeOptions: function () {
    var options = this.app.options.manifest || {};

    var defaultOptions = {
      enabled: this.app.env === 'production',
      appcacheFile: "/manifest.appcache",
      excludePaths: ['index.html', 'tests/'],
      includePaths: [],
      network: ['*']
    }

    for (var option in defaultOptions) {
      if (!options.hasOwnProperty(option)) {
        options[option] = defaultOptions[option];
      }
    }

    this.manifestOptions = options;
  },  

  postprocessTree: function (type, tree) {
    var options = this.manifestOptions;  

    if (type === 'all' && options.enabled) {
      manifestTree = fileRemover(tree, {
        paths: options.excludePaths
      });
      return mergeTrees([tree, manifest(manifestTree, options)]);
{'fraction_non_alphanumeric': 0.14887892376681613, 'fraction_numerical': 0.0017937219730941704, 'mean_word_length': 3.193609022556391, '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': '464823', 'n_tokens_mistral': 678, 'n_tokens_neox': 643, 'n_words': 142}