Inheritance: ScriptExecutor, IRepl
Ejemplo n.º 1
0
        private void InitRepl()
        {
            var servicesBuilder = new ReplScriptServicesBuilder(new ScriptConsole(), new Common.Logging.Simple.NoOpLogger()).Repl(true);
            servicesBuilder.ScriptName("F14N.REPL");

            this.scriptServices = servicesBuilder.Build();
            this.scriptServices.Executor.Initialize(new string[] { }, this.scriptServices.ScriptPackResolver.GetPacks());
            this.scriptServices.Executor.AddReferenceAndImportNamespaces(new[] { typeof(FluentAutomation.FluentTest), typeof(FluentAutomation.SeleniumWebDriver) });

            this.repl = this.scriptServices.Executor as Repl;
            this.settingsManager = new SettingsManager((scriptString) =>
            {
                return this.repl.Execute(scriptString);
            });
        }
Ejemplo n.º 2
0
 public ReplEngineWrapper(ILog logger, Repl repl, MemoryBufferConsole console)
 {
     this.logger = logger;
     this.repl = repl;
     this.console = console;
 }
Ejemplo n.º 3
0
 public ReplWorker(Repl repl)
 {
     this.repl = repl;
 }
Ejemplo n.º 4
0
        private Repl GetRepl(string[] args, out MemoryBufferConsole memoryBufferConsole)
        {
            SetProfile();
			ScriptCsArgs arguments = ParseArguments(args);
			var scriptServicesBuilder = ScriptServicesBuilderFactory.Create(Config.Create(arguments), args);
            IInitializationServices _initializationServices = scriptServicesBuilder.InitializationServices;
            IFileSystem _fileSystem = _initializationServices.GetFileSystem();

            if (_fileSystem.PackagesFile == null)
            {
                throw new ArgumentException("The file system provided by the initialization services provided by the script services builder has a null packages file.");
            }

            if (_fileSystem.PackagesFolder == null)
            {
                throw new ArgumentException("The file system provided by the initialization services provided by the script services builder has a null package folder.");
            }

            ScriptServices scriptServices = scriptServicesBuilder.Build();
            memoryBufferConsole = new MemoryBufferConsole();
            Repl repl = new Repl(
				args, 
				_fileSystem, 
				scriptServices.Engine,
                scriptServices.ObjectSerializer, 
				scriptServices.LogProvider,
				scriptServices.ScriptLibraryComposer,
				memoryBufferConsole,
                scriptServices.FilePreProcessor, 
				scriptServices.ReplCommands);

            var workingDirectory = _fileSystem.CurrentDirectory;
            var assemblies = scriptServices.AssemblyResolver.GetAssemblyPaths(workingDirectory);
            var scriptPacks = scriptServices.ScriptPackResolver.GetPacks();

            repl.Initialize(assemblies, scriptPacks, null);

            return repl;

        }