mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Refactor condition.
This commit is contained in:
parent
77e3a405f5
commit
4a1643e7ad
@ -396,7 +396,7 @@ module Cask
|
|||||||
sig { void }
|
sig { void }
|
||||||
def audit_token
|
def audit_token
|
||||||
token_auditor = Homebrew::FormulaNameCaskTokenAuditor.new(cask.token)
|
token_auditor = Homebrew::FormulaNameCaskTokenAuditor.new(cask.token)
|
||||||
return if (errors = token_auditor.errors).empty?
|
return if (errors = token_auditor.errors).none?
|
||||||
|
|
||||||
add_error "Cask token '#{cask.token}' must not contain #{errors.to_sentence(two_words_connector: " or ",
|
add_error "Cask token '#{cask.token}' must not contain #{errors.to_sentence(two_words_connector: " or ",
|
||||||
last_word_connector: " or ")}."
|
last_word_connector: " or ")}."
|
||||||
|
@ -165,7 +165,7 @@ module Homebrew
|
|||||||
name = formula.name
|
name = formula.name
|
||||||
|
|
||||||
name_auditor = Homebrew::FormulaNameCaskTokenAuditor.new(name)
|
name_auditor = Homebrew::FormulaNameCaskTokenAuditor.new(name)
|
||||||
unless (errors = name_auditor.errors).empty?
|
if (errors = name_auditor.errors).any?
|
||||||
problem "Formula name '#{name}' must not contain #{errors.to_sentence(two_words_connector: " or ",
|
problem "Formula name '#{name}' must not contain #{errors.to_sentence(two_words_connector: " or ",
|
||||||
last_word_connector: " or ")}."
|
last_word_connector: " or ")}."
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user