Implement `macro' recipe keyword

This commit is contained in:
Thibault Jouan committed 2013-12-20 23:19:16 +00:00
1 parent 43a781dc78
commit e8be44d1f0
7 files changed
+93 -13

No files matched your search

+8 -2
View File
@@ -34,8 +34,14 @@ module Producer
env.target = hostname
end
def task(name, &block)
@tasks << Task.evaluate(name, env, &block)
def task(name, *args, &block)
@tasks << Task.evaluate(name, env, *args, &block)
end
def macro(name, &block)
define_singleton_method(name) do |*args|
task("#{name}", *args, &block)
end
end
end
end