Ejemplo n.º 1
0
        public void WhenIExecuteTheFollowingTask(Table table)
        {
            string code   = String.Join(Environment.NewLine, table.Rows.Select(x => x["Code"]));
            string script = @"

                using Bob;

                public class Sample : IBob
                {
                    private ITask Default()
                    {
                        return " + code + @";
                    }

                    public void Execute(IPipeline pipeline)
                    {
                        pipeline.Define(Default);
                    }
                }

                            ";

            Pipeline pipeline = new Pipeline();
            IBob     bob      = Runner.Compile(script);

            bob.Execute(pipeline);
            pipeline.Execute("Default");
        }
Ejemplo n.º 2
0
        public static int Main(string[] args)
        {
            string script = args.Length > 0 ? File.ReadAllText(args[0]) : null;
            string target = args.Length > 1 ? args[1] : null;

            if (script != null)
            {
                TaskResult result;
                Pipeline   pipeline = new Pipeline();
                IBob       bob      = Runner.Compile(script);

                bob.Execute(pipeline);
                result = target == null?pipeline.Execute() : pipeline.Execute(target);

                return(result == TaskResult.Successful ? 0 : -1);
            }

            return(-1);
        }