<commit_before>///<reference path="typings/node/node.d.ts" />
var version_getter = require('./checkNewVersion.js');	
var zip_getter = require('./getZIP.js');	
var path  = require('path');
var speed_formatter = require('./bandwitdhSpeedHuman.js');
var nconf = require('nconf');
var fs = require('fs');
var Q = require('Q');

var options,peticion_actual, local;
/**
 * Inicializa las opciones de configuración
 */
function init(file_config) {
	var defer = Q.defer();
	try {		
		var _file_config = file_config || './config.json';
		nconf.use('file', { file: _file_config  });	
		options = {
			local_package_json: nconf.get('local_package_json'),
			remote_url_package_json: nconf.get('remote_url_package_json'),
			package_zip_url: nconf.get('package_zip_url'),
			installDir: nconf.get('installDir')
		};
		defer.resolve();
	} catch (error) {
		return defer.reject(error);
	}
	return defer.promise;
};
/**
 * Compara la versión local con la del servidor
 */
function comparar_versiones() {
	var defer = Q.defer();
	try {
		//CHECK LOCAL VERSION
		local = require(options.local_package_json);	
	} catch (error) {
		return defer.reject(error);		
	}	
	//CHECK REMOTE VERSION	
	version_getter.checkNewVersion(options.remote_url_package_json)
	.then(function (remote) {
		if(remote.version > local.version)
		{
			return defer.resolve(true);
		}else{
			return defer.resolve(false);
		}
	}, function (error) {
		return defer.reject(error);<commit_msg>return mal puestos -.-<commit_after>///<reference path="typings/node/node.d.ts" />
var version_getter = require('./checkNewVersion.js');	
var zip_getter = require('./getZIP.js');	
var path  = require('path');
var speed_formatter = require('./bandwitdhSpeedHuman.js');
var nconf = require('nconf');
var fs = require('fs');
var Q = require('Q');

var options,peticion_actual, local;
/**
 * Inicializa las opciones de configuración
 */
function init(file_config) {
	var defer = Q.defer();
	try {		
		var _file_config = file_config || './config.json';
		nconf.use('file', { file: _file_config  });	
		options = {
			local_package_json: nconf.get('local_package_json'),
			remote_url_package_json: nconf.get('remote_url_package_json'),
			package_zip_url: nconf.get('package_zip_url'),
			installDir: nconf.get('installDir')
		};
		defer.resolve();
	} catch (error) {
		defer.reject(error);
	}
	return defer.promise;
};
/**
 * Compara la versión local con la del servidor
 */
function comparar_versiones() {
	var defer = Q.defer();
	try {		
		//CHECK LOCAL VERSION
		local = require(options.local_package_json);
	} catch (error) {
		defer.reject(error);		
	}	
	//CHECK REMOTE VERSION	
	version_getter.checkNewVersion(options.remote_url_package_json)
	.then(function (remote) {
		if(remote.version > local.version)
		{
			defer.resolve(true);
		}else{
			defer.resolve(false);
		}
	}, function (error) {
		defer.reject(error);
{'fraction_non_alphanumeric': 0.15462478184991274, 'fraction_numerical': 0.0, 'mean_word_length': 4.397363465160075, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '7013327', 'n_tokens_mistral': 1074, 'n_tokens_neox': 1001, 'n_words': 197}