GithubRelease: Simplify block handling

The `#versions_from_content` method requires a regex and this will be
enforced by the type signature, so we don't have to check for the
presence of a regex when handling a `strategy` block.
This commit is contained in:
Sam Ford 2023-05-16 00:34:32 -04:00
parent 263f486806
commit a2fb2b00fd
No known key found for this signature in database
GPG Key ID: 7AF5CBEE1DD6F76D

View File

@ -100,11 +100,7 @@ module Homebrew
}
def self.versions_from_content(content, regex, &block)
if block.present?
block_return_value = if regex.present?
yield(content, regex)
else
yield(content)
end
block_return_value = yield(content, regex)
return Strategy.handle_block_return(block_return_value)
end