homebrew-core/Formula/vnu.rb

37 lines
871 B
Ruby

class Vnu < Formula
desc "Nu Markup Checker: command-line and server HTML validator"
homepage "https://validator.github.io/validator/"
url "https://github.com/validator/validator/releases/download/20.6.30/vnu.jar_20.6.30.zip"
sha256 "f6dc1464229756f582bdd6c083df11ec13e0d7389dd50b56e63133aa8b0dd200"
license "MIT"
version_scheme 1
livecheck do
url "https://github.com/validator/validator/releases/latest"
regex(%r{href=.*?/tag/v?(\d+(?:\.\d+)+)["' >]}i)
end
bottle :unneeded
depends_on "openjdk"
def install
libexec.install "vnu.jar"
bin.write_jar_script libexec/"vnu.jar", "vnu"
end
test do
(testpath/"index.html").write <<~EOS
<!DOCTYPE html>
<html>
<head>
<title>hi</title>
</head>
<body>
</body>
</html>
EOS
system bin/"vnu", testpath/"index.html"
end
end