Merge pull request #206954 from Homebrew/bump-gollama-1.28.13
[homebrew-core.git] / Formula / d / drake.rb
blobb72c0781470744d0bcecb266eb5b134e46b4d5f4
1 class Drake < Formula
2   desc "Data workflow tool meant to be 'make for data'"
3   homepage "https://github.com/Factual/drake"
4   url "https://github.com/Factual/drake/archive/refs/tags/1.0.3.tar.gz"
5   sha256 "49c22b84f4059c1af905f92e276ac8a7aa80a8c236aca4c06df9b6c676b2cff7"
6   license "EPL-1.0"
7   head "https://github.com/Factual/drake.git", branch: "develop"
9   bottle do
10     rebuild 1
11     sha256 cellar: :any_skip_relocation, all: "98db9a4ae8a9345944f0b5388a35036c9a2384137f7a7db044ebc59cb5ebc117"
12   end
14   # Last release on 2016-04-15
15   # No response to https://github.com/Factual/drake/issues/227 on project status
16   disable! date: "2024-10-11", because: :unmaintained
18   depends_on arch: :x86_64 # openjdk@8 is not supported on ARM
19   depends_on "openjdk@8"
21   resource "jar" do
22     url "https://github.com/Factual/drake/releases/download/1.0.3/drake.jar"
23     sha256 "c9c5b109a900b6f30257425feee7a4e05ef11cc34cf227b04207a2f8645316af"
24   end
26   def install
27     jar = "drake-#{version}-standalone.jar"
28     inreplace "bin/drake-pkg", "DRAKE_JAR", libexec/jar
30     libexec.install "bin/drake-pkg" => "drake"
31     chmod 0755, libexec/"drake"
32     env = Language::Java.overridable_java_home_env("1.8")
33     env["PATH"] = "$JAVA_HOME/bin:$PATH"
34     (bin/"drake").write_env_script libexec/"drake", env
36     resource("jar").stage do
37       libexec.install "drake.jar" => jar
38     end
39   end
41   test do
42     # count lines test
43     (testpath/"Drakefile").write <<~EOS
44       find_lines <- [shell]
45         echo 'drake' > $OUTPUT
47       count_drakes_lines <- find_lines
48         cat $INPUT | wc -l > $OUTPUT
49     EOS
51     # force run (no user prompt) the full workflow
52     system bin/"drake", "--auto", "--workflow=#{testpath}/Drakefile", "+..."
53   end
54 end