Merge pull request #12911 from Homebrew/deprecate_formula_each

formula, cask: deprecate use of Enumerable methods e.g. `each`.
This commit is contained in:
Mike McQuaid 2022-02-24 08:44:03 +00:00 committed by GitHub
commit 2aecc2a604
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -6,8 +6,8 @@ module Cask
extend Enumerable
def self.each(&block)
# TODO: 3.4.0: odeprecated "`Enumerable` methods on `Cask::Cask`",
# "`Cask::Cask.all` (but avoid looping over all casks, it's slow and insecure)"
odeprecated "`Enumerable` methods on `Cask::Cask`",
"`Cask::Cask.all` (but avoid looping over all casks, it's slow and insecure)"
return to_enum unless block

View File

@ -5,8 +5,8 @@ class Formula
extend Enumerable
def self.each(&_block)
# TODO: 3.4.0: odeprecated "`Enumerable` methods on `Formula`",
# "`Formula.all` (but avoid looping over all formulae, it's slow and insecure)"
odeprecated "`Enumerable` methods on `Formula`",
"`Formula.all` (but avoid looping over all formulae, it's slow and insecure)"
files.each do |file|
yield Formulary.factory(file)