Introduce Recipe::DSL to eval recipe DSL code

This commit is contained in:
Thibault Jouan
2013-07-28 18:08:16 +00:00
parent e5d5fc0a41
commit 8e4f670fbf
2 changed files with 28 additions and 6 deletions

View File

@@ -12,7 +12,18 @@ module Producer
end
def evaluate
Object.new.instance_eval @code
dsl = DSL.new(@code)
end
class DSL
def initialize(code = nil, &block)
if code
instance_eval code
else
instance_eval &block
end
end
end
end
end