<commit_before>/* jshint node: true */
'use strict';


// Module requirements
var fs           = require('fs');
var path         = require('path');
var objectAssign = require('object-assign');


module.exports = {
  name: 'ember-froala-editor',


  // Addon build option defaults
  defaultOptions: {
    plugins   : true, // == ALL available plugins
    languages : false,
    themes    : false
  },


  included: function(app, parentAddon) {

    // Per the ember-cli documentation
    // http://ember-cli.com/extending/#broccoli-build-options-for-in-repo-addons
    var target = (parentAddon || app);


    // Ensure the Babel polyfill is imported
    // http://ember-cli.com/extending/#broccoli-build-options-for-in-repo-addons
    target.options       = target.options       || {};
    target.options.babel = target.options.babel || {};
    target.options.babel.includePolyfill = true;


    // Per the ADDON_HOOKS.md document
    // https://github.com/ember-cli/ember-cli/blob/master/ADDON_HOOKS.md#included
    this._super.included.apply(this, arguments);


    // Build options hash by merging default build options
    // with the apps ember-cli-build.js options
    var buildOptions = target.options[ this.name ] || {};
    var options      = objectAssign( this.defaultOptions, buildOptions );
    // var options   = Object.assign( this.defaultOptions, buildOptions ); // ES2015


    // Bower path to use while importing
    var froalaPath = path.join( target.bowerDirectory, 'froala-wysiwyg-editor' );


    // Make sure Froala Editor is available
    if ( !fs.existsSync( froalaPath ) ) {
      throw new Error(
        this.name + ': Froala Editor is not available from bower (' + froalaPath + '), ' +
        'install into your project by `bower install froala-wysiwyg-editor --save`'
      );
    }


    // Import the base Froala Editor files
    target.import( path.join( froalaPath, 'js', 'froala_editor.min.js' ) );
    target.import({
      development : path.join( froalaPath, 'css', 'froala_editor.css' ),
      production  : path.join( froalaPath, 'css', 'froala_editor.min.css' )
    });
    target.import({
      development : path.join( froalaPath, 'css', 'froala_style.css' ),
      production  : path.join( froalaPath, 'css', 'froala_style.min.css' )
    });


    // Bucket for import list / details
    var importFiles = [];


    // Import the other Froala Editor files (when requested)
    if ( options.plugins && options.plugins !== [] ) {
      importFiles.push({
        label     : 'Plugin(s)',
        path      : path.join( froalaPath, 'js', 'plugins' ),
        files     : options.plugins,
        extension : '.min.js'
      });
      importFiles.push({
        label     : 'Plugin CSS',<commit_msg>Update error wording thrown in index.js<commit_after>/* jshint node: true */
'use strict';


// Module requirements
var fs           = require('fs');
var path         = require('path');
var objectAssign = require('object-assign');


module.exports = {
  name: 'ember-froala-editor',


  // Addon build option defaults
  defaultOptions: {
    plugins   : true, // == ALL available plugins
    languages : false,
    themes    : false
  },


  included: function(app, parentAddon) {

    // Per the ember-cli documentation
    // http://ember-cli.com/extending/#broccoli-build-options-for-in-repo-addons
    var target = (parentAddon || app);


    // Ensure the Babel polyfill is imported
    // http://ember-cli.com/extending/#broccoli-build-options-for-in-repo-addons
    target.options       = target.options       || {};
    target.options.babel = target.options.babel || {};
    target.options.babel.includePolyfill = true;


    // Per the ADDON_HOOKS.md document
    // https://github.com/ember-cli/ember-cli/blob/master/ADDON_HOOKS.md#included
    this._super.included.apply(this, arguments);


    // Build options hash by merging default build options
    // with the apps ember-cli-build.js options
    var buildOptions = target.options[ this.name ] || {};
    var options      = objectAssign( this.defaultOptions, buildOptions );
    // var options   = Object.assign( this.defaultOptions, buildOptions ); // ES2015


    // Bower path to use while importing
    var froalaPath = path.join( target.bowerDirectory, 'froala-wysiwyg-editor' );


    // Make sure Froala Editor is available
    if ( !fs.existsSync( froalaPath ) ) {
      throw new Error(
        this.name + ': Froala Editor is not available from bower (' + froalaPath + '), ' +
        'install into your project by running `bower install froala-wysiwyg-editor --save`'
      );
    }


    // Import the base Froala Editor files
    target.import( path.join( froalaPath, 'js', 'froala_editor.min.js' ) );
    target.import({
      development : path.join( froalaPath, 'css', 'froala_editor.css' ),
      production  : path.join( froalaPath, 'css', 'froala_editor.min.css' )
    });
    target.import({
      development : path.join( froalaPath, 'css', 'froala_style.css' ),
      production  : path.join( froalaPath, 'css', 'froala_style.min.css' )
    });


    // Bucket for import list / details
    var importFiles = [];


    // Import the other Froala Editor files (when requested)
    if ( options.plugins && options.plugins !== [] ) {
      importFiles.push({
        label     : 'Plugin(s)',
        path      : path.join( froalaPath, 'js', 'plugins' ),
        files     : options.plugins,
        extension : '.min.js'
      });
      importFiles.push({
        label     : 'Plugin CSS',
{'fraction_non_alphanumeric': 0.13474791439970982, 'fraction_numerical': 0.0014508523757707653, 'mean_word_length': 2.5672703751617076, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5535857', 'n_tokens_mistral': 1712, 'n_tokens_neox': 1628, 'n_words': 409}