129 Commits

Author SHA1 Message Date
Eric Knibbe
e63b1f4da5
docs: monospace suggested values 2024-02-04 15:42:26 +01:00
Bo Anderson
1c3c64a743
api: use freeze option for JSON parsing 2024-01-09 19:07:36 +00:00
apainintheneck
984dcf8c11 API: Load casks/formula from JSON with missing keys
We'd like to reduce the size of the API JSON and to do that we are
going to remove unused and/or blank elements from the cask/formula
definition. This will reduce the amount of data that has to go
over the wire and make it easier to load this data into memory.
2024-01-01 19:10:48 -08:00
Douglas Eichelberger
ffd761d2e9 Create dedicated Attrable mixin for attr_ methods 2023-12-28 11:46:27 -08:00
apainintheneck
b79778229c Resolve Cask::Cask.all todo
Now it takes the :eval_all parameter that means we can remove
ARGV handling inside Cask::Cask.all.
2023-12-21 21:55:16 -08:00
apainintheneck
5a674c232f Fix Cask::Cask.all bug
We were only loading casks from files with this command which,
of course, didn't work for casks that can only be loaded from
the API (when the core cask tap is not tapped). This changes
things to align more with what we do for formulae.
2023-12-21 21:39:58 -08:00
Rylan Polster
036723a668
Add deprecate! and disable! methods to the Cask DSL 2023-12-16 20:01:46 -05:00
Mike McQuaid
79a6091d08
Cask#full_name: properly output Homebrew org names
This was not returning the full name correctly for e.g. anything in
Homebrew/homebrew-fonts.

While we're here, fix up a few other places where `tap.core_cask_tap?`
can be used more appropriately.
2023-12-13 13:17:12 +00:00
Bo Anderson
b42256d286
Deprecate, disable & delete code for Homebrew 4.2.0 2023-12-07 23:42:13 +00:00
Mike McQuaid
54012f14ce
cask: add installed_time to JSON output.
This is provided for formulae in `installed.time` and is useful to have
for casks as well as formulae so let's output it here too.
2023-11-03 11:37:01 +00:00
Mike McQuaid
7da934f7e2
Deprecate/disable/delete code.
The next release after this is merged will be 4.1.0.

Co-authored-by: Markus Reiter <me@reitermark.us>
2023-07-06 16:56:20 +01:00
hyuraku
de7152b7a3 rename Cask::outdated_versions 2023-06-19 22:09:01 +09:00
Markus Reiter
89292f47b5
Simplify Cask#inspect. 2023-05-15 10:17:17 +02:00
Markus Reiter
d2231086bd
Merge pull request #15420 from reitermarkus/simulate-system-with
Add `SimulateSystem::with`.
2023-05-14 21:41:20 +02:00
Markus Reiter
0d56b97b07
Add SimulateSystem::with. 2023-05-14 01:45:04 +02:00
Markus Reiter
a3231a03fa
Implement cask renames. 2023-05-12 21:17:30 +02:00
Markus Reiter
8274920217
Rename OS::Mac::Version to MacOSVersion. 2023-05-09 05:08:38 +02:00
Douglas Eichelberger
24cf6076e8 brew style --fix 2023-04-24 20:42:39 -07:00
apainintheneck
1322b9cb79 cask: remove os_versions
This was originally used by the API but was replaced months
ago by SimulateSystem. Essentially, it's only current use
was in the #to_h method but is not used internally at all
when creating cask instances from the API JSON.
2023-04-16 13:52:24 -07:00
Markus Reiter
844db75361
Add source paths to API. 2023-04-07 15:20:01 +02:00
Markus Reiter
5e52d415a9
Allow fetching for different arch. 2023-03-25 11:56:09 +01:00
apainintheneck
6ccf21c2c9 Merge branch 'master' into add-service-block-to-formula-api 2023-03-22 20:06:32 -07:00
apainintheneck
801ee5e474 Address feedback
- style nits
- better comments for tests that are not idempotent
- moved appdir placeholder constant to global.rb
2023-03-22 19:43:49 -07:00
apainintheneck
38146893c3 api_hashable: Make API path subs generic
This turns the ability to replace common paths with placeholders
into a mixin that can be used with both Casks and Formulae.

The idea here is to make formula hash generation more consistent.
2023-03-21 23:20:42 -07:00
apainintheneck
3aae28aa0d cask: remove old prefix placeholder
This was just a temporary workaround while we
waited for the API to regenerate the JSON content.
2023-03-18 16:42:44 -07:00
Douglas Eichelberger
e40d2b42c9
Update Library/Homebrew/cask/cask.rb
Co-authored-by: Markus Reiter <me@reitermark.us>
2023-03-13 09:10:36 -07:00
Douglas Eichelberger
0fe595f9c2 Elaborate on sorbet comments 2023-03-13 09:08:56 -07:00
Douglas Eichelberger
04fa6e24d7 Enable more typing 2023-03-13 09:08:56 -07:00
Douglas Eichelberger
1195772b02 Refactor Searchable into Homebrew::Search 2023-03-07 09:08:54 -08:00
apainintheneck
c19017c6bd Make Cask#to_h work without the API
Set metadata when we load casks from the source API.

