30 Commits

Author SHA1 Message Date
Thibault Jouan
e6ee3d5f77 Implement `-t' CLI option switch to specify target 2014-06-27 17:32:42 +00:00
Thibault Jouan
9eed0a8ef8 Replace all raise ruby keyword with fail 2014-06-05 12:37:42 +00:00
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
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
8168e68a2d Freeze contants 2014-05-25 14:20:54 +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
b67a32d27e Change CLI#recipe as read-only attribute 2014-01-09 01:16:13 +00:00
Thibault Jouan
4c0a7f0fc7 Rename Interpreter class as Worker 2014-01-09 01:08:49 +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
4d34f66ec5 Add EX_USAGE constant in CLI class 2014-01-07 21:23:15 +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
9251c6af8e Improve coding standards 2013-12-20 06:46:28 +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
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
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
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