- Sorbet gives preference to class methods over methods defined in
included modules, hence Sorbet was unavailable to resolve the
definition of the gsub! method.
- The gsub! method in StringInreplaceExtension conflicts with the definition in String.
- This PR refactors the call to the gsub! method so that a custom object
is exposed instead of a string.
- My refactoring of #7933 went wrong in that the tests passed for `brew
extract` and my manual testing, but both forgot about third-party taps
exist, so that functionality broke as follows (courtesy of Misty).
Before:
```
# Git.last_revision_commit_of_files("/usr/local/Homebrew", ["LICENSE.txt", "README.md"])
=> ["ac0665d", ["README.md"]]
```
After:
```
# Git.last_revision_commit_of_files("/usr/local/Homebrew", ["LICENSE.txt", "README.md"])
=> [nil, []]
```
- While we think about how to do splats in Sorbet, revert this so
that users are able to `brew extract` from third party taps again.
- A TODO for later in a separate PR is to write a test for `brew
extract` that tests the behaviour of third-party taps.
---
- Reverted this manually because the GitHub UI couldn't do it.
- Arguably I didn't need to remove the RBI file, but it's easier to have
everything gone for now and then revert this revert in future once we
have a strategy for dealing with splats in Sorbet than have
inconsistency.
Set utils/bottles.rb, utils/shell.rb and utils/svn.rb to true so that
type errors in these files may be reported by Sorbet
(cherry picked from commit fd3db131b0da78169fdff2031180a2bebe3cbb84)