2022-07-27 00:12:54 +00:00
|
|
|
class CargoDepgraph < Formula
|
|
|
|
desc "Creates dependency graphs for cargo projects"
|
|
|
|
homepage "https://sr.ht/~jplatte/cargo-depgraph/"
|
2022-09-22 13:43:29 +00:00
|
|
|
url "https://git.sr.ht/~jplatte/cargo-depgraph/archive/v1.3.0.tar.gz"
|
|
|
|
sha256 "63e447c1040c642258b94915b209e57380802a59d10ebd8ddc98c0650391d661"
|
2022-07-27 00:12:54 +00:00
|
|
|
license "GPL-3.0-or-later"
|
|
|
|
|
|
|
|
livecheck do
|
|
|
|
url :stable
|
|
|
|
regex(/^v?(\d+(?:\.\d+)+)$/i)
|
|
|
|
end
|
|
|
|
|
2022-07-28 12:35:56 +00:00
|
|
|
bottle do
|
2022-10-22 19:41:13 +00:00
|
|
|
sha256 cellar: :any_skip_relocation, arm64_ventura: "33e209e756b59302bc36f92202ec077d812f9abdec5c610d9bfbd91b678cc387"
|
2022-09-23 08:06:18 +00:00
|
|
|
sha256 cellar: :any_skip_relocation, arm64_monterey: "ccfb5ab1e99e85d17858b691c665ba94f81758d5e9fa3cc3695b21e201091f02"
|
|
|
|
sha256 cellar: :any_skip_relocation, arm64_big_sur: "ee7f12184065ff5755a97ed5c1e453cf0c53838b1c443060bc37f331c3b81051"
|
|
|
|
sha256 cellar: :any_skip_relocation, monterey: "2230b3d2052e8b96b3d555173b35a3857b521f2427d25d732760aace182f78f8"
|
|
|
|
sha256 cellar: :any_skip_relocation, big_sur: "cffdec29ce038804a317feec80526f53b0fa5fc594b3cc3c3ece57762e033623"
|
|
|
|
sha256 cellar: :any_skip_relocation, catalina: "d05be720b3bd9af933abb84c78f8625fb4822e6428557e36a19a6a1861b3dbb6"
|
|
|
|
sha256 cellar: :any_skip_relocation, x86_64_linux: "3518a7af0012d9955fda4d3a7f79ffbbbb8a75a0f05c73962d3502551de6ddc6"
|
2022-07-28 12:35:56 +00:00
|
|
|
end
|
|
|
|
|
2022-07-27 00:12:54 +00:00
|
|
|
depends_on "rust" => [:build, :test]
|
|
|
|
|
|
|
|
def install
|
|
|
|
system "cargo", "install", *std_cargo_args
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
crate = testpath/"demo-crate"
|
|
|
|
mkdir crate do
|
|
|
|
(crate/"src/main.rs").write "// Dummy file"
|
|
|
|
(crate/"Cargo.toml").write <<~EOS
|
|
|
|
[package]
|
|
|
|
name = "demo-crate"
|
|
|
|
version = "0.1.0"
|
|
|
|
|
|
|
|
[dependencies]
|
|
|
|
rustc-std-workspace-core = "1.0.0" # explicitly empty crate for testing
|
|
|
|
EOS
|
|
|
|
expected = <<~EOS
|
|
|
|
digraph {
|
|
|
|
0 [ label = "demo-crate" shape = box]
|
|
|
|
1 [ label = "rustc-std-workspace-core" ]
|
|
|
|
0 -> 1 [ ]
|
|
|
|
}
|
|
|
|
|
|
|
|
EOS
|
|
|
|
output = shell_output("#{bin}/cargo-depgraph depgraph")
|
|
|
|
assert_equal expected, output
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|