File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -320,6 +320,7 @@ blueutil
320320bluez
321321bmake
322322bnd
323+ boa
323324bob
324325bochs
325326bold
Original file line number Diff line number Diff line change 1+ class Boa < Formula
2+ desc "Embeddable and experimental Javascript engine written in Rust"
3+ homepage "https://github.com/boa-dev/boa"
4+ url "https://github.com/boa-dev/boa/archive/refs/tags/v0.20.tar.gz"
5+ sha256 "10cc1e8c8f62b6fb0b22ec2ddc7031715f99bd8bed6168b14c93a89cb8dab597"
6+ license any_of : [ "MIT" , "Unlicense" ]
7+ head "https://github.com/boa-dev/boa.git" , branch : "main"
8+
9+ depends_on "rust" => :build
10+
11+ def install
12+ system "cargo" , "install" , *std_cargo_args ( path : "cli" )
13+ end
14+
15+ test do
16+ assert_match version . to_s , shell_output ( "#{ bin } /boa --version" )
17+
18+ ( testpath /"test.js" ) . write <<~JS
19+ function factorial(n) {
20+ return n <= 1 ? 1 : n * factorial(n - 1);
21+ }
22+ console.log(`Factorial of 5 is: ${factorial(5)}`);
23+ JS
24+
25+ output = shell_output ( "#{ bin } /boa #{ testpath } /test.js" )
26+ assert_match "Factorial of 5 is: 120" , output
27+ end
28+ end
You can’t perform that action at this time.
0 commit comments