homebysix / recipe-robot

A kick ass tool for creating AutoPkg recipes.
Apache License 2.0
300 stars 28 forks source link

Create fact_validator() function to determine which recipes we can build #30

Closed homebysix closed 9 years ago

homebysix commented 9 years ago

Right now the generate_recipes() function and various generate_x_recipe() functions individually determine whether they can proceed, given the info in the facts dict. It might be more efficient to have a single fact_validator() function that centrally determines which recipes can be built and which should be skipped.

sheagcraig commented 9 years ago

Hmmm. I'm not sure.

If this were OOP, there would be some kind of manager class in charge of telling the recipe classes what to do. But it would have no idea of whether a recipe could or could not proceed. That task would be hidden within the recipe.

That said, we could create a recipe generator class that included some base validation code that each sub-recipe type could inherit from and override to add facts specific to their domain. And that would keep redundancy down.

homebysix commented 9 years ago

TBH, I think the current approach is decent:

So I'm unconvinced that we need a fact_validator().

The only thing that's currently not working is this: #44.