Merge pull request #9478 from MikeMcQuaid/deprecate-disable-date
formula: deprecate!/disable!: deprecate missing or non-ISO 8601 dates.
This commit is contained in:
commit
4dfcf74fb2
@ -2764,6 +2764,7 @@ class Formula
|
||||
# <pre>deprecate! date: "2020-08-27", because: "has been replaced by foo"</pre>
|
||||
def deprecate!(date: nil, because: nil)
|
||||
odeprecated "`deprecate!` without a reason", "`deprecate! because: \"reason\"`" if because.blank?
|
||||
odeprecated "`deprecate!` without a date", "`deprecate! date: \"#{Date.today}\"`" if date.blank?
|
||||
|
||||
return if date.present? && Date.parse(date) > Date.today
|
||||
|
||||
@ -2790,6 +2791,7 @@ class Formula
|
||||
# <pre>disable! date: "2020-08-27", because: "has been replaced by foo"</pre>
|
||||
def disable!(date: nil, because: nil)
|
||||
odeprecated "`disable!` without a reason", "`disable! because: \"reason\"`" if because.blank?
|
||||
odeprecated "`disable!` without a date", "`disable! date: \"#{Date.today}\"`" if date.blank?
|
||||
|
||||
if date.present? && Date.parse(date) > Date.today
|
||||
@deprecation_reason = because if because.present?
|
||||
|
||||
@ -25,7 +25,7 @@ describe Homebrew::Livecheck do
|
||||
desc "Deprecated test formula"
|
||||
homepage "https://brew.sh"
|
||||
url "https://brew.sh/test-0.0.1.tgz"
|
||||
deprecate! because: :unmaintained
|
||||
deprecate! date: "2020-06-25", because: :unmaintained
|
||||
end
|
||||
end
|
||||
|
||||
@ -34,7 +34,7 @@ describe Homebrew::Livecheck do
|
||||
desc "Disabled test formula"
|
||||
homepage "https://brew.sh"
|
||||
url "https://brew.sh/test-0.0.1.tgz"
|
||||
disable! because: :unmaintained
|
||||
disable! date: "2020-06-25", because: :unmaintained
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user