mxcl/homebrew — pull request #18922 by colindean (2013-04-03 01:29:50+00:00)
Title: Add decorator to `brew info $pkg` dependency list to indicate Dependency#installed?

* Replace simple join output with decorator method.
* Define default decorator method.
* The default decorator method shows green check if installed or red X if not.

![Screen Shot 2013-04-02 at 9 10 19 PM](https://f.cloud.github.com/assets/197224/331792/9422dd70-9bfd-11e2-8dcc-6cbe6654720e.png)

Using a decorator method here enables a user to override Homebrew#decorate_dependencies with whatever they desire. I like the green checkmark and red X, so I offer them for the default. An simpler, less unicode-y alternative would be to simply highlight the dependency package name in the given color.

My personal motivation here is to use the indication as a factor in determining if I want to install a package *right now*. If I look at a package's info and see that none of its dependencies are installed, and installing them may take a while, I may reconsider installing that package right now if I'm on battery or if I'm doing something that CPU or disk usage from compiling may negatively affect.

Future work would include a similar decorator for conflicting packages, displaying some kind of a warning character if a conflicting package is installed.