Skip to content
Snippets Groups Projects
Commit a26390be authored by Bob Lail's avatar Bob Lail
Browse files

Fix bug with printing pinned dependencies.

Brew prints this error:
```
Error: undefined method `join' for nil:NilClass
```

because, in this code:

```ruby
puts pinned_dependents.map do |f|
  "#{f.full_specified_name} #{f.pkg_version}"
end.join(", ")
```
the block is passed to `puts` and not to `map`. `.join(",")` is called on the output of `puts`.

(I think the regression was introduced in this commit: e12a7b08)
parent 97c575b6
No related branches found
No related tags found
No related merge requests found
......@@ -239,9 +239,9 @@ module Homebrew
if pinned_dependents.present?
plural = "dependent".pluralize(pinned_dependents.count)
ohai "Not upgrading #{pinned_dependents.count} pinned #{plural}:"
puts pinned_dependents.map do |f|
puts(pinned_dependents.map do |f|
"#{f.full_specified_name} #{f.pkg_version}"
end.join(", ")
end.join(", "))
end
# Print the upgradable dependents.
......@@ -292,9 +292,9 @@ module Homebrew
count = pinned_broken_dependents.count
plural = "dependent".pluralize(pinned_broken_dependents.count)
onoe "Not reinstalling #{count} broken and outdated, but pinned #{plural}:"
$stderr.puts pinned_broken_dependents.map do |f|
$stderr.puts(pinned_broken_dependents.map do |f|
"#{f.full_specified_name} #{f.pkg_version}"
end.join(", ")
end.join(", "))
end
# Print the broken dependents.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment