Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor method to remove extra tap requires #18010

Commits on Aug 10, 2024

  1. Refactor method to remove extra tap requires

    We were selectively requiring the tap.rb file in a few places for
    performance reasons. The main method we were referencing was the
    `Tap.cmd_directories` method which uses `Pathname` and the `TAP_DIRECTORY`
    constant internally. `Tap.cmd_directories` is mostly used in the `Commands`
    module and that is loaded very early on in the program so it made sense
    to move that command to that module. To facilitate that I moved the
    `TAP_DIRECTORY` constant to the top-level and renamed it to
    `HOMEBREW_TAP_DIRECTORY`. It now lies in the tap_constants.rb file.
    
    A nice bonus of this refactor is that it speeds up loading external
    commands since the tap.rb file is no longer required by default in
    those cases.
    apainintheneck committed Aug 10, 2024
    Configuration menu
    Copy the full SHA
    a3e917a View commit details
    Browse the repository at this point in the history

Commits on Aug 11, 2024

  1. Address feedback

    - Move HOMEBREW_TAP_DIRECTORY to startup/config.rb because this file
    holds more of the directory constants
    - Rename `Commands.cmd_directories` to `Commands.tap_cmd_directories`
    to better express that the commands come from taps
    
    This file has the directory constants while the other one has regexes.
    Just better organization.
    apainintheneck committed Aug 11, 2024
    Configuration menu
    Copy the full SHA
    1fe16a5 View commit details
    Browse the repository at this point in the history