<commit_before>/**
 * Copyright [2013] [runrightfast.co]
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

/**
 * @param options
 * 
 * <code>
 * {
 * TODO:document the plugin's options 
 * logLevel : 'WARN'					// OPTIONAL -default is 'WARN'
 * }   
 * </code>
 * 
 */
module.exports.register = function(plugin, options, next) {
	'use strict';

	var lodash = require('lodash');
	var Hoek = require('hoek');
	var assert = Hoek.assert;
	var extend = require('extend');

	var logging = require('runrightfast-commons').logging;
	var pkgInfo = require('./pkgInfo');
	var logger = logging.getLogger(pkgInfo.name);

	var config = {
		logLevel : 'WARN'
	/* TODO: default config goes here */
	};

	var validateConfig = function(config) {
		/* TODO: config validation goes here */
	};

	/**
	 * Used to select servers to configure based on server labels. By default,
	 * it returns back the plugin
	 */
	var selection = function(config) {
		if (lodash.isArray(config.serverLabels) || lodash.isString(config.serverLabels)) {
			return plugin.select(config.serverLabels);
		}
		return plugin;
	};

	var registerPlugin = function(config) {
		var servers = selection(config);
		/* TODO: finish plugin registration here, e.g, add server routes, etc */
	};

	extend(true, config, options);
	logging.setLogLevel(logger, config.logLevel);
	if (logger.isDebugEnabled()) {
		logger.debug(config);
	}
	validateConfig(config);
	registerPlugin(config);

	next();

};<commit_msg>removed selecting servers because we will only want and should have 1 server defined.<commit_after>/**
 * Copyright [2013] [runrightfast.co]
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

/**
 * @param options
 * 
 * <code>
 * {
 * TODO:document the plugin's options 
 * logLevel : 'WARN'					// OPTIONAL -default is 'WARN'
 * }   
 * </code>
 * 
 */
module.exports.register = function(plugin, options, next) {
	'use strict';

	var lodash = require('lodash');
	var Hoek = require('hoek');
	var assert = Hoek.assert;
	var extend = require('extend');

	var logging = require('runrightfast-commons').logging;
	var pkgInfo = require('./pkgInfo');
	var logger = logging.getLogger(pkgInfo.name);

	var config = {
		logLevel : 'WARN'
	/* TODO: default config goes here */
	};

	var validateConfig = function(config) {
		/* TODO: config validation goes here */
	};

	var registerPlugin = function(config) {
		/* TODO: finish plugin registration here, e.g, add server routes, etc */
	};

	extend(true, config, options);
	logging.setLogLevel(logger, config.logLevel);
	if (logger.isDebugEnabled()) {
		logger.debug(config);
	}
	validateConfig(config);
	registerPlugin(config);

	next();

};
{'fraction_non_alphanumeric': 0.12394212394212394, 'fraction_numerical': 0.004641004641004641, 'mean_word_length': 3.8210526315789473, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7204292', 'n_tokens_mistral': 1119, 'n_tokens_neox': 1054, 'n_words': 371}