intuit/simple_deploy — pull request #177 by rickmendes (2013-04-09 19:30:34+00:00)
Title: Refactored the config.

This will be one heck of a code review. Let's address what I did here so you have a heads up.

* I had a goal to configure the config once and use it throughout the current simple_deploy run.
* I refactored the Config class into a Configuration module as part of that goal.
* The second move towards that goal was the addition of the ResourceManager class.
* I hate the Singleton design pattern as much as anyone, but in cases of configuration or logging it is useful. In this case it is making sure we only load the environment configuration once per run.
* I plan to have ResourceManager manage the logger instance too when I do that refactoring.
* It may look nuts, but this branch adds a few more passes of the logger instance. There is a method to my madness. That kept me from having to support the logger inside the Configuration module, which I viewed as a bad design. It also left me a trail of logger stuff I can use to more quickly refactor the logger.

The flow is pretty easy. The CLI classes know the environment the user specified so they run the configure. All of the other classes simply request the config instance from ResourceManager.

I know this code review will be painful because there are so many changes. Unfortunately, progress is hard. The only way I can see to clean up this code is to attack end to end for each problem. That results in lots of changes.

Thanks.