brew icon indicating copy to clipboard operation
brew copied to clipboard

Remove most global "monkey-patches"

Open MikeMcQuaid opened this issue 1 year ago • 2 comments

Verification

  • [X] This issue's title and/or description do not reference a single formula e.g. brew install wget. If they do, open an issue at https://github.com/Homebrew/homebrew-core/issues/new/choose instead.

Provide a detailed description of the proposed feature

We should clean up extend/ to remove most monkey-patches (i.e. overriding/adding existing functionality) from core Ruby classes like e.g. String, Pathname, etc.

The exceptions should be:

  • those that mirror ActiveSupport e.g. present?, blank?, etc.
  • those that are extremely widely used (such as the above)

For monkey-patches used in formulae and/or casks: we should instead have modules included in e.g. Formula/Cask or refinements on e.g. Pathname so that they can be used as custom DSLs when possible rather than globally overriding methods.

What is the motivation for the feature?

  • More vanilla Ruby usage.
  • More clarify about when we're overriding functionality.

How will the feature be relevant to at least 90% of Homebrew users?

It won't be.

What alternatives to the feature have been considered?

Doing nothing.

MikeMcQuaid avatar Jun 11 '24 13:06 MikeMcQuaid