49 Commits

Author SHA1 Message Date
Thibault Jouan
25d03d4322 Improve CLI error reporting 2014-10-12 18:11:37 +00:00
Thibault Jouan
f6237bfc0c Implement `yaml_eq' condition keyword 2014-10-11 13:46:18 +00:00
Thibault Jouan
0ba12bfb90 Implement `yaml_write' action 2014-10-11 00:47:16 +00:00
Thibault Jouan
9780cdf220 Support YAML templates 2014-10-10 23:58:20 +00:00
Thibault Jouan
82879b56b4 Extract Task#template code in Template class 2014-10-10 16:36:06 +00:00
Thibault Jouan
6cd294a0b8 Implement `template' task keyword 2014-09-28 14:33:35 +00:00
Thibault Jouan
2543fdeb00 Implement `file_match' condition keyword 2014-09-27 12:14:16 +00:00
Thibault Jouan
7a7c8379ff Improve CLI usage:
* Rewrite arguments parsing with OptionParser;
* Allow processing of multiple recipes.
2014-09-26 19:06:10 +00:00
Thibault Jouan
bd66ec25e4 Allow `mkdir' action to work recursively 2014-09-25 21:28:12 +00:00
Thibault Jouan
3b28045340 Merge Condition::DSL into Condition 2014-09-22 19:43:43 +00:00
Thibault Jouan
2c335b2437 Merge Task::DSL into Task 2014-09-22 19:43:36 +00:00
Thibault Jouan
166dae681c Merge Recipe::DSL into Recipe 2014-09-22 19:43:30 +00:00
Thibault Jouan
4a83e8c71a Implement `file_eq' condition keyword 2014-09-22 08:25:50 +00:00
Thibault Jouan
3c46c5bc61 Implement `test_macro' recipe keyword 2014-06-03 16:27:59 +00:00
Thibault Jouan
332bb1a416 Improve verbose mode output formatting 2014-05-25 12:14:25 +00:00
Thibault Jouan
7c6ac4c9d8 Implement `` condition keyword (shell cmd status) 2014-03-08 19:43:41 +00:00
Thibault Jouan
eeab386216 Implement `has_executable' condition keyword 2014-03-05 07:19:15 +00:00
Thibault Jouan
387f37f3f5 Implement `file_append' task action 2014-03-05 02:41:28 +00:00
Thibault Jouan
d22b023ff4 Implement `file_replace_content' task action 2014-03-05 02:02:52 +00:00
Thibault Jouan
bdd09b6ea9 Regroup all require calls in lib source files 2014-02-08 01:24:34 +00:00
Thibault Jouan
a0482d175c Implement `file_contains' condition keyword 2014-01-23 16:37:19 +00:00
Thibault Jouan
65ceb9e741 Refactor forwardable require calls 2014-01-22 21:33:05 +00:00
Thibault Jouan
7f5d1a4085 Implement `mkdir' task action 2014-01-21 15:50:07 +00:00
Thibault Jouan
0b4df20f55 Implement `has_dir' condition keyword 2014-01-21 15:02:07 +00:00
Thibault Jouan
7e062e06a1 Implement `ask' recipe keyword 2014-01-21 00:52:44 +00:00
Thibault Jouan
4c0a7f0fc7 Rename Interpreter class as Worker 2014-01-09 01:08:49 +00:00
Thibault Jouan
892a9862fc Implement `file_write' action 2013-12-20 06:26:21 +00:00
Thibault Jouan
2cbe1726f7 Implement `has_file' condition keyword 2013-09-26 00:28:40 +00:00
Thibault Jouan
d240df0281 Add Remote::FS class 2013-09-26 00:28:40 +00:00
Thibault Jouan
04afc82a29 Implement `has_env' condition keyword 2013-08-20 03:03:17 +00:00
Thibault Jouan
513ba4eedb Implement basic Remote::Environment class:
Represent a registry for remote environment variables, will follow an
API similar to Hash except the constructor. Currently only #has_key? is
implemented.
2013-08-20 02:13:54 +00:00
Thibault Jouan
ed99c191e0 Build conditions with DSL evaluated tests:
In Condition:

  * Modify constructor to accepts tests and a default return value;
  * Implement #met?;
  * Modify #! so that it return the negated value returned by #met?.

  In Condition::DSL:

  * Modify .evaluate to build the condition with tests and the value
    returned by a the evaluated condition block.

  Add a basic Test base class, with env and arguments as attributes.

  Add some spec helpers to build some easily testable kind of Test
instances (as test doubles).
2013-08-18 00:29:36 +00:00
Thibault Jouan
639bdc1c73 Implement basic condition DSL framework for tests:
Instead of interrupting task evaluation when condition is not met,
allow the whole task to be evaluated (including condition and
evaluation) so that the interpreter will get all tasks actions (whether
condition is met or not) and be able to query the condition.

* Modify Interpreter#process_task: test if task condition is met before
  applying the actions;
* Implement condition handling in Task and Task::DSL;
* Implement Condition and Condition::DSL (useless as they are, but
  needed to implement later test keywords as part of the condition DSL.
2013-08-18 00:29:14 +00:00
Thibault Jouan
b4e6fa3ef6 Fix sort order of main internal requires 2013-08-17 00:44:28 +00:00
Thibault Jouan
e4a4211a7b Rename Worker class as Interpreter 2013-08-16 19:30:51 +00:00
Thibault Jouan
a675c9c910 Implement `echo' task action 2013-08-14 23:43:36 +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
f10914c7d7 Implement basic `sh' task action feature:
* Executes a command on the remote host;
* Forwards remote standard output.
2013-08-07 16:16:40 +00:00
Thibault Jouan
6e1ba269eb Implement Remote class 2013-08-05 19:58:17 +00:00
Thibault Jouan
e6c14f1903 Implement basic task actions API:
* Add Action base class;
* Implement Task::DSL.define_action(keyword, klass);
* Add Task::DSL#actions accessor;
* Apply task DSL actions when Task instances are evaluated.
2013-08-04 20:30:54 +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
b1c99dbeeb Extract task DSL code and spec 2013-08-01 00:01:19 +00:00
Thibault Jouan
2939123574 Extract recipe DSL code and spec 2013-08-01 00:01:19 +00:00
Thibault Jouan
d199ba56fd Add Env class 2013-07-30 14:47:56 +00:00
Thibault Jouan
baaa957e9e Implement task evaluation feature 2013-07-28 19:18:53 +00:00
Thibault Jouan
7b4b2872fc Replace autoload with explicit require calls 2013-07-28 16:07: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
Thibault Jouan
c31bcf71ad Initial commit 2013-07-26 15:52:49 +00:00