未验证 提交 c49ef80d 编辑于 作者: Mike McQuaid's avatar Mike McQuaid 提交者: GitHub
浏览文件

Merge pull request #8270 from SeekingMeaning/version/more-suffixes

version: detect versions with final/full suffix
......@@ -671,6 +671,27 @@ describe Version do
.to be_detected_from("https://ftpmirror.gnu.org/libidn/libidn-1.29-win64.zip")
end
specify "breseq version style" do
expect(described_class.create("0.35.1"))
.to be_detected_from(
"https://github.com/barricklab/breseq" \
"/releases/download/v0.35.1/breseq-0.35.1.Source.tar.gz",
)
end
specify "wildfly version style" do
expect(described_class.create("20.0.1"))
.to be_detected_from("https://download.jboss.org/wildfly/20.0.1.Final/wildfly-20.0.1.Final.tar.gz")
end
specify "trinity version style" do
expect(described_class.create("2.10.0"))
.to be_detected_from(
"https://github.com/trinityrnaseq/trinityrnaseq" \
"/releases/download/v2.10.0/trinityrnaseq-v2.10.0.FULL.tar.gz",
)
end
specify "with arch" do
expect(described_class.create("4.0.18-1"))
.to be_detected_from("https://ftpmirror.gnu.org/mtools/mtools-4.0.18-1.i686.rpm")
......
......@@ -301,7 +301,7 @@ class Version
# e.g. foobar-4.5.1-1
# e.g. unrtf_0.20.4-1
# e.g. ruby-1.9.1-p243
m = /[-_]((?:\d+\.)*\d+\.\d+-(?:p|rc|RC)?\d+)(?:[-._](?:bin|dist|stable|src|sources))?$/.match(stem)
m = /[-_]((?:\d+\.)*\d+\.\d+-(?:p|rc|RC)?\d+)(?:[-._](?i:bin|dist|stable|src|sources?|final|full))?$/.match(stem)
return m.captures.first unless m.nil?
# URL with no extension
......@@ -359,7 +359,7 @@ class Version
return m.captures.first unless m.nil?
# e.g. foobar-4.5.0-bin
m = /-((?:\d+\.)+\d+[abc]?)[-._](?:bin|dist|stable|src|sources?)$/.match(stem)
m = /[-vV]((?:\d+\.)+\d+[abc]?)[-._](?i:bin|dist|stable|src|sources?|final|full)$/.match(stem)
return m.captures.first unless m.nil?
# dash version style
......
支持 Markdown
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册