homebrew-core/Formula/cfr-decompiler.rb
Alessandro Gatti bd9cc5eef5 cfr-decompiler 0.108
CFR 0.108

Closes Homebrew/homebrew#45791.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2015-11-08 11:51:12 +00:00

35 lines
880 B
Ruby

class CfrDecompiler < Formula
desc "Yet Another Java Decompiler."
homepage "http://www.benf.org/other/cfr/"
url "http://www.benf.org/other/cfr/cfr_0_108.jar"
sha256 "d1698d9d454f1963468d7cb0302e4ef5fddc5bd8af077024c64c13b8b7331c2c"
bottle :unneeded
depends_on :java => "1.6+"
def install
jar_version = version.to_s.tr(".", "_")
libexec.install "cfr_#{jar_version}.jar"
bin.write_jar_script libexec/"cfr_#{jar_version}.jar", "cfr-decompiler"
end
test do
fixture = <<-EOS.undent
import java.io.PrintStream;
class T {
T() {
}
public static void main(String[] arrstring) {
System.out.println("Hello brew!");
}
}
EOS
(testpath/"T.java").write fixture
system "javac", "T.java"
output = pipe_output("#{bin}/cfr-decompiler T.class")
assert_match fixture, output
end
end