7 Commits

Author SHA1 Message Date
Jack Nagel
b322020338 Reduce allocations in dependency construction
By always passing around a single, unnested array rather than splatting
and then defensively flattening and compacting things, we can avoid
allocating a bunch of unnecessary arrays. This gives a performance boost
of roughly 4% when enumerating 2500 formulae, and has the side effect of
cleaning up the dependency API.
2013-05-06 16:08:50 -05:00
Jack Nagel
646102c311 Fix argument order in test_comparableset 2013-04-08 18:34:55 -05:00
Jack Nagel
210401654b Allow specifying a name attribute for X11Dependency 2013-01-28 10:35:14 -06:00
Jack Nagel
871f3a091a Update require 2013-01-27 16:29:19 -06:00
Jack Nagel
762c355b30 ComparableSet#merge returns self
Set#merge is supposed to return self, and Formula#recursive_requirements
depended on this being true.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-10-25 15:54:55 -05:00
Jack Nagel
d1f754c02e Allow requirements to record tags
To allow

  depends_on :x11 => :optional

and friends to work as expected, make requirements record any tags and
add special handling to the X11Dependency to record both a minimum
version and additional tags.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
2012-10-25 14:28:53 -05:00
Misty De Meo
bbfb6400c7 Manage Requirements using ComparableSet
ComparableSet only allows a single object of a given class,
choosing the object with the greatest value. This was mainly created
for Requirements, so that, e.g., two X11Dependencies of differing
strictness don't both end up in the same requirement set.

Fixes Homebrew/homebrew#15240.
2012-10-15 09:46:29 -05:00