Set `@tap_git_head` manually.

Also, allow `auto_update` to receive false.
This is only done for consistency.

Stop double printing the `kext` caveat.

Handle Array elements correctly when substituting
path elements in artifacts. This affected how the
Uninstall Signal keys were evaluated (they are
represented as arrays of arrays).
2023-02-28 19:36:20 -08:00
apainintheneck
39dd7e987d stop loading Cask#to_h from api 2023-02-28 18:00:38 -08:00
apainintheneck
fd62cdf636 cask: delay loading from source API
For casks with certain stanzas, *flight and language
stanzas in this case, we need to use the caskfile
to install them correctly. The JSON API is not an option.

This delays loading from the source API until just before
we try to install one of these casks. This reduces the
number of requests we make to the source API.
2023-02-25 20:54:37 -08:00
Bo Anderson
e86a8c2477
Move HOMEBREW_NO_INSTALL_FROM_API defaults to shell 2023-02-24 21:53:08 +00:00
Bo Anderson
c416e4bbee
cask: handle nil URLs 2023-02-24 18:04:18 +00:00
Bo Anderson
aebc125e9c
cask: support url specs in API 2023-02-24 13:56:46 +00:00
Bo Anderson
e663f532a6
Checksum Ruby source file downloads 2023-02-22 22:50:24 +00:00
Mike McQuaid
1d61b219db
cask/cask: fix non-absolute home error.
Needs a leading slash to avoid `File.expand.path` complaining about non-absolute home.
2023-02-14 17:22:18 +00:00
Mike McQuaid
237eec8ef8
Overhaul Formula/Cask JSON generation
- Use constants for placeholders
- Monkeypatch to set `HOMEBREW_PREFIX` consistently to placeholder
- Use environment variable to set `Dir.home` consistently to placeholder
- Use `appdir` short-circuit to set `Cask#appdir` consistently to placeholder
- Use `Cask.generating_hash!` to enable "generating mode" with these patches
- Fix `Formula#caveats` from JSON

Fixes #14505
Fixes #14595
2023-02-14 14:19:40 +00:00
apainintheneck
39c6f7d6fb Stop including *flight block source in cask API
Originally we were going to try and load the *flight blocks from the API
but we ended up going with downloading the caskfile for the subset of
casks that need this functionality for consisty's sake.

This reverts the following commits from most recent to oldest:
- ffc74a51fb32b66a4cd8bc41dbd076dd23d9100e
- e5616e94fe42505434c330be35eeafef2739944f
- d1490c3d5c087d00f2bca1787cce331202b195c5
- 7ca5a5d9a71a73f21bbb8555a38048f027bee89b
- 2d5d132713d0701d02d5ff33e9918812d13d2a83

It also changes how *flight blocks are handled in `.to_h`.
Essentially, when *flight blocks exist they are just included
as a hash of the artifact to nil to indicate that they exist.

More information isn't necessary since we don't evaluate
the current source code in the *flight artifacts that
we get from the API.
2023-02-13 21:22:18 -08:00
Mike McQuaid
2a417f1416
Merge pull request #14609 from Bo98/json-fix
Fix `brew info --json` regressions around install status
2023-02-13 15:02:26 +00:00
Bo Anderson
cc956d73aa
Fix brew info --json regressions around install status 2023-02-13 05:07:40 +00:00
Bo Anderson
526871896c
cask: replace Caskroom in API for relocated artifacts 2023-02-13 04:33:53 +00:00
Rylan Polster
f7fa5937d8
Allow brew info --json=v2 without taps with JSON API 2023-02-12 12:03:40 +00:00
Mike McQuaid
6b4363092d
Revert "Merge pull request #14548 from Homebrew/revert-14382-deprecate-disable-remove"
This reverts commit 932d2cf3b77c9439a57b6a43577fc8d3b6399a62, reversing
changes made to f4e60482791d2ff628efadfdbf0d14d9237d2d29.
2023-02-07 19:25:51 +01:00
Mike McQuaid
6882ac17e7
Revert "Add deprecations and disables" 2023-02-07 15:13:19 +01:00
Mike McQuaid
c1b96e7199
Merge pull request #14382 from MikeMcQuaid/deprecate-disable-remove
Add deprecations and disables
2023-02-05 17:56:58 +01:00
Rylan Polster
0229196ac5
Merge pull request #14503 from Rylan12/artifact-json-fix
Don't convert boolean and blank values to strings in cask artifacts API
2023-02-05 15:40:14 +01:00
Rylan Polster
7b550ad8c6
Improve style
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2023-02-05 13:06:05 +01:00
Rylan Polster
7dbc33a0df
Cleanup case handling
Co-authored-by: Kevin <apainintheneck@gmail.com>
2023-02-05 12:42:31 +01:00
Rylan Polster
5ab7f14d2b
Fix cask not found error when upgrading certain casks 2023-02-05 12:26:22 +01:00