2009-10-15 08:07:12 +00:00
|
|
|
require 'formula'
|
2009-06-18 07:15:07 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Unrar < Formula
|
2010-02-20 09:44:24 +00:00
|
|
|
homepage 'http://www.rarlab.com'
|
2014-03-19 15:45:20 +00:00
|
|
|
url 'http://www.rarlab.com/rar/unrarsrc-5.1.1.tar.gz'
|
|
|
|
sha1 '7d1a8691336208d1d9b85812ba7d5336d2986376'
|
2013-08-14 01:27:18 +00:00
|
|
|
|
2009-06-18 07:15:07 +00:00
|
|
|
def install
|
2013-09-05 05:30:31 +00:00
|
|
|
system "make"
|
2009-06-18 07:15:07 +00:00
|
|
|
bin.install 'unrar'
|
|
|
|
end
|
2014-03-19 15:45:20 +00:00
|
|
|
|
|
|
|
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
|
2010-02-20 09:44:24 +00:00
|
|
|
end
|