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.
17 lines
297 B
Ruby
17 lines
297 B
Ruby
module Producer
|
|
module Core
|
|
class Task
|
|
attr_reader :name, :actions
|
|
|
|
def self.evaluate(name, env, &block)
|
|
DSL::evaluate(name, env, &block)
|
|
end
|
|
|
|
def initialize(name, actions = [])
|
|
@name = name
|
|
@actions = actions
|
|
end
|
|
end
|
|
end
|
|
end
|