35 Commits

Author SHA1 Message Date
Thibault Jouan
18b835b10e Improve test suite performance with aruba wrapper:
* Implement ArubaProgramWrapper in cucumber env;
* Tag a few features to not use the wrapper as aruba doesn't support yet
  interactive testing with in process mode, and reported program name
  will not be the correct one;
* Assign required standard streams to CLI and Env classes.
2014-05-30 23:14:00 +00:00
Thibault Jouan
2ee3b5dbaf Improve CLI spec examples sort order 2014-05-30 23:09:42 +00:00
Thibault Jouan
d4d1657a4a Simplify CLI 2014-05-26 00:46:39 +00:00
Thibault Jouan
39427c35c3 Refactor and simplify CLI and Env:
* Do not modify Env logger from CLI;
* Add verbose attribute to Env;
* Implement Env#verbose?;
* Remove Env#log_level and Env#log_level=;
* Refactor related specs, improve some wording.
2014-05-25 17:44:24 +00:00
Thibault Jouan
0db2d90b72 Show command when remote execution fail 2014-05-25 15:51:33 +00:00
Thibault Jouan
87a3ead082 Implement dry run mode 2014-05-25 13:38:47 +00:00
Thibault Jouan
8291f1bcfd Implement verbose mode 2014-05-25 12:14:22 +00:00
Thibault Jouan
7cffa34442 Attach our env to the worker from the CLI 2014-05-25 12:12:09 +00:00
Thibault Jouan
d347b8d6f5 Remove last instance_eval usage in spec 2014-01-20 02:05:30 +00:00
Thibault Jouan
a031cb2b51 Use more explicit example in CLI spec 2014-01-19 00:05:01 +00:00
Thibault Jouan
b67a32d27e Change CLI#recipe as read-only attribute 2014-01-09 01:16:13 +00:00
Thibault Jouan
7dfbc3905b Rewrite CLI#run:
* Rename #run! to #run;
* Add #load_recipe method;
* Remove most builder/accessor/memoizable methods.
2014-01-08 02:10:18 +00:00
Thibault Jouan
f7efd9c42f Refactor CLI usage into CLI.run!:
* Add Producer::Core::CLI::ArgumentError class;
* Raise ArgumentError in CLI.new when recipe is missing;
* Remove #check_arguments! and #print_usage_and_exit, move code into
  .run! method.
2014-01-07 21:06:14 +00:00
Thibault Jouan
dc9e7f1412 Improve CLI API related to standard output 2014-01-07 18:47:56 +00:00
Thibault Jouan
ef0307fbb5 Improve small details in specs:
* Fix coding standards;
* Simplify some expectations (eq instead of be matcher);
* Expect identity on block instead of calling;
* Change some before call as oneliners;
* Avoid shadowing variable names;
* Improve wording where needed.
2013-12-19 22:46:56 +00:00
Thibault Jouan
e4a4211a7b Rename Worker class as Interpreter 2013-08-16 19:30:51 +00:00
Thibault Jouan
f0e144cebd Refactor and simplify recipe DSL evaluation usages:
Remove most of recipe evaluation code in Recipe class, and rely on
Recipe::DSL to get evaluated recipes.

* Remove Recipe#evaluate call from CLI, rely on
  Recipe.evaluate_from_file to get the evaluated recipe;
* Implement Recipe.evaluate_from_file(filepath, env);
* Implement Recipe::DSL.evaluate(code, env);
* Remove code and filepath accessor on Recipe;
* Remove Recipe.from_file and Recipe#evaluate methods;
* Move task evaluations in Recipe::DSL#evaluate;
* Modify Recipe constructor so that it accepts tasks as argument.
2013-08-14 19:48:43 +00:00
Thibault Jouan
53db841b2d Remove Env#current_recipe attribute 2013-08-13 01:36:33 +00:00
Thibault Jouan
a5d9ca26f4 Remove error handling for evaluation errors 2013-08-13 00:42:14 +00:00
Thibault Jouan
0904fa1fc9 Implement Worker class:
* Move recipe processing code in the worker;
* Refactor CLI and use the the worker;
* Implement Recipe#tasks and remove tasks application during evaluation,
  tasks are now applied by the worker after all evaluations are done.
2013-08-10 14:47:02 +00:00
Thibault Jouan
9285a951c7 Add missing spec for CLI#initialize 2013-08-06 20:02:23 +00:00
Thibault Jouan
779eb72c32 Improve wording in CLI#arguments spec 2013-08-06 19:41:48 +00:00
Thibault Jouan
bd1bdba9cf Fix CLI#evaluate_recipe_file spec:
The spec wasn't covering the case when recipe evaluation raises an
unexpected error.
2013-08-06 19:38:33 +00:00
Thibault Jouan
eaccf55581 Improve CLI spec:
Test #arguments accessor instead of testing the constructor.
2013-08-06 19:17:22 +00:00
Thibault Jouan
c3737e738e Refactor trap_exit spec helper usages 2013-08-01 22:51:41 +00:00
Thibault Jouan
c4fc9828db Improve error reporting during recipe evaluation
* Report invalid action usages from tasks;
* Implement backtrace cleaning in CLI;
* Extract error class declarations in a new errors file;
* Replace raise with fail keyword in task DSL class.
2013-08-01 20:31:39 +00:00
Thibault Jouan
a45a340b64 Improve some context descriptions in specs 2013-08-01 00:01:20 +00:00
Thibault Jouan
0aa043b61a Remove host argument:
Currently the idea is to later implement a -h (or -t) option to the
command, and/or a `target' recipe keyword. Another option might be to
use the target/host key when the key/value registry will be implemented
and made available to the recipe and task DSLs.
2013-08-01 00:01:20 +00:00
Thibault Jouan
2acb57254f Fix a few coding standards issues:
* Remove extra empty lines before private keyword usages.

  specs:

  * Fix one long line;
  * use proc keyword instead of Proc.new.
2013-08-01 00:01:20 +00:00
Thibault Jouan
e12dd5c0e7 Implement recipe error reporting feature 2013-08-01 00:01:15 +00:00
Thibault Jouan
a1e92893ad Refactor CLI#run! method 2013-07-30 15:19:34 +00:00
Thibault Jouan
d199ba56fd Add Env class 2013-07-30 14:47:56 +00:00
Thibault Jouan
ead09c2118 Test exact exit status in CLI spec 2013-07-28 23:25:58 +00:00
Thibault Jouan
0921be9ab0 Implement recipe evaluation feature 2013-07-27 18:20:45 +00:00
Thibault Jouan
a6cfd4d7cb Implement CLI usage feature 2013-07-27 13:04:30 +00:00