Procs cannot be marshalled, but formula objects may be as part of the
BuildError exception. If the formula object has a reference to a Proc,
this will fail.
Work around it by not storing the test Procs during installations.
Ruby 1.8.6 doesn't have Symbol#to_proc, which allows things like
map(&:to_s) rather than map { |o| o.to_s }. 1.8.7 does, though, and
since it is used in a bunch of the superenv code we should attempt to
keep it compatible with 1.8.6.
ClosesHomebrew/homebrew#16046.
`python --version` doesn't work in some (very) old versions of
python. While I doubt this is going to come up very often, it's
theoretically possible someone has an old python first in their
path. (python -V works on all versions I'm aware of, including
python3, and comes before --version in the --help anyway.)
Also skips the warning in case the regexp matches nothing, which
probably shouldn't happen. But if it does we shouldn't produce the
wrong warning.
Inheriting from Array (and other core types) is problematic:
- It exposes a very wide interface with many methods that are not
really relevant to the subclass.
- It can cause some weird side effects, as many Array operations are
in C and have hardcoded return values; for example, combining two
array subclasses returns a new Array instead of the subclass.
Avoid these problems using delegation and the Enumerable module where
applicable.
Tests can now be specified as a block in the DSL. A temporary test
directory is set up automatically when calling Formula#test. The
semantics of the test remain the same: the block can either raise an
exception or return false to signal failure.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Superenv scripts have a stripped PATH, which may not include
the brew binary itself. Make this explicitly available to
superenv scripts.
Fixes bsdmake wrapper.
ClosesHomebrew/homebrew#16805.
ClosesHomebrew/homebrew#16846.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Xcode.prefix and Xcode.installed? use slightly different heuristics to
find Xcode. In fact, .installed? basically duplicates a portion of the
.prefix logic. In practice, the methods results are usually consistent,
but .installed? does not handle non-standard prefixes if mdfind cannot
locate Xcode (for example, if the user has disabled Spotlight indexing).
Since .installed? is essentially a subset of the .prefix logic, we can
rely on the result from .prefix instead.
FixesHomebrew/homebrew#16790.
Originally written for tigerbrew, but useful enough for core.
Replaces the shelled-out which in utils.rb with a native-ruby
equivalent, which is moderately faster.
ClosesHomebrew/homebrew#16659.
Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
Pass the `--no-pager` flag to git when grabbing a diff summary for a patch as
there is no good reason to invoke a pager for ~2-10 lines that the user must
then exit manually.