Fix "undefined method 'name' for an instance of FormulaInstaller"

- Because `name` is not a method on `FormulaInstaller`, instead
  `formula` shows the name.
- Fixes issue 20199.

Before:

```
$ brew install -n hello
Error: undefined method 'name' for an instance of FormulaInstaller
Warning: Removed Sorbet lines from backtrace!
Rerun with `--verbose` to see the original backtrace
/opt/homebrew/Library/Homebrew/install.rb:330:in 'Array#map'
/opt/homebrew/Library/Homebrew/install.rb:330:in 'Homebrew::Install.install_formulae'
```

After:

```
$ brew install -n hello
==> Would install 1 formula:
hello
```
This commit is contained in:
Issy Long 2025-07-01 22:22:43 +01:00
parent 8520539312
commit 5310c5e730
No known key found for this signature in database

View File

@ -327,7 +327,7 @@ module Homebrew
end
if dry_run
if (formulae_name_to_install = formula_installers.map(&:name))
if (formulae_name_to_install = formula_installers.map(&:formula))
ohai "Would install #{Utils.pluralize("formula", formulae_name_to_install.count,
plural: "e", include_count: true)}:"
puts formulae_name_to_install.join(" ")