aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/options.rb
AgeCommit message (Collapse)Author
2013-06-07Simplify Options#inspectJack Nagel
2013-05-24Define inspect on Option and OptionsJack Nagel
2013-05-06Avoid extra array allocationsJack Nagel
2013-02-17Don't shadow outer local variableJack Nagel
2013-01-30Fix passing multiple switches as a single word to the buildJack Nagel
Fixes #17434.
2013-01-26FormulaInstaller: construct new ARGV from an Options collectionJack Nagel
The array of options that is passed to the spawned build process is a combination of the current ARGV, options passed in by a dependent formula, and an existing install receipt. The objects that are interacting here each expect the resulting collection to have certain properties, and the expectations are not consistent. Clear up this confusing mess by only dealing with Options collections. This keeps our representation of options uniform across the codebase. We can remove BuildOptions dependency on HomebrewArgvExtension, which allows us to pass any Array-like collection to Tab.create. The only other site inside of FormulaInstaller that uses the array is the #exec call, and there it is splatted and thus we can substitute our Options collection there as well.
2013-01-26Refactor option handling internalsJack Nagel
Currently we handle options in several ways, and it is hard to remember what code needs an option string ("--foo"), what needs only the name ("foo") and what needs an Option object. Now that Option objects can act as strings and be converted to JSON, we can start using them instead of passing around strings between Formula objects, Tab objects, and ARGV-style arrays. The Options class is a special collection that can be queried for the inclusion of options in any form: '--foo', 'foo', or Option.new("foo").