Without it, String#undent would fail on unindented strings, e.g.:
"foo".undent
NoMethodError: undefined method `length' for nil:NilClass`
ClosesHomebrew/homebrew#28873.
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
It is activated by the same mechanism as the Homebrew/versions compilers
which now check if the GCC formula uses the same, correct version.
References Homebrew/homebrew#28418.
We know what strategy we want, so going through DownloadStrategyDetector
is wasted work. Now we can remove those patterns from the detector and
have two fewer branches each time through.
This commit introduces a new patch implementation that supports
checksums and caching.
Patches are declared in blocks:
patch do
url ...
sha1 ...
end
A strip level of -p1 is assumed. It can be overridden using a symbol
argument:
patch :p0 do
url ...
sha1 ...
end
Patches can be declared in stable, devel, and head blocks. This form is
preferred over using conditionals.
stable do
# ...
patch do
url ...
sha1 ...
end
end
Embedded (__END__) patches are declared like so:
patch :DATA
patch :p0, :DATA
Patches can also be embedded by passing a string. This makes it possible
to provide multiple embedded patches while making only some of them
conditional.
patch :p0, "..."
In order to allow kegs built with the same version but differing formula
revisions to coexist, we must encode the revision as part of the keg's
name. This is necessary to actually perform an upgrade, as we cannot
upgrade a keg in-place, and temporarily moving it pending the result of
the upgrade is error-prone and potentially slow.
To accomplish this, we introduce a new Formula#pkg_version method that
concatenates the active_spec version with the formula revision. An
exception is made for a formula that has no revision: the tag is
omitted. This preserves compatibility with existing installations.