From e71d358224de569423e6b18c6a3d4bbfd86c0547 Mon Sep 17 00:00:00 2001 From: Alexander Ronald Altman Date: Fri, 31 Dec 2021 20:35:03 -0800 Subject: [PATCH] rune 0.10.3 (new formula) * rune 0.10.3 (new formula) * rune: cleaner install logic Closes #92342. Co-authored-by: Carlo Cabrera <30379873+carlocab@users.noreply.github.com> Signed-off-by: rui Signed-off-by: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> --- Formula/rune.rb | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Formula/rune.rb diff --git a/Formula/rune.rb b/Formula/rune.rb new file mode 100644 index 00000000000..597ef1a847e --- /dev/null +++ b/Formula/rune.rb @@ -0,0 +1,25 @@ +class Rune < Formula + desc "Embeddable dynamic programming language for Rust" + homepage "https://rune-rs.github.io" + url "https://github.com/rune-rs/rune/archive/refs/tags/0.10.3.tar.gz" + sha256 "6a7154191b9f279bad68ac474107d9a24ff8470d3aca243c9805c2ea90534dbb" + license any_of: ["Apache-2.0", "MIT"] + head "https://github.com/rune-rs/rune.git", branch: "main" + + depends_on "rust" => :build + + def install + system "cargo", "install", *std_cargo_args(path: "crates/rune-cli") + system "cargo", "install", *std_cargo_args(path: "crates/rune-languageserver") + end + + test do + (testpath/"hello.rn").write <<~EOS + pub fn main() { + println!("Hello, world!"); + } + EOS + assert_match(/Hello, world!\n== \(\) \([\d.]+[µm]?s\)/, + shell_output("#{bin/"rune"} run #{testpath/"hello.rn"}").strip) + end +end