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.
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
module Producer
|
||||
module Core
|
||||
class Task
|
||||
attr_reader :name
|
||||
attr_reader :name, :actions
|
||||
|
||||
def initialize(name, &block)
|
||||
@name = name
|
||||
@block = block
|
||||
@name = name
|
||||
@block = block
|
||||
@actions = []
|
||||
end
|
||||
|
||||
def evaluate(env)
|
||||
dsl = DSL.new(&@block)
|
||||
dsl.evaluate(env)
|
||||
dsl.actions.map(&:apply)
|
||||
@actions = dsl.actions
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user