Skip to content

Commit

Permalink
[Library/Homebrew/cli/named_args.rb] to_formulae_to_casks(): Reasso…
Browse files Browse the repository at this point in the history
…ciate its

`rescue` block with the right enclosing scope.

     PR #9398 accidentally removed some semantically significant indentation in
this function, thus inadvertently kicking the `rescue` block inside out to func-
tion scope, when it moved its code further up in the file.  This may well not
confuse a Ruby interpreter, but it could trip human readers up.  Compensate and
correct the overlooked offending oversight and potential refactoring mistake by
restoring only that indentation, leaving the function in its new location.

Refs #9398.
  • Loading branch information
Bryce Glover committed Dec 5, 2020
1 parent f901b57 commit c237223
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Library/Homebrew/cli/named_args.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ def to_formulae_and_casks(only: nil, ignore_unavailable: nil, method: nil)
@to_formulae_and_casks ||= {}
@to_formulae_and_casks[only] ||= downcased_unique_named.flat_map do |name|
load_formula_or_cask(name, only: only, method: method)
rescue NoSuchKegError, FormulaUnavailableError, Cask::CaskUnavailableError
ignore_unavailable ? [] : raise
rescue NoSuchKegError, FormulaUnavailableError, Cask::CaskUnavailableError
ignore_unavailable ? [] : raise
end.uniq.freeze
end

Expand Down

0 comments on commit c237223

Please sign in to comment.