mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
dev-cmd/sponsors: tweak code.
- add named constants - change an unless to if
This commit is contained in:
parent
431e448c9e
commit
a85ad91b43
@ -9,6 +9,9 @@ module Homebrew
|
||||
|
||||
module_function
|
||||
|
||||
NAMED_TIER_AMOUNT = 100
|
||||
URL_TIER_AMOUNT = 1000
|
||||
|
||||
sig { returns(CLI::Parser) }
|
||||
def sponsors_args
|
||||
Homebrew::CLI::Parser.new do
|
||||
@ -39,13 +42,13 @@ module Homebrew
|
||||
logo_sponsors = []
|
||||
|
||||
GitHub.sponsors_by_tier("Homebrew").each do |tier|
|
||||
if tier["tier"] >= 100
|
||||
if tier["tier"] >= NAMED_TIER_AMOUNT
|
||||
named_sponsors += tier["sponsors"].map do |s|
|
||||
"[#{sponsor_name(s)}](#{sponsor_url(s)})"
|
||||
end
|
||||
end
|
||||
|
||||
next unless tier["tier"] >= 1000
|
||||
next if tier["tier"] < URL_TIER_AMOUNT
|
||||
|
||||
logo_sponsors += tier["sponsors"].map do |s|
|
||||
"[})](#{sponsor_url(s)})"
|
||||
|
Loading…
x
Reference in New Issue
Block a user