aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorAdam Vandenberg2009-09-23 07:56:07 -0700
committerMax Howell2009-09-25 18:57:44 +0100
commita3668bef76d66cd3295280b771d2ff2ffac0b58d (patch)
tree4b52af1be1ca5eb9c32ea6a883d4b2d4f040ea7e /Library
parent235987b03240e018fc063596757f8a357c843c7d (diff)
downloadbrew-a3668bef76d66cd3295280b771d2ff2ffac0b58d.tar.bz2
Find version number in *-src.tarball
Signed-Off-By: Max Howell <max@methylblue.com> I added a unittest.
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/pathname+yeast.rb6
-rwxr-xr-xLibrary/Homebrew/unittest.rb6
2 files changed, 9 insertions, 3 deletions
diff --git a/Library/Homebrew/pathname+yeast.rb b/Library/Homebrew/pathname+yeast.rb
index 5bed99231..7feb83709 100644
--- a/Library/Homebrew/pathname+yeast.rb
+++ b/Library/Homebrew/pathname+yeast.rb
@@ -140,11 +140,11 @@ class Pathname
# eg. foobar4.5.1
/((\d+\.)*\d+)$/.match stem
return $1 if $1
-
+
# eg foobar-4.5.0-bin
- /-((\d+\.)*\d+-bin)$/.match stem
+ /-((\d+\.)+\d+)-(bin|src)$/.match stem
return $1 if $1
-
+
# eg. otp_src_R13B (this is erlang's style)
# eg. astyle_1.23_macosx.tar.gz
stem.scan /_([^_]+)/ do |match|
diff --git a/Library/Homebrew/unittest.rb b/Library/Homebrew/unittest.rb
index 6b24d3095..d594a9af5 100755
--- a/Library/Homebrew/unittest.rb
+++ b/Library/Homebrew/unittest.rb
@@ -21,6 +21,7 @@ HOMEBREW_PREFIX=Pathname.new '/private/tmp/testbrew/prefix'
HOMEBREW_CACHE=HOMEBREW_PREFIX.parent+"cache"
HOMEBREW_CELLAR=HOMEBREW_PREFIX.parent+"cellar"
HOMEBREW_USER_AGENT="Homebrew"
+MACOS_VERSION=10.6
(HOMEBREW_PREFIX+'Library'+'Formula').mkpath
Dir.chdir HOMEBREW_PREFIX
@@ -507,6 +508,11 @@ class BeerTasting <Test::Unit::TestCase
assert_raises(RuntimeError) {Pathname.getwd.install 'non_existant_file'}
end
+ def test_omega_version_style
+ f=MockFormula.new 'http://www.alcyone.com/binaries/omega/omega-0.80.2-src.tar.gz'
+ assert_equal '0.80.2', f.version
+ end
+
def test_formula_class_func
assert_equal Formula.class_s('s-lang'), 'SLang'
assert_equal Formula.class_s('pkg-config'), 'PkgConfig'