Refactor CLI#run! method

This commit is contained in:
Thibault Jouan committed 2013-07-30 15:19:34 +00:00
1 parent 71ef5fcd29
commit a1e92893ad
2 files changed
+45 -25

No files matched your search

+8 -1
View File
@@ -11,8 +11,15 @@ module Producer
end
def run!
print_usage_and_exit(64) unless @arguments.length == 2
check_arguments!
evaluate_recipe_file(@arguments[1])
end
def check_arguments!
print_usage_and_exit(64) unless @arguments.length == 2
end
def evaluate_recipe_file(filepath)
recipe = Recipe.from_file(@arguments[1])
env = Env.new(recipe)
recipe.evaluate env