Add env recipe keyword feature
This commit is contained in:
1 parent
d677c3aa97
commit
a6e27edfd2
3 files changed
+28
No files matched your search
@@ -11,6 +11,7 @@ module Producer
|
||||
end
|
||||
|
||||
def evaluate(env)
|
||||
@env = env
|
||||
if @code
|
||||
instance_eval @code, env.current_recipe.filepath
|
||||
else
|
||||
@@ -25,10 +26,18 @@ module Producer
|
||||
|
||||
private
|
||||
|
||||
def env
|
||||
@env
|
||||
end
|
||||
|
||||
def source(filepath)
|
||||
instance_eval File.read("./#{filepath}.rb"), "#{filepath}.rb"
|
||||
end
|
||||
|
||||
def target(hostname)
|
||||
env.target = hostname
|
||||
end
|
||||
|
||||
def task(name, &block)
|
||||
@tasks << Task.new(name, &block)
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user