aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMax Howell2009-08-08 14:24:26 +0100
committerMax Howell2009-08-10 18:11:23 +0100
commitdae260561e659e940c559196810d7af5d4b5f152 (patch)
treea3467a788d8d20ca497a9abe0089804e8515c0d4 /Library
parentf724f5ed52fa9576437e0495ba9ba84ade7e0aea (diff)
downloadbrew-dae260561e659e940c559196810d7af5d4b5f152.tar.bz2
Support github tagged download versions
eg. http://github.com/lloyd/yajl/tarball/1.0.5
Diffstat (limited to 'Library')
-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