This updates logic to add a `#scheme_and_version` method to be used
with `.sort_by` and `.max_by`. Using `Keg#version` by itself can be
inaccurate when different version schemes are present. This also
updates the behavior of `Formula#eligible_kegs_for_cleanup` to match
the previous behavior. We were dropping the wrong keg based on the
sort being reversed in a previous PR.
* tap: take ownership of synced_versions_formulae.json
* formula: add synced_with_other_formulae? logic
Signed-off-by: Michael Cho <michael@michaelcho.dev>
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