Bitbucket: Format regex like other strategies

This commit is contained in:
Sam Ford 2020-12-20 18:13:51 -05:00
parent 21b1888388
commit 466e55c6ab
No known key found for this signature in database
GPG Key ID: 95209E46C7FFDEFE

View File

@ -30,10 +30,10 @@ module Homebrew
class Bitbucket class Bitbucket
# The `Regexp` used to determine if the strategy applies to the URL. # The `Regexp` used to determine if the strategy applies to the URL.
URL_MATCH_REGEX = %r{ URL_MATCH_REGEX = %r{
^https?://bitbucket\.org/ ^https?://bitbucket\.org
(?<path>.+?)/ # The path leading up to the get or downloads part /(?<path>.+?) # The path leading up to the get or downloads part
(?<dl_type>get|downloads)/ # An indicator of the file download type /(?<dl_type>get|downloads) # An indicator of the file download type
(?<prefix>(?:[^/]+?[_-])?) # Filename text before the version /(?<prefix>(?:[^/]+?[_-])?) # Filename text before the version
v?\d+(?:\.\d+)+ # The numeric version v?\d+(?:\.\d+)+ # The numeric version
(?<suffix>[^/]+) # Filename text after the version (?<suffix>[^/]+) # Filename text after the version
}ix.freeze }ix.freeze