Skip to content

Commit

Permalink
Ruby 1.9 version style
Browse files Browse the repository at this point in the history
  • Loading branch information
mxcl committed Aug 30, 2009
1 parent 253aa3e commit dffcac8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Library/Homebrew/pathname+yeast.rb
Expand Up @@ -104,7 +104,8 @@ def version
return $1.gsub('_', '.') if $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

# eg. foobar-4.5.1
Expand Down
5 changes: 5 additions & 0 deletions Library/Homebrew/unittest.rb
Expand Up @@ -318,4 +318,9 @@ def test_version_dir
d.mkpath
assert_equal '0.1.9', d.version
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

0 comments on commit dffcac8

Please sign in to comment.