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

module.exports = {
  name: 'ember-cli-bugsnag',

  contentFor: function(type, config) {
    var content = '';
    var bugsnagConfig;
    var envArray;

    if (type === 'head' && config.environment !== 'test') {
      if (!config.bugsnag) {
        console.warn('`config.bugsnag` is not defined, using environment variables instead.');

        var envApiKey = process.env['BUGSNAG_API_KEY'];
        var envReleases = process.env['BUGSNAG_NOTIFY_RELEASE'];

        if (!envApiKey || !envReleases) {
          console.error('Environment variables `BUGSNAG_API_KEY` and `BUGSNAG_NOTIFY_RELEASE` are not specified. Bugsnag will not be injected.');

          return '';
        }

        bugsnagConfig = {
          apiKey: envApiKey,
          libraryUrl: process.env['BUGSNAG_LIBRARY_URL'],
          notifyReleaseStages: envReleases.split(','),
          releaseStage: process.env['BUGSNAG_RELEASE_STAGE']
        };
      } else {
        bugsnagConfig = config.bugsnag;
      }

      var libraryUrl = bugsnagConfig.libraryUrl || 'https://d2wy8f7a9ursnm.cloudfront.net/bugsnag-2.min.js';
      var releaseStage = bugsnagConfig.releaseStage || config.environment;
      envArray = bugsnagConfig.notifyReleaseStages ? bugsnagConfig.notifyReleaseStages : [];

      content = [
        '<script ',
        'src="' + libraryUrl + '" ',
        'data-appversion="' + config.currentRevision + '" ',
        'data-apikey="' + bugsnagConfig.apiKey + '">',
        '</script>',
        '<script>',
        'if (typeof Bugsnag !== "undefined") {',
        'Bugsnag.releaseStage = "' + releaseStage + '";',
        'Bugsnag.notifyReleaseStages = ["' + envArray.join('","') + '"];',
        '}',
        '</script>'
      ];
    }

    return content;
  }
};<commit_msg>Adding support for custom endpoint<commit_after>/* jshint node: true */
'use strict';

module.exports = {
  name: 'ember-cli-bugsnag',

  contentFor: function(type, config) {
    var content = '';
    var bugsnagConfig;
    var envArray;

    if (type === 'head' && config.environment !== 'test') {
      if (!config.bugsnag) {
        console.warn('`config.bugsnag` is not defined, using environment variables instead.');

        var envApiKey = process.env['BUGSNAG_API_KEY'];
        var envReleases = process.env['BUGSNAG_NOTIFY_RELEASE'];

        if (!envApiKey || !envReleases) {
          console.error('Environment variables `BUGSNAG_API_KEY` and `BUGSNAG_NOTIFY_RELEASE` are not specified. Bugsnag will not be injected.');

          return '';
        }

        bugsnagConfig = {
          apiKey: envApiKey,
          libraryUrl: process.env['BUGSNAG_LIBRARY_URL'],
          notifyReleaseStages: envReleases.split(','),
          releaseStage: process.env['BUGSNAG_RELEASE_STAGE']
        };
      } else {
        bugsnagConfig = config.bugsnag;
      }

      var libraryUrl = bugsnagConfig.libraryUrl || 'https://d2wy8f7a9ursnm.cloudfront.net/bugsnag-2.min.js';
      var releaseStage = bugsnagConfig.releaseStage || config.environment;
      envArray = bugsnagConfig.notifyReleaseStages ? bugsnagConfig.notifyReleaseStages : [];

      content = [
        '<script ',
        'src="' + libraryUrl + '" ',
        'data-appversion="' + config.currentRevision + '" ',
        'data-apikey="' + bugsnagConfig.apiKey + '">',
        '</script>',
        '<script>',
        'if (typeof Bugsnag !== "undefined") {',
        'Bugsnag.releaseStage = "' + releaseStage + '";',
        'Bugsnag.notifyReleaseStages = ["' + envArray.join('","') + '"];',
        bugsnagConfig.endpoint ? 'Bugsnag.endpoint = ["' + bugsnagConfig.endpoint + '"];' : '',
        '}',
        '</script>'
      ];
    }

    return content;
  }
};
{'fraction_non_alphanumeric': 0.15249266862170088, 'fraction_numerical': 0.002665955745134631, 'mean_word_length': 2.6321393998063893, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '4340263', 'n_tokens_mistral': 1186, 'n_tokens_neox': 1171, 'n_words': 207}