Rename FollowRedirection to HeaderMatch.
This commit is contained in:
parent
f76b5f105f
commit
cf40f7b8f6
@ -130,11 +130,11 @@ require_relative "strategy/github_latest"
|
|||||||
require_relative "strategy/gnome"
|
require_relative "strategy/gnome"
|
||||||
require_relative "strategy/gnu"
|
require_relative "strategy/gnu"
|
||||||
require_relative "strategy/hackage"
|
require_relative "strategy/hackage"
|
||||||
|
require_relative "strategy/header_match"
|
||||||
require_relative "strategy/launchpad"
|
require_relative "strategy/launchpad"
|
||||||
require_relative "strategy/npm"
|
require_relative "strategy/npm"
|
||||||
require_relative "strategy/page_match"
|
require_relative "strategy/page_match"
|
||||||
require_relative "strategy/pypi"
|
require_relative "strategy/pypi"
|
||||||
require_relative "strategy/follow_redirection"
|
|
||||||
require_relative "strategy/sourceforge"
|
require_relative "strategy/sourceforge"
|
||||||
require_relative "strategy/sparkle"
|
require_relative "strategy/sparkle"
|
||||||
require_relative "strategy/xorg"
|
require_relative "strategy/xorg"
|
||||||
|
|||||||
@ -6,22 +6,23 @@ require_relative "page_match"
|
|||||||
module Homebrew
|
module Homebrew
|
||||||
module Livecheck
|
module Livecheck
|
||||||
module Strategy
|
module Strategy
|
||||||
# The {FollowRedirection} strategy follows all URL redirections and scans
|
# The {HeaderMatch} strategy follows all URL redirections and scans
|
||||||
# the final URL for matching text using the provided regex.
|
# the resulting headers for matching text using the provided regex.
|
||||||
#
|
#
|
||||||
# @api private
|
# @api private
|
||||||
class FollowRedirection
|
class HeaderMatch
|
||||||
extend T::Sig
|
extend T::Sig
|
||||||
|
|
||||||
NICE_NAME = "Follow HTTP Redirection"
|
NICE_NAME = "Match HTTP Headers"
|
||||||
|
|
||||||
# We set the priority to zero since this cannot
|
# We set the priority to zero since this cannot
|
||||||
# be detected automatically.
|
# be detected automatically.
|
||||||
PRIORITY = 0
|
PRIORITY = 0
|
||||||
|
|
||||||
# Whether the strategy can be applied to the provided URL.
|
# Whether the strategy can be applied to the provided URL.
|
||||||
# FollowRedirection will technically match any HTTP URL but is
|
# The strategy will technically match any HTTP URL but is
|
||||||
# only usable with a `livecheck` block containing a regex.
|
# only usable with a `livecheck` block containing a regex
|
||||||
|
# or block.
|
||||||
sig { params(url: String).returns(T::Boolean) }
|
sig { params(url: String).returns(T::Boolean) }
|
||||||
def self.match?(url)
|
def self.match?(url)
|
||||||
url.match?(%r{^https?://})
|
url.match?(%r{^https?://})
|
||||||
Loading…
x
Reference in New Issue
Block a user