Modify task DSL API to take env on initialization

This commit is contained in:
Thibault Jouan
2014-01-08 21:55:33 +00:00
parent 356d778746
commit 1d6ae126ed
4 changed files with 20 additions and 16 deletions

View File

@@ -15,16 +15,16 @@ module Producer
define_action :file_write, Actions::FileWriter
attr_accessor :actions
attr_accessor :env, :actions
def initialize(&block)
def initialize(env, &block)
@env = env
@block = block
@actions = []
@condition = true
end
def evaluate(env, *args)
@env = env
def evaluate(*args)
instance_exec *args, &@block
end