aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Howell2009-08-08 14:24:26 +0100
committerMax Howell2009-08-10 18:11:23 +0100
commitf0f391dcb82b35c195c74e77c45bbe0a0cb5271e (patch)
treefae3db2b289c00d9b340acf5738e5a5835cc2bcb
parent2dbe54c2dfa137aa0f0a15b82c70586abf99ddc1 (diff)
downloadhomebrew-f0f391dcb82b35c195c74e77c45bbe0a0cb5271e.tar.bz2
Support github tagged download versions
eg. http://github.com/lloyd/yajl/tarball/1.0.5
-rw-r--r--Library/Homebrew/pathname+yeast.rb5
-rwxr-xr-xLibrary/Homebrew/unittest.rb5
2 files changed, 10 insertions, 0 deletions
diff --git a/Library/Homebrew/pathname+yeast.rb b/Library/Homebrew/pathname+yeast.rb
index 43c07c5ab..9d515fb81 100644
--- a/Library/Homebrew/pathname+yeast.rb
+++ b/Library/Homebrew/pathname+yeast.rb
@@ -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
diff --git a/Library/Homebrew/unittest.rb b/Library/Homebrew/unittest.rb
index d4339ebad..bdf383533 100755
--- a/Library/Homebrew/unittest.rb
+++ b/Library/Homebrew/unittest.rb
@@ -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