Support github tagged download versions
eg. http://github.com/lloyd/yajl/tarball/1.0.5
This commit is contained in:
parent
f724f5ed52
commit
dae260561e
@ -87,6 +87,11 @@ class Pathname
|
||||
end
|
||||
|
||||
def version
|
||||
# github tarballs are special
|
||||
# we only support numbered tagged downloads
|
||||
%r[github.com/.*/tarball/((\d\.)+\d)$].match to_s
|
||||
return $1 if $1
|
||||
|
||||
# eg. boost_1_39_0
|
||||
/((\d+_)+\d+)$/.match stem
|
||||
return $1.gsub('_', '.') if $1
|
||||
|
@ -151,6 +151,11 @@ class BeerTasting <Test::Unit::TestCase
|
||||
assert_equal '1.21', r.version
|
||||
end
|
||||
|
||||
def test_version_github
|
||||
r=MockFormula.new "http://github.com/lloyd/yajl/tarball/1.0.5"
|
||||
assert_equal '1.0.5', r.version
|
||||
end
|
||||
|
||||
def test_yet_another_version
|
||||
r=MockFormula.new "http://example.com/mad-0.15.1b.tar.gz"
|
||||
assert_equal '0.15.1b', r.version
|
||||
|
Loading…
x
Reference in New Issue
Block a user