<commit_before>﻿using System;
using ConDep.Dsl.Config;
using ConDep.Dsl.Logging;
using ConDep.Dsl.Remote;
using ConDep.Dsl.SemanticModel;
using ConDep.Dsl.SemanticModel.WebDeploy;
using ConDep.WebQ.Client;

namespace ConDep.Console.Deploy
{
    public class CmdDeployHandler : IHandleConDepCommands
    {
        private CmdDeployParser _parser;
        private CmdDeployValidator _validator;
        private CmdDeployHelpWriter _helpWriter;

        public CmdDeployHandler(string[] args)
        {
            _parser = new CmdDeployParser(args);
            _validator = new CmdDeployValidator();
            _helpWriter = new CmdDeployHelpWriter(System.Console.Out);
        }

        public void Execute(CmdHelpWriter helpWriter, ILogForConDep logger)
        {
            WebQueue webQ = null;
            var conDepSettings = new ConDepSettings();

            try
            {
                conDepSettings.Options = GetOptions(_parser, _validator);
                conDepSettings.Config = ConfigHandler.GetEnvConfig(conDepSettings);

                helpWriter.PrintCopyrightMessage();
                webQ = WaitInQueue(logger, conDepSettings);

                var status = new ConDepStatus();
                var clientValidator = new ClientValidator();

                var serverInfoHarvester = new ServerInfoHarvester(conDepSettings);
                var serverValidator = new RemoteServerValidator(conDepSettings.Config.Servers, serverInfoHarvester);

                ConDepConfigurationExecutor.ExecuteFromAssembly(conDepSettings, status, clientValidator, serverValidator);

                //if (status.HasErrors)
                //{
                //    throw status.<commit_msg>Fixed issue where ToEachServer returned remote operation and not local. This prevented proper chaining using the DSL.<commit_after>﻿using System;
using ConDep.Dsl.Config;
using ConDep.Dsl.Logging;
using ConDep.Dsl.Remote;
using ConDep.Dsl.SemanticModel;
using ConDep.Dsl.SemanticModel.WebDeploy;
using ConDep.WebQ.Client;

namespace ConDep.Console.Deploy
{
    public class CmdDeployHandler : IHandleConDepCommands
    {
        private CmdDeployParser _parser;
        private CmdDeployValidator _validator;
        private CmdDeployHelpWriter _helpWriter;

        public CmdDeployHandler(string[] args)
        {
            _parser = new CmdDeployParser(args);
            _validator = new CmdDeployValidator();
            _helpWriter = new CmdDeployHelpWriter(System.Console.Out);
        }

        public void Execute(CmdHelpWriter helpWriter, ILogForConDep logger)
        {
            WebQueue webQ = null;
            var conDepSettings = new ConDepSettings();

            try
            {
                conDepSettings.Options = GetOptions(_parser, _validator);
                conDepSettings.Config = ConfigHandler.GetEnvConfig(conDepSettings);

                helpWriter.PrintCopyrightMessage();
                webQ = WaitInQueue(logger, conDepSettings);

                var status = new ConDepStatus();
                ConDepConfigurationExecutor.ExecuteFromAssembly(conDepSettings, status);

                //if (status.HasErrors)
                //{
                //    throw status.
{'fraction_non_alphanumeric': 0.0706504824151883, 'fraction_numerical': 0.0, 'mean_word_length': 2.379600420609884, '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': '238853', 'n_tokens_mistral': 854, 'n_tokens_neox': 822, 'n_words': 178}