Ruby 1.9 version style

This commit is contained in:
Max Howell 2009-08-30 15:49:38 +01:00
parent a1d31fabad
commit 11c67fe0b4
2 changed files with 7 additions and 1 deletions

View File

@ -104,7 +104,8 @@ class Pathname
return $1.gsub('_', '.') if $1 return $1.gsub('_', '.') if $1
# eg. foobar-4.5.1-1 # eg. foobar-4.5.1-1
/-((\d+\.)*\d+-\d+)$/.match stem # eg. ruby-1.9.1-p243
/-((\d+\.)*\d\.\d+-p?\d+)$/.match stem
return $1 if $1 return $1 if $1
# eg. foobar-4.5.1 # eg. foobar-4.5.1

View File

@ -318,4 +318,9 @@ class BeerTasting <Test::Unit::TestCase
d.mkpath d.mkpath
assert_equal '0.1.9', d.version assert_equal '0.1.9', d.version
end end
def test_ruby_version_style
f=MockFormula.new 'ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p243.tar.gz'
assert_equal '1.9.1-p243', f.version
end
end end