Skip to content

Commit

Permalink
Merge pull request #9478 from MikeMcQuaid/deprecate-disable-date
Browse files Browse the repository at this point in the history
formula: deprecate!/disable!: deprecate missing or non-ISO 8601 dates.
  • Loading branch information
MikeMcQuaid authored Dec 18, 2020
2 parents 010ae37 + f87ce3f commit 4dfcf74
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Library/Homebrew/formula.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2764,6 +2764,7 @@ def pour_bottle?(&block)
# <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

Expand All @@ -2790,6 +2791,7 @@ def deprecated?
# <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?
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/test/livecheck/livecheck_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
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

Expand All @@ -34,7 +34,7 @@
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

Expand Down

0 comments on commit 4dfcf74

Please sign in to comment.