PageMatch: Require provided_content to be a string

This commit is contained in:
Sam Ford 2020-12-24 21:49:30 -05:00
parent eedd108ace
commit 8b5e334be4
No known key found for this signature in database
GPG Key ID: 95209E46C7FFDEFE

View File

@ -88,7 +88,7 @@ module Homebrew
def self.find_versions(url, regex, provided_content = nil, &block) def self.find_versions(url, regex, provided_content = nil, &block)
match_data = { matches: {}, regex: regex, url: url } match_data = { matches: {}, regex: regex, url: url }
content = if provided_content.present? content = if provided_content.is_a?(String)
provided_content provided_content
else else
match_data.merge!(Strategy.page_content(url)) match_data.merge!(Strategy.page_content(url))