version: correctly parse codeload URLs
Needed for Homebrew/homebrew#49346. Closes Homebrew/homebrew#49354. Signed-off-by: Alex Dunn <dunn.alex@gmail.com>
This commit is contained in:
parent
b54d477416
commit
f15532452e
@ -189,6 +189,10 @@ class VersionParsingTests < Homebrew::TestCase
|
|||||||
assert_version_detected "1.1.4", "https://github.com/sam-github/libnet/tarball/libnet-1.1.4"
|
assert_version_detected "1.1.4", "https://github.com/sam-github/libnet/tarball/libnet-1.1.4"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_codeload_style
|
||||||
|
assert_version_detected "0.7.1", "https://codeload.github.com/gsamokovarov/jump/tar.gz/v0.7.1"
|
||||||
|
end
|
||||||
|
|
||||||
def test_gloox_beta_style
|
def test_gloox_beta_style
|
||||||
assert_version_detected "1.0-beta7", "http://camaya.net/download/gloox-1.0-beta7.tar.bz2"
|
assert_version_detected "1.0-beta7", "http://camaya.net/download/gloox-1.0-beta7.tar.bz2"
|
||||||
end
|
end
|
||||||
|
@ -307,8 +307,10 @@ class Version
|
|||||||
m = /[-_]((?:\d+\.)*\d\.\d+-(?:p|rc|RC)?\d+)(?:[-._](?:bin|dist|stable|src|sources))?$/.match(stem)
|
m = /[-_]((?:\d+\.)*\d\.\d+-(?:p|rc|RC)?\d+)(?:[-._](?:bin|dist|stable|src|sources))?$/.match(stem)
|
||||||
return m.captures.first unless m.nil?
|
return m.captures.first unless m.nil?
|
||||||
|
|
||||||
# URL with no extension e.g. https://waf.io/waf-1.8.12
|
# URL with no extension
|
||||||
m = /-((?:\d+\.)*\d+)$/.match(spec_s)
|
# e.g. https://waf.io/waf-1.8.12
|
||||||
|
# e.g. https://codeload.github.com/gsamokovarov/jump/tar.gz/v0.7.1
|
||||||
|
m = /[-v]((?:\d+\.)*\d+)$/.match(spec_s)
|
||||||
return m.captures.first unless m.nil?
|
return m.captures.first unless m.nil?
|
||||||
|
|
||||||
# e.g. lame-398-1
|
# e.g. lame-398-1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user