Merge pull request #16566 from dduugg/fix-update-sponsors
Add SystemCommand::Mixin to all commands using system_command
This commit is contained in:
commit
190563cf92
@ -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
|
||||
|
||||
@ -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"
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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!
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 = []
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user