From 9272579593e775a2fb23dabd8c73db85a7834261 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sat, 20 Oct 2018 12:34:13 +0100 Subject: [PATCH] compat/download_strategy: improve messaging. This should make it clearer how you can maintain this yourself (as well as being a better fit with `odeprecated`'s output). --- Library/Homebrew/compat/download_strategy.rb | 21 ++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Library/Homebrew/compat/download_strategy.rb b/Library/Homebrew/compat/download_strategy.rb index d4b476a260..efabd97c1b 100644 --- a/Library/Homebrew/compat/download_strategy.rb +++ b/Library/Homebrew/compat/download_strategy.rb @@ -10,7 +10,7 @@ require "download_strategy" class S3DownloadStrategy < CurlDownloadStrategy def initialize(url, name, version, **meta) odeprecated("S3DownloadStrategy", - "maintaining S3DownloadStrategy in your own formula or tap") + "a vendored S3DownloadStrategy in your own formula or tap (using require_relative)") super end @@ -52,7 +52,7 @@ class GitHubPrivateRepositoryDownloadStrategy < CurlDownloadStrategy def initialize(url, name, version, **meta) odeprecated("GitHubPrivateRepositoryDownloadStrategy", - "maintaining GitHubPrivateRepositoryDownloadStrategy in your own formula or tap") + "a vendored GitHubPrivateRepositoryDownloadStrategy in your own formula or tap (using require_relative)") super parse_url_pattern set_github_token @@ -106,7 +106,7 @@ end class GitHubPrivateRepositoryReleaseDownloadStrategy < GitHubPrivateRepositoryDownloadStrategy def initialize(url, name, version, **meta) odeprecated("GitHubPrivateRepositoryReleaseDownloadStrategy", - "maintaining GitHubPrivateRepositoryReleaseDownloadStrategy in your own formula or tap") + "a vendored GitHubPrivateRepositoryReleaseDownloadStrategy in your own formula or tap (using require_relative)") super end @@ -162,7 +162,7 @@ end class ScpDownloadStrategy < AbstractFileDownloadStrategy def initialize(url, name, version, **meta) odeprecated("ScpDownloadStrategy", - "maintaining ScpDownloadStrategy in your own formula or tap") + "a vendored ScpDownloadStrategy in your own formula or tap (using require_relative)") super parse_url_pattern end @@ -214,11 +214,11 @@ class DownloadStrategyDetector case url when %r{^s3://} odeprecated("s3://", - "maintaining S3DownloadStrategy in your own formula or tap") + "a vendored S3DownloadStrategy in your own formula or tap (using require_relative)") S3DownloadStrategy when %r{^scp://} odeprecated("scp://", - "maintaining ScpDownloadStrategy in your own formula or tap") + "a vendored ScpDownloadStrategy in your own formula or tap (using require_relative)") ScpDownloadStrategy else super(url) @@ -229,19 +229,20 @@ class DownloadStrategyDetector case symbol when :github_private_repo odeprecated(":github_private_repo", - "maintaining GitHubPrivateRepositoryDownloadStrategy in your own formula or tap") + "a vendored GitHubPrivateRepositoryDownloadStrategy in your own formula or tap (using require_relative)") GitHubPrivateRepositoryDownloadStrategy when :github_private_release odeprecated(":github_private_repo", - "maintaining GitHubPrivateRepositoryReleaseDownloadStrategy in your own formula or tap") + "a vendored GitHubPrivateRepositoryReleaseDownloadStrategy in your own formula or tap "\ + "(using require_relative)") GitHubPrivateRepositoryReleaseDownloadStrategy when :s3 odeprecated(":s3", - "maintaining S3DownloadStrategy in your own formula or tap") + "a vendored S3DownloadStrategy in your own formula or tap (using require_relative)") S3DownloadStrategy when :scp odeprecated(":scp", - "maintaining ScpDownloadStrategy in your own formula or tap") + "a vendored ScpDownloadStrategy in your own formula or tap (using require_relative)") ScpDownloadStrategy else super(symbol)