|
| 1 | +class Codesnap < Formula |
| 2 | + desc "Generates code snapshots in various formats" |
| 3 | + homepage "https://github.com/mistricky/CodeSnap" |
| 4 | + url "https://github.com/mistricky/CodeSnap/archive/refs/tags/v0.8.3.tar.gz" |
| 5 | + sha256 "acb3e160039c9986f4566f3504df2c820558e62b7a412d4fd5030008f2c44f81" |
| 6 | + license "MIT" |
| 7 | + head "https://github.com/mistricky/CodeSnap.git", branch: "main" |
| 8 | + |
| 9 | + bottle do |
| 10 | + sha256 cellar: :any_skip_relocation, arm64_sequoia: "87e46adb2b04171b28b5dfc78ae05f78f148044de5dce1467d511153247d8cee" |
| 11 | + sha256 cellar: :any_skip_relocation, arm64_sonoma: "b33ed994518151e27221f8210aa7890f108e107d56956d362dd18626ab8689c4" |
| 12 | + sha256 cellar: :any_skip_relocation, arm64_ventura: "cc2e8dbe3ee5187e3fe56ce60b6a5160bbcb7764079e46cf1643aa7206471215" |
| 13 | + sha256 cellar: :any_skip_relocation, sonoma: "0137a524ad3dcaeb41279a7d8116dde25740eccf78a54b7bc71e42ef31f01c51" |
| 14 | + sha256 cellar: :any_skip_relocation, ventura: "12e63b80ef9724e9cde857eea9a2d671a3540ee4339d6881e94afe5b5dcbf12a" |
| 15 | + sha256 cellar: :any_skip_relocation, x86_64_linux: "14f94426bba298fd9f0e9cce02ee56c3cf5a271182328cb73f68403d6c93588b" |
| 16 | + end |
| 17 | + |
| 18 | + depends_on "rust" => :build |
| 19 | + |
| 20 | + def install |
| 21 | + system "cargo", "install", *std_cargo_args(path: "cli") |
| 22 | + |
| 23 | + pkgshare.install "examples" |
| 24 | + end |
| 25 | + |
| 26 | + test do |
| 27 | + assert_match version.to_s, shell_output("#{bin}/codesnap --version") |
| 28 | + |
| 29 | + # Fails in Linux CI with "no default font found" |
| 30 | + return if OS.linux? && ENV["HOMEBREW_GITHUB_ACTIONS"] |
| 31 | + |
| 32 | + assert_match "SUCCESS", shell_output("#{bin}/codesnap -f #{pkgshare}/examples/cli.sh -o cli.png") |
| 33 | + end |
| 34 | +end |
0 commit comments