30 lines
909 B
Ruby
30 lines
909 B
Ruby
class Jflex < Formula
|
|
desc "Lexical analyzer generator for Java, written in Java"
|
|
homepage "https://jflex.de/"
|
|
url "https://jflex.de/release/jflex-1.8.2.tar.gz"
|
|
sha256 "a1e0d25e341d01de6b93ec32b45562905e69d06598113934b74f76b1be7927ab"
|
|
revision 1
|
|
|
|
livecheck do
|
|
url "https://jflex.de/download.html"
|
|
regex(/href=.*?jflex[._-]v?(\d+(?:\.\d+)+)\.t/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, all: "911e2fbccdc612cc006a804bc73d5b204f84393936660eb374a36ea3765a1ae5"
|
|
end
|
|
|
|
depends_on "openjdk"
|
|
|
|
def install
|
|
pkgshare.install "examples"
|
|
libexec.install "lib/jflex-full-#{version}.jar" => "jflex-#{version}.jar"
|
|
bin.write_jar_script libexec/"jflex-#{version}.jar", "jflex"
|
|
end
|
|
|
|
test do
|
|
system bin/"jflex", "-d", testpath, pkgshare/"examples/cup-java/src/main/jflex/java.flex"
|
|
assert_match "public static void", (testpath/"Scanner.java").read
|
|
end
|
|
end
|