37 lines
1.2 KiB
Ruby
37 lines
1.2 KiB
Ruby
class HapiFhirCli < Formula
|
|
desc "Command-line interface for the HAPI FHIR library"
|
|
homepage "https://hapifhir.io/"
|
|
url "https://github.com/hapifhir/hapi-fhir/releases/download/v5.7.0/hapi-fhir-5.7.0-cli.zip"
|
|
sha256 "e651aed72056a31045fadbc1dcb4d9b2d125a71bff8a47820eff86531a6cb6bf"
|
|
license "Apache-2.0"
|
|
|
|
livecheck do
|
|
url :stable
|
|
strategy :github_latest
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any_skip_relocation, all: "e079b9ac0cd820d0ac61ce395c3afe3786bbba260c187eb956cc161df63771b3"
|
|
end
|
|
|
|
depends_on "openjdk"
|
|
|
|
resource "homebrew-test_resource" do
|
|
url "https://github.com/hapifhir/hapi-fhir/raw/v5.4.0/hapi-fhir-structures-dstu3/src/test/resources/specimen-example.json"
|
|
sha256 "4eacf47eccec800ffd2ca23b704c70d71bc840aeb755912ffb8596562a0a0f5e"
|
|
end
|
|
|
|
def install
|
|
inreplace "hapi-fhir-cli", /SCRIPTDIR=(.*)/, "SCRIPTDIR=#{libexec}"
|
|
libexec.install "hapi-fhir-cli.jar"
|
|
bin.install "hapi-fhir-cli"
|
|
bin.env_script_all_files libexec/"bin", JAVA_HOME: Formula["openjdk"].opt_prefix
|
|
end
|
|
|
|
test do
|
|
testpath.install resource("homebrew-test_resource")
|
|
system bin/"hapi-fhir-cli", "validate", "--file", "specimen-example.json",
|
|
"--fhir-version", "dstu3"
|
|
end
|
|
end
|