Livecheck: Pass regex into strategy blocks
This commit is contained in:
parent
361743e1fb
commit
fef4512b35
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user