unrar 5.1.1

Closes Homebrew/homebrew#27696.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
Steffen Matthischke 2014-03-19 16:45:20 +01:00 committed by Mike McQuaid
parent df8495c7f0
commit e4d1499239

View file

@ -2,11 +2,25 @@ require 'formula'
class Unrar < Formula
homepage 'http://www.rarlab.com'
url 'http://www.rarlab.com/rar/unrarsrc-5.0.14.tar.gz'
sha1 'f6826b330668698fca227b3331e2bab564932d7e'
url 'http://www.rarlab.com/rar/unrarsrc-5.1.1.tar.gz'
sha1 '7d1a8691336208d1d9b85812ba7d5336d2986376'
def install
system "make"
bin.install 'unrar'
end
test do
contentpath = "directory/file.txt"
rarpath = testpath/"archive.rar"
data = 'UmFyIRoHAM+QcwAADQAAAAAAAACaCHQggDIACQAAAAkAAAADtPej1LZwZE' +
'QUMBIApIEAAGRpcmVjdG9yeVxmaWxlLnR4dEhvbWVicmV3CsQ9ewBABwA='
rarpath.write data.unpack('m')
assert_equal contentpath, `#{bin}/unrar lb #{rarpath}`.strip
assert_equal 0, $?.exitstatus
system "#{bin}/unrar", "x", rarpath, testpath
assert_equal "Homebrew\n", (testpath/contentpath).read
end
end