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:
parent
263f486806
commit
a2fb2b00fd
@ -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
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user