Introduce Recipe::DSL to eval recipe DSL code

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

No files matched your search

+12 -1
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