I think we have reached the extent that we can support brew-gem as a single file in a reasonable manner. There are no limitations in homebrew formulas that prevent us from having brew-gem installed as a bin executable and calling out to separate library files for parsing arguments, processing the installation, and using a template file for building the temp formula.
This obviously would take time to do right, but I would like to at least call out a few things that should be done when attempting to accomplish this:
Tests. At a minimum, some unit tests, but possibly some integration tests via aruba or a similar framework.
Split files out into their respective functions.
A lib for parsing arguments, probably making use of Ruby's OptionParser
Libs for handling searching for the gem, downloading of gem, building of the formula file, etc.
A separate template file for the formula.
Avoid any external gem dependencies for deployment. We can make use of gems for test frameworks and such is fine, but I think trying to use external gems for the execution will be too cumbersome.
I think we have reached the extent that we can support brew-gem as a single file in a reasonable manner. There are no limitations in homebrew formulas that prevent us from having brew-gem installed as a bin executable and calling out to separate library files for parsing arguments, processing the installation, and using a template file for building the temp formula.
This obviously would take time to do right, but I would like to at least call out a few things that should be done when attempting to accomplish this: