From 05a84c5a3f6106daa358c79d0e80d139ab3fe901 Mon Sep 17 00:00:00 2001
From: Markus Reiter <me@reitermark.us>
Date: Sat, 19 Sep 2020 02:03:49 +0200
Subject: [PATCH] Explicitly specify `block` argument for `each` methods.

---
 Library/Homebrew/cask/cask.rb | 4 ++--
 Library/Homebrew/formula.rb   | 4 ++--
 Library/Homebrew/tap.rb       | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Library/Homebrew/cask/cask.rb b/Library/Homebrew/cask/cask.rb
index c04105c18a..54a43bf425 100644
--- a/Library/Homebrew/cask/cask.rb
+++ b/Library/Homebrew/cask/cask.rb
@@ -18,11 +18,11 @@ module Cask
 
     attr_reader :token, :sourcefile_path, :config
 
-    def self.each
+    def self.each(&block)
       return to_enum unless block_given?
 
       Tap.flat_map(&:cask_files).each do |f|
-        yield CaskLoader::FromTapPathLoader.new(f).load
+        block.call CaskLoader::FromTapPathLoader.new(f).load
       rescue CaskUnreadableError => e
         opoo e.message
       end
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index e89ed81e6d..3551fc1b8b 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -1459,9 +1459,9 @@ class Formula
   end
 
   # @private
-  def self.each
+  def self.each(&block)
     files.each do |file|
-      yield Formulary.factory(file)
+      block.call Formulary.factory(file)
     rescue FormulaUnavailableError, FormulaUnreadableError => e
       # Don't let one broken formula break commands. But do complain.
       onoe "Failed to import: #{file}"
diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb
index 663fc28b9c..d6cc29ceb6 100644
--- a/Library/Homebrew/tap.rb
+++ b/Library/Homebrew/tap.rb
@@ -552,14 +552,14 @@ class Tap
     self.class == other.class && name == other.name
   end
 
-  def self.each
+  def self.each(&block)
     return unless TAP_DIRECTORY.directory?
 
     return to_enum unless block_given?
 
     TAP_DIRECTORY.subdirs.each do |user|
       user.subdirs.each do |repo|
-        yield fetch(user.basename.to_s, repo.basename.to_s)
+        block.call fetch(user.basename.to_s, repo.basename.to_s)
       end
     end
   end
-- 
GitLab