31 Commits

Author SHA1 Message Date
Thibault Jouan
2363bfb62a Implement `set' task keyword 2015-04-06 12:39:09 +00:00
Thibault Jouan
433f830c54 Implement recipe arguments
CLI will stop arguments processing after the special `--' argument,
the rest will be saved in the env and accessible through a new task
keyword: `recipe_argv'.
2015-04-04 05:25:01 +00:00
Thibault Jouan
3b413a242f Implement `set?' task keyword:
When called from a task, will return true when given key exists and
false when key does not exist.
2014-11-18 16:48:11 +00:00
Thibault Jouan
a7b2c4abea Implement `target' recipe keyword 2014-09-25 01:24:25 +00:00
Thibault Jouan
638f8320bc Implement nested tasks 2014-09-24 22:26:29 +00:00
Thibault Jouan
2c335b2437 Merge Task::DSL into Task 2014-09-22 19:43:36 +00:00
Thibault Jouan
2b86bbf112 Implement Task#to_s 2014-05-25 12:12:09 +00:00
Thibault Jouan
48a9da9365 Fix coding standards (module nesting) in specs 2014-02-08 17:59:33 +00:00
Thibault Jouan
780bb9041d Remove accessor tests in Task spec 2014-01-20 01:52:50 +00:00
Thibault Jouan
658a5903fa Improve Task spec, remove instance_eval usage 2014-01-20 01:51:10 +00:00
Thibault Jouan
656c456706 Change Task#evaluate spec, more classic test style 2014-01-20 01:48:31 +00:00
Thibault Jouan
1d6ae126ed Modify task DSL API to take env on initialization 2014-01-08 22:11:30 +00:00
Thibault Jouan
e8be44d1f0 Implement `macro' recipe keyword 2013-12-20 23:19:16 +00:00
Thibault Jouan
43a781dc78 Remove Task::DSL.evaluate method 2013-12-20 11:43:18 +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
a692efe96d Replace be_true' matchers with be true' in specs 2013-12-19 19:46:32 +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
0008f0255a Fix confusing local variable name in Task spec 2013-08-17 00:45:09 +00:00
Thibault Jouan
b6adc0ba43 Fix wording in Task#initialize spec 2013-08-16 21:08:33 +00:00
Thibault Jouan
a028b8922f Increase Task.evaluate spec coverage 2013-08-15 22:34:13 +00:00
Thibault Jouan
d4d5222261 Refactor task DSL usages:
Remove most of task evaluation code from Task class, rely on
Task::DSL.evaluate to get an evaluated task.

* Task: remove #evaluate, change constructor prototype to accept actions
  instead of a block, implement .evaluate(name, env &block);
* Implement Task::DSL.evaluate method;
* Recipe::DSL: remove tasks evaluation from#evaluate, modify #task to
  use Task.evaluate to return the new task to be rigstered.
2013-08-15 22:28:16 +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
8123cf5052 Add Task#initialize spec 2013-08-07 01:22:46 +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
ace6a4ad2b Implement Task::DSL#evaluate:
So that the env is available from the task DSL.
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
b1c99dbeeb Extract task DSL code and spec 2013-08-01 00:01:19 +00:00
Thibault Jouan
c642584c95 Fix task DSL spec:
* Use explicit named subject;
* Fix description for Task::DSL#condition when condition is not met.
2013-07-30 14:36:33 +00:00
Thibault Jouan
d146566411 Implement tasks condition feature 2013-07-28 22:56:08 +00:00
Thibault Jouan
baaa957e9e Implement task evaluation feature 2013-07-28 19:18:53 +00:00