Livecheck: Pass regex into strategy blocks

This commit is contained in:
Sam Ford 2020-12-24 00:34:40 -05:00
parent 361743e1fb
commit fef4512b35
No known key found for this signature in database
GPG Key ID: 95209E46C7FFDEFE
3 changed files with 3 additions and 3 deletions

View File

@ -87,7 +87,7 @@ module Homebrew
tags_only_debian = tags_data[:tags].all? { |tag| tag.start_with?("debian/") }
if block
case (value = block.call(tags_data[:tags]))
case (value = block.call(tags_data[:tags], regex))
when String
match_data[:matches][value] = Version.new(value)
when Array

View File

@ -45,7 +45,7 @@ module Homebrew
merged_headers = headers.reduce(&:merge)
if block
match = block.call(merged_headers)
match = block.call(merged_headers, regex)
else
match = nil

View File

@ -49,7 +49,7 @@ module Homebrew
# @return [Array]
def self.page_matches(content, regex, &block)
if block
case (value = block.call(content))
case (value = block.call(content, regex))
when String
return [value]
when Array