Skip to content

Commit

Permalink
cargo-about: add 0.5.2 bottle.
Browse files Browse the repository at this point in the history
  • Loading branch information
gromgit committed Jan 31, 2023
1 parent c7c0f17 commit e8dbea8
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions Formula/cargo-about.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
class CargoAbout < Formula
desc "Cargo plugin to generate list of all licenses for a crate"
homepage "https://github.com/EmbarkStudios/cargo-about"
url "https://github.com/EmbarkStudios/cargo-about/archive/refs/tags/0.5.2.tar.gz"
sha256 "7e37c2d47273dfedbace33d34f768690a9a5ef7e04a347dd1a3f5b0a979ee50a"
license any_of: ["Apache-2.0", "MIT"]
head "https://github.com/EmbarkStudios/cargo-about.git", branch: "main"

bottle do
root_url "https://github.com/gromgit/homebrew-core-mojave/releases/download/cargo-about"
sha256 cellar: :any_skip_relocation, mojave: "9ab71e238dc7978c2dee4263358cc7b968362af39b61f47303b5b58809995d12"
end

depends_on "rust" # uses `cargo` at runtime

def install
system "cargo", "install", *std_cargo_args
end

test do
crate = testpath/"demo-crate"
mkdir crate do
(crate/"src/main.rs").write <<~EOS
#[cfg(test)]
mod tests {
#[test]
fn test_it() {
assert_eq!(1 + 1, 2);
}
}
EOS
(crate/"Cargo.toml").write <<~EOS
[package]
name = "demo-crate"
version = "0.1.0"
license = "MIT"
EOS

system bin/"cargo-about", "init"
assert_predicate crate/"about.hbs", :exist?

expected = <<~EOS
accepted = [
"Apache-2.0",
"MIT",
]
EOS
assert_equal expected, (crate/"about.toml").read

output = shell_output("cargo about generate about.hbs")
assert_match "The above copyright notice and this permission notice", output
end
end
end

0 comments on commit e8dbea8

Please sign in to comment.