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

var inject = false;

var fs = require('fs');

var Handlebars = require('handlebars');

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

  contentFor: function(type, config){
	if( inject && type === 'head' ) {
	  return inject;
	}
  },

  serverMiddleware: function(config) {
	var options = config.options['inject-head'];

	if( options && options.template ) {
	  try {
		var head = fs.readFileSync(options.template, 'utf8').toString();
	  } catch (err) {
		return inject = false;
	  }
	  return inject = Handlebars.compile(head)(options.context);
	}
  }
};<commit_msg>change to using prebuild so it works in production<commit_after>/* jshint node: true */
'use strict';

var inject = false;

var fs = require('fs');

var Handlebars = require('handlebars');

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

  contentFor: function(type, config){
	if( inject && type === 'head' ) {
	  return inject;
	}
  },

  preBuild: function() {
	var config = this.app.options;
	var options = config['inject-head'];

	if( options && options.template ) {
	  try {
		var head = fs.readFileSync(options.template, 'utf8').toString();
		return inject = Handlebars.compile(head)(options.context);
	  } catch (err) {
		console.error('!!!!!!!! EMBER CLI INJECT HEAD - ERROR !!!!!!!\n', err);
		return inject = false;
	  }
	}
  }
};
{'fraction_non_alphanumeric': 0.17153284671532848, 'fraction_numerical': 0.00145985401459854, 'mean_word_length': 3.7937062937062938, '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': '2152901', 'n_tokens_mistral': 472, 'n_tokens_neox': 449, 'n_words': 115}