Now the output of commands like `brew info --json=` and
`brew generate-formula-api` should be the same as before along with
the additional files for the internal API. Before this commit the
hash key order had changed.
- move caveats serialization to a method
- remove unnecessary nesting where the hash would only have one key
Also, removed comment about checking disable and deprecation reasons.
This adds the code to generate the homebrew-core.json file which
represents the entire tap instead of just the previous array of
formula hashes. Any shared logic has been moved into the top-level
hash scope including aliases, renames, tap_git_head and tap_migrations.
I also added a check to skip adding the variations hash to the api
hash if it is empty.
Now we're down to 10MB from 24MB!!!
Note: This changes where the "head_dependencies" key in the hash
shows up but not the hash's contents.
"head_dependencies" now shows up directly after all of the other
dependency keys. Before it was always at the end of the hash after
variations.
This will be used internally to generate a slimmer api hash representation
of formulas that will require less space and be faster to load.
Changes:
- Added #to_api_hash
- Modified #to_hash_with_variations to work with both #to_hash and #to_api_hash
- Modified #bottle_hash to have compact representation for the api hash
- Added #urls_hash to share url hash generation logic between the hash methods
If an installed cask is invalid on attempting an untap: it will
prevent untapping that cask.
Fix this in two ways: one more specific to `untap` and one more
generally to other commands too:
- specific: only read the actual formulae/casks from the tap we're
untapping instead of all of those that are installed
- general: rescue more exceptions in `Cask::Caskroom.casks` (like we
already do for `Formula.installed`
- keep running the command against all os/arch combinations
as the default
- remove todos and deprecations related to changing the behavior
- create constants for os/arch combinations
There is a check for other versioned formula with the same name
in the file audit. This just memoizes all of the versioned
formulae in a tap during the first call and then uses that much
shorter list everytime it checks for things.
We're seeing type errors when building formulae that use something
like `xcodebuild ..., "-arch", Hardware::CPU.arch`, since `CPU.arch`
is a symbol. We've been addressing these issues by calling `#to_s` on
the value but there was some talk about simply expanding the type
signatures to accommodate anything that will be cast to a `String`.
There's maybe still an argument to be made for doing string conversion
in formulae but expanding the type signatures will resolve a number of
existing type errors if we simply want to rely on implicit type
casting.
Past that, this also updates the type signature for `BuildError` to
align with the `#system` signature changes, as we receive a type error
otherwise.