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

23 lines
419 B
Ruby

module Producer
module Core
class Task
class DSL
ConditionNotMetError = Class.new(StandardError)
def initialize(&block)
@block = block
end
def evaluate(env)
instance_eval &@block
rescue ConditionNotMetError
end
def condition(&block)
raise ConditionNotMetError unless block.call
end
end
end
end
end