diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 8a940af0a7..0a4264c7e5 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -134,8 +134,8 @@ class Pathname /-((\d+\.)*\d+([abc]|rc|RC)\d*)$/.match stem return $1 if $1 - # eg foobar-4.5.0-beta1 - /-((\d+\.)*\d+-beta\d+)$/.match stem + # eg foobar-4.5.0-beta1, or foobar-4.50-beta + /-((\d+\.)*\d+-beta(\d+)?)$/.match stem return $1 if $1 # eg. foobar4.5.1 diff --git a/Library/Homebrew/test/test_versions.rb b/Library/Homebrew/test/test_versions.rb index c726d2596c..8010cf1c5d 100644 --- a/Library/Homebrew/test/test_versions.rb +++ b/Library/Homebrew/test/test_versions.rb @@ -65,6 +65,10 @@ class VersionTests < Test::Unit::TestCase check "http://camaya.net/download/gloox-1.0-beta7.tar.bz2", '1.0-beta7' end + def test_sphinx_beta_style + check 'http://sphinxsearch.com/downloads/sphinx-1.10-beta.tar.gz', '1.10-beta' + end + def test_astyle_verson_style check "http://kent.dl.sourceforge.net/sourceforge/astyle/astyle_1.23_macosx.tar.gz", '1.23'