diff --git a/Library/Homebrew/cmd/readall.rb b/Library/Homebrew/cmd/readall.rb index e20db93e36..530c41e3ee 100644 --- a/Library/Homebrew/cmd/readall.rb +++ b/Library/Homebrew/cmd/readall.rb @@ -57,7 +57,7 @@ module Homebrew raise UsageError, "`brew readall` needs a tap or `--eval-all` passed or `HOMEBREW_EVAL_ALL` set!" end - Tap.select(&:installed?) + Tap.installed else args.named.to_installed_taps end diff --git a/Library/Homebrew/cmd/tap.rb b/Library/Homebrew/cmd/tap.rb index f3f751ead3..1275b1a188 100644 --- a/Library/Homebrew/cmd/tap.rb +++ b/Library/Homebrew/cmd/tap.rb @@ -55,12 +55,12 @@ module Homebrew args = tap_args.parse if args.repair? - Tap.select(&:installed?).each do |tap| + Tap.installed.each do |tap| tap.link_completions_and_manpages tap.fix_remote_configuration end elsif args.no_named? - puts Tap.select(&:installed?) + puts Tap.installed.sort_by(&:name) else tap = Tap.fetch(args.named.first) begin diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb index ad2bf864ab..0c455f3e4b 100644 --- a/Library/Homebrew/cmd/update-report.rb +++ b/Library/Homebrew/cmd/update-report.rb @@ -146,7 +146,7 @@ module Homebrew hub = ReporterHub.new updated_taps = [] - Tap.select(&:installed?).each do |tap| + Tap.installed.each do |tap| next if !tap.git? || tap.git_repo.origin_url.nil? next if (tap.core_tap? || tap.core_cask_tap?) && !Homebrew::EnvConfig.no_install_from_api? @@ -254,7 +254,7 @@ module Homebrew Commands.rebuild_commands_completion_list link_completions_manpages_and_docs - Tap.select(&:installed?).each(&:link_completions_and_manpages) + Tap.installed.each(&:link_completions_and_manpages) failed_fetch_dirs = ENV["HOMEBREW_MISSING_REMOTE_REF_DIRS"]&.split("\n") if failed_fetch_dirs.present? diff --git a/Library/Homebrew/completions.rb b/Library/Homebrew/completions.rb index 4e60b8209a..60d50f1555 100644 --- a/Library/Homebrew/completions.rb +++ b/Library/Homebrew/completions.rb @@ -72,7 +72,7 @@ module Homebrew sig { void } def self.link! Settings.write :linkcompletions, true - Tap.select(&:installed?).each do |tap| + Tap.installed.each do |tap| Utils::Link.link_completions tap.path, "brew completions link" end end @@ -80,7 +80,7 @@ module Homebrew sig { void } def self.unlink! Settings.write :linkcompletions, false - Tap.select(&:installed?).each do |tap| + Tap.installed.each do |tap| next if tap.official? Utils::Link.unlink_completions tap.path @@ -94,7 +94,7 @@ module Homebrew sig { returns(T::Boolean) } def self.completions_to_link? - Tap.select(&:installed?).each do |tap| + Tap.installed.each do |tap| next if tap.official? SHELLS.each do |shell| diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 321b26f1d7..9c065dd43d 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -189,7 +189,7 @@ module Homebrew # Run tap audits first named_arg_taps = [*audit_formulae, *audit_casks].map(&:tap).uniq if !args.tap && !no_named_args - tap_problems = Tap.select(&:installed?).each_with_object({}) do |tap, problems| + tap_problems = Tap.installed.each_with_object({}) do |tap, problems| next if args.tap && tap != args.tap next if named_arg_taps&.exclude?(tap) diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index aea24c3b95..652f517bdf 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -545,7 +545,7 @@ module Homebrew return if ENV["CI"] return unless Utils::Git.available? - commands = Tap.select(&:installed?).filter_map do |tap| + commands = Tap.installed.filter_map do |tap| next if tap.git_repo.default_origin_branch? "git -C $(brew --repo #{tap.name}) checkout #{tap.git_repo.origin_branch_name}" @@ -794,7 +794,7 @@ module Homebrew def check_for_tap_ruby_files_locations bad_tap_files = {} - Tap.select(&:installed?).each do |tap| + Tap.installed.each do |tap| unused_formula_dirs = tap.potential_formula_dirs - [tap.formula_dir] unused_formula_dirs.each do |dir| next unless dir.exist?