<commit_before>'use strict'

/**
 * @module ember-refined-faker
 */

const Funnel = require('broccoli-funnel')

/**
 * @class config
 */
module.exports = {
  name: 'ember-refined-faker',

  options: {
    nodeAssets: {
      faker() {
        return {
          srcDir: 'build/build/',
          import: [
            { path: 'faker.js', using: [{ transformation: 'amd', as: 'faker' }] }
          ],
          enabled: this._defaults.enabled
        }
      }
    }
  },

  isDevelopingAddon() {
    return !this.app.isProduction
  },

  included(parent) {
    /**
     * Default configurations.
     * Users can overwrite this in Ember Application's config/environment.js.
     *
     * @property defaults
     * @type Object
     * @param defaults.defaultLocale { String } 缺省使用的语言，默认值：'en_US'
     */
    this._defaults = Object.assign({
      defaultLocale: 'en_US',
      enabled: 'production' !== parent.env
    }, parent.options.faker || {})

    this._super.included.apply(this, arguments)
  },

  config() {
    return this._defaults ? { faker: this._defaults } : {}
  },

  treeForApp() {
    const tree = this._super.treeForApp.apply(this, arguments)
    return this._defaults.enabled ? tree : this._excludes(tree)
  },

  treeForAddon() {
    const tree = this._super.treeForAddon.apply(this, arguments)
    return this._defaults.enabled ? tree : this._excludes(tree)
  },

  _excludes(tree, pattern = /helpers\/arr|fake/i) {
    return new Funnel(tree, { exclude: [pattern] })
  },
}
<commit_msg>Fix travis-ci issue<commit_after>'use strict'

/**
 * @module ember-refined-faker
 */

const Funnel = require('broccoli-funnel')

/**
 * @class config
 */
module.exports = {
  name: 'ember-refined-faker',

  options: {
    nodeAssets: {
      faker() {
        return {
          srcDir: 'build/build/',
          import: [
            { path: 'faker.js', using: [{ transformation: 'amd', as: 'faker' }] }
          ],
          enabled: this._defaults.enabled
        }
      }
    }
  },

  isDevelopingAddon() {
    return !this.app.isProduction
  },

  included(parent) {
    /**
     * Default configurations.
     * Users can overwrite this in Ember Application's config/environment.js.
     *
     * @property defaults
     * @type Object
     * @param defaults.defaultLocale { String } 缺省使用的语言，默认值：'en_US'
     */
    this._defaults = Object.assign({
      defaultLocale: 'en_US',
      enabled: 'production' !== parent.env
    }, parent.options.faker || {})

    this._super.included.apply(this, arguments)
  },

  config() {
    return this._defaults ? { faker: this._defaults } : {}
  },

  treeForApp() {
    const tree = this._super.treeForApp.apply(this, arguments)
    return this._defaults.enabled ? tree : this._excludes(tree)
  },

  treeForAddon() {
    const tree = this._super.treeForAddon.apply(this, arguments)
    return this._defaults.enabled ? tree : this._excludes(tree)
  },

  _excludes(tree) {
    return new Funnel(tree, { exclude: [/helpers\/arr|fake/i] })
  },
}

{'fraction_non_alphanumeric': 0.14875207986688851, 'fraction_numerical': 0.0, 'mean_word_length': 2.491289198606272, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1473308', 'n_tokens_mistral': 1010, 'n_tokens_neox': 987, 'n_words': 182}