diff --git a/Library/Homebrew/cmd/list.rb b/Library/Homebrew/cmd/list.rb index 819af57cef..4267c7a11c 100644 --- a/Library/Homebrew/cmd/list.rb +++ b/Library/Homebrew/cmd/list.rb @@ -5,12 +5,13 @@ require "metafiles" require "formula" require "cli/parser" require "cask/list" +require "system_command" module Homebrew - module_function + extend SystemCommand::Mixin sig { returns(CLI::Parser) } - def list_args + def self.list_args Homebrew::CLI::Parser.new do description <<~EOS List all installed formulae and casks. @@ -64,7 +65,7 @@ module Homebrew end end - def list + def self.list args = list_args.parse if args.full_name? @@ -121,7 +122,7 @@ module Homebrew end end - def filtered_list(args:) + def self.filtered_list(args:) names = if args.no_named? Formula.racks else @@ -150,7 +151,7 @@ module Homebrew end end - def list_casks(args:) + def self.list_casks(args:) casks = if args.no_named? Cask::Caskroom.casks else diff --git a/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb b/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb index 04bd56092e..f734db5840 100644 --- a/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb +++ b/Library/Homebrew/dev-cmd/bump-unversioned-casks.rb @@ -6,6 +6,7 @@ require "cask/download" require "cask/installer" require "cask/cask_loader" require "cli/parser" +require "system_command" require "tap" require "unversioned_cask_checker" diff --git a/Library/Homebrew/dev-cmd/generate-man-completions.rb b/Library/Homebrew/dev-cmd/generate-man-completions.rb index d449e7f77e..eb67c90158 100644 --- a/Library/Homebrew/dev-cmd/generate-man-completions.rb +++ b/Library/Homebrew/dev-cmd/generate-man-completions.rb @@ -4,12 +4,13 @@ require "formula" require "completions" require "manpages" +require "system_command" module Homebrew - module_function + extend SystemCommand::Mixin sig { returns(CLI::Parser) } - def generate_man_completions_args + def self.generate_man_completions_args Homebrew::CLI::Parser.new do description <<~EOS Generate Homebrew's manpages and shell completions. @@ -18,7 +19,7 @@ module Homebrew end end - def generate_man_completions + def self.generate_man_completions args = generate_man_completions_args.parse Commands.rebuild_internal_commands_completion_list diff --git a/Library/Homebrew/dev-cmd/update-license-data.rb b/Library/Homebrew/dev-cmd/update-license-data.rb index 9fdd06fa96..4bb5e89e8f 100644 --- a/Library/Homebrew/dev-cmd/update-license-data.rb +++ b/Library/Homebrew/dev-cmd/update-license-data.rb @@ -6,12 +6,10 @@ require "utils/spdx" require "system_command" module Homebrew - include SystemCommand::Mixin - - module_function + extend SystemCommand::Mixin sig { returns(CLI::Parser) } - def update_license_data_args + def self.update_license_data_args Homebrew::CLI::Parser.new do description <<~EOS Update SPDX license data in the Homebrew repository. @@ -20,7 +18,7 @@ module Homebrew end end - def update_license_data + def self.update_license_data update_license_data_args.parse SPDX.download_latest_license_data! diff --git a/Library/Homebrew/dev-cmd/update-maintainers.rb b/Library/Homebrew/dev-cmd/update-maintainers.rb index 8bdeb0fd46..557b02e580 100644 --- a/Library/Homebrew/dev-cmd/update-maintainers.rb +++ b/Library/Homebrew/dev-cmd/update-maintainers.rb @@ -4,12 +4,13 @@ require "cli/parser" require "utils/github" require "manpages" +require "system_command" module Homebrew - module_function + extend SystemCommand::Mixin sig { returns(CLI::Parser) } - def update_maintainers_args + def self.update_maintainers_args Homebrew::CLI::Parser.new do description <<~EOS Update the list of maintainers in the `Homebrew/brew` README. @@ -19,7 +20,7 @@ module Homebrew end end - def update_maintainers + def self.update_maintainers update_maintainers_args.parse # We assume that only public members wish to be included in the README diff --git a/Library/Homebrew/dev-cmd/update-sponsors.rb b/Library/Homebrew/dev-cmd/update-sponsors.rb index 52d491764d..2c4c20d23c 100644 --- a/Library/Homebrew/dev-cmd/update-sponsors.rb +++ b/Library/Homebrew/dev-cmd/update-sponsors.rb @@ -3,15 +3,16 @@ require "cli/parser" require "utils/github" +require "system_command" module Homebrew - module_function + extend SystemCommand::Mixin NAMED_MONTHLY_AMOUNT = 100 URL_MONTHLY_AMOUNT = 1000 sig { returns(CLI::Parser) } - def update_sponsors_args + def self.update_sponsors_args Homebrew::CLI::Parser.new do description <<~EOS Update the list of GitHub Sponsors in the `Homebrew/brew` README. @@ -21,19 +22,19 @@ module Homebrew end end - def sponsor_name(sponsor) + def self.sponsor_name(sponsor) sponsor[:name] || sponsor[:login] end - def sponsor_logo(sponsor) + def self.sponsor_logo(sponsor) "https://github.com/#{sponsor[:login]}.png?size=64" end - def sponsor_url(sponsor) + def self.sponsor_url(sponsor) "https://github.com/#{sponsor[:login]}" end - def update_sponsors + def self.update_sponsors update_sponsors_args.parse named_sponsors = []