|
| 1 | +class Yek < Formula |
| 2 | + desc "Fast Rust based tool to serialize text-based files for LLM consumption" |
| 3 | + homepage "https://github.com/bodo-run/yek" |
| 4 | + url "https://github.com/bodo-run/yek/archive/refs/tags/v0.21.0.tar.gz" |
| 5 | + sha256 "2c0e863e0f49f690977910498a1b8dd151c625bf04b88a7d6ff20553590b6ccf" |
| 6 | + license "MIT" |
| 7 | + head "https://github.com/bodo-run/yek.git", branch: "main" |
| 8 | + |
| 9 | + livecheck do |
| 10 | + url :stable |
| 11 | + regex(/^v?(\d+(?:\.\d+)+)$/i) |
| 12 | + end |
| 13 | + |
| 14 | + bottle do |
| 15 | + sha256 cellar: :any, arm64_sequoia: "2d5276241deded5acf624a31b29ac860986c82fa12d46e3bc0dd697b86316730" |
| 16 | + sha256 cellar: :any, arm64_sonoma: "e002487f80db2f64322b9110b33705159d36da98dba3916e832d88caf8143346" |
| 17 | + sha256 cellar: :any, arm64_ventura: "a44f0bd71899bbb2bd95d3c1cf07e72b4a511c861e7bef2a1883e572df2c0f32" |
| 18 | + sha256 cellar: :any, sonoma: "1627a4d75dd780a1ecf0c2f756327102ef247c30b612aa931e4067684c4a97af" |
| 19 | + sha256 cellar: :any, ventura: "1117b2d2b0d74e8c3dd4214e5dda6ced03090ccea62d54d214d376aca945fa96" |
| 20 | + sha256 cellar: :any_skip_relocation, x86_64_linux: "6a63bf23710982ff18db2e129a2001c7447007d24ca9b30be4a26de2c0b83f16" |
| 21 | + end |
| 22 | + |
| 23 | + depends_on "pkgconf" => :build |
| 24 | + depends_on "rust" => :build |
| 25 | + |
| 26 | + depends_on "openssl@3" |
| 27 | + uses_from_macos "zlib" |
| 28 | + |
| 29 | + def install |
| 30 | + ENV["OPENSSL_DIR"] = Formula["openssl@3"].opt_prefix |
| 31 | + ENV["OPENSSL_NO_VENDOR"] = "1" |
| 32 | + |
| 33 | + system "cargo", "install", *std_cargo_args |
| 34 | + end |
| 35 | + |
| 36 | + test do |
| 37 | + assert_match version.to_s, shell_output("#{bin}/yek --version") |
| 38 | + |
| 39 | + (testpath/"main.c").write <<~C |
| 40 | + #include <stdio.h> |
| 41 | + #include <stdlib.h> |
| 42 | +
|
| 43 | + int main(void) { |
| 44 | + printf("%s\n", "Hello, world!"); |
| 45 | + return EXIT_SUCCESS; |
| 46 | + } |
| 47 | + C |
| 48 | + expected_file = shell_output("#{bin}/yek --output-dir #{testpath}") |
| 49 | + assert_match ">>>> main.c", expected_file |
| 50 | + end |
| 51 | +end |
0 commit comments