This is a little code refactoring splited from Homebrew/homebrew#36753
The idea is to eliminate `Formula#path` outside of `formulary.rb`.
And I indent to deprecate `Formula#path` method when I reimplement
symlink free tap function.
ClosesHomebrew/homebrew#39313.
Solely because I think `ENV.deparallelize` is *way* clearer than
`ENV.j1`, at least to the uninitiated.
Also, updating the template will reduce the number of `ENV.j1`s that
persist because the Homebrew maintainers want clean histories of
formulae. Ideally, this change should prevent any more cases from being
introduced!
ClosesHomebrew/homebrew#25431.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Since 9f2782812cbaf2, specifying a version breaks with:
Error: undefined method `detected_from_url?' for "1.2.2":String
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
The form "attr :name, true" is deprecated and causes Ruby to emit a
warning in verbose mode. Using attr_{reader,writer,accessor} is more
clear anyway, so do so.
Tools like `brew create` need to create and manipulate SoftwareSpec
objects. It is useful to be able to do this directly, rather than by
proxy through the special methods that serve the main formula DSL.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Now that a URL, version, and the (for lack of a better term) "specs"
associated with said URL (e.g. the VCS revision, or a download strategy
hint) are neatly bundled up in a SoftwareSpec object, it doesn't make
sense to pass them individually to download strategy constructors. These
constructors now take only the formula name and a SoftwareSpec as
parameters.
This allows us to move mirror handling out out of Formula#fetch and into
the download strategies themselves. While doing so, we adjust the mirror
implementation a bit; mirrors now assume the same "specs" as their
owner's URL. They are still only useable by the CurlDownloadStrategy,
but this provides a basis for extending mirror support to other
strategies.
Signed-off-by: Jack Nagel <jacknagel@gmail.com>