Extract task DSL code and spec
This commit is contained in:
@@ -11,20 +11,6 @@ module Producer
|
||||
def evaluate
|
||||
DSL.new &@block
|
||||
end
|
||||
|
||||
|
||||
class DSL
|
||||
ConditionNotMetError = Class.new(StandardError)
|
||||
|
||||
def initialize(&block)
|
||||
instance_eval &block
|
||||
rescue ConditionNotMetError
|
||||
end
|
||||
|
||||
def condition(&block)
|
||||
raise ConditionNotMetError unless block.call
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user