41 Commits

Author SHA1 Message Date
Rylan Polster
f7fa5937d8
Allow brew info --json=v2 without taps with JSON API 2023-02-12 12:03:40 +00:00
Mike McQuaid
1a0f62c5dc
Merge pull request #14522 from Rylan12/api-load-booleans
Properly load booleans from the API
2023-02-06 16:06:15 +01:00
Rylan Polster
48f4769155
Properly load booleans from the API 2023-02-06 15:07:28 +01:00
apainintheneck
36ca7c95e5 Adds logging to cask loader
- extend Context to get `debug?` method
- create FromDefaultTapPathLoader to handle
  expected loading option
- log cask loader used when --debug
2023-02-05 13:36:26 -08: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
5ab7f14d2b
Fix cask not found error when upgrading certain casks 2023-02-05 12:26:22 +01:00
Rylan Polster
a166be9541
Don't convert boolean and blank values to strings in cask artifacts API 2023-02-05 02:58:03 +01:00
Rylan Polster
af9ba41cb0
Merge pull request #14456 from Rylan12/api-language-support
Support `languages` when installing from the API
2023-02-03 05:23:55 -05:00
Mike McQuaid
9d6713d023
Merge branch 'master' into api-language-support 2023-02-03 08:36:23 +00:00
apainintheneck
15c1930804 Remove redundant FromAPILoader attempt
After 32a0877 this logic has been changed so it's now
always covered by `FromAPILoader.can_load?`.
2023-02-02 18:43:53 -08:00
apainintheneck
2d93cbe13f Handle merge conflict 2023-02-02 18:40:13 -08:00
apainintheneck
e0ad960025 Load cask from API with fullname
This allows homebrew/cask/caskname
to work with the FromAPILoader.

Also, creates new constant to hold the
regex to validate main tap casks.
2023-01-31 19:39:10 -08:00
Rylan Polster
32a0877cad
Remove CaskSource API 2023-01-28 02:15:00 -06:00
Rylan Polster
c1fdcbdd0e
Support languages when installing from the API 2023-01-28 01:42:19 -06:00
Mike McQuaid
fd18c7b0ac
Tweak cask-source API handling
- Use raw.githubusercontent.com to download cask source rather than
  formulae.brew.sh. This allows us to remove these files
- output the tap's current `HEAD` for both formulae and cask JSON
- use this `HEAD` for the cask-source API to get the exact file on
  raw.githubusercontent.com rather than just whatever is newest (which
  is what the previous API did)
- set the `Tap` correctly when creating a `Cask` from the API
- if the `formula.json` file exists: print its modified time include
  `brew config`
- memoize `tap.git_head` as we'll be calling it a lot in the same
  process with the same value
2023-01-26 17:36:40 +00:00
Mike McQuaid
ab1fbb7fa9
cask_loader: fixup artifacts/caveats from JSON API.
These are mapped to generic versions in `cask/cask.rb` so we need to map
them back for them to be correct.
2023-01-25 15:07:44 +00:00
Rylan Polster
4c8c547027
Add clarifying comment 2023-01-11 13:16:34 -05:00
Rylan Polster
6468897458
Fix depends_on arch: when loading casks from API 2023-01-10 12:35:39 -05:00
Rylan Polster
ec8adb617e
Use cask-source API when needed 2023-01-06 02:46:22 -05:00
Rylan Polster
ffc74a51fb
Load *flight blocks from API 2023-01-06 02:46:22 -05:00
Rylan Polster
374b61584b
Load casks from the JSON API with HOMEBREW_INSTALL_FROM_API 2023-01-06 02:46:21 -05:00
Mike McQuaid
37be5bea52
dev-cmd/edit: handle editing with install_from_api.
Before this change, this would fail every time, even when available on
disk (which was not the case for formulae).

With this change, it will attempt to find it from a tap on disk and only
fail if it cannot be found in any.
2023-01-04 13:51:21 +00:00
Ian Gregory
cdc707fa38 Cache compiled regexes
Improves performance of `brew info --json=v2 --eval-all` by about 15–20%
2022-10-27 02:06:22 -04:00
Rylan Polster
55da9f293d
Cleanup Cask::Caskroom::casks 2022-06-26 14:24:05 -04:00
Rylan Polster
b63474398e
Always prefer loading from API when HOMEBREW_INSTALL_FROM_API is set 2022-06-17 13:54:05 -04:00
Rylan Polster
1e536217b2
Streamline loading casks from API 2022-06-15 16:35:49 -04:00
Rylan Polster
ea2e40c69a
Add Cask::Cask#source to return cask's source code 2021-08-14 16:18:13 -04:00
nandahkrishna
585ec90878
cask_loader: do not auto-tap in FromTapLoader 2021-03-11 21:09:42 +05:30
EricFromCanada
6fc116318e fixes for grammar and wording 2021-01-26 16:19:47 -05:00
Markus Reiter
da9289eff0 Add more type signatures. 2020-11-13 12:26:36 +01:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
5f005f67cf Refactor global Cask::Config. 2020-10-01 00:57:10 +02:00
miccal
1710f0af26 cask/cask_loader: add cask/cache 2020-09-17 14:01:37 +08:00
Markus Reiter
5c47f531a0 Document CaskLoader. 2020-08-26 03:13:59 +02:00
Mike McQuaid
3a91c37e66
Fix RuboCop checks. 2020-08-19 17:12:32 +01:00
Mike McQuaid
5f07a1e9bf
cask_loader: fix URI detection.
Fixes #6678
2019-11-14 07:39:07 -08:00
Mike McQuaid
36dbad3922
Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid
d64429a736
rubocop: enable Style/IfUnlessModifier. 2019-02-21 12:55:49 +00:00
Markus Reiter
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Markus Reiter
a84a1c63db Rename Hbc module to Cask. 2018-09-06 09:30:52 +02:00
Mike McQuaid
90b3a13909
cask: move cask/lib/hbc/* to cask/*.
Fix the load path, requires and some filenames accordingly.
2018-09-04 09:56:57 +01:00