-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathscala-cli.rb
33 lines (30 loc) · 1.19 KB
/
scala-cli.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# typed: false
# frozen_string_literal: true
# ScalaCli Formula
class ScalaCli < Formula
desc "Launcher for ScalaCli"
homepage "https://virtuslab.github.io/scala-cli/"
url (RUBY_PLATFORM.include? "arm64") ?
"https://github.com/Virtuslab/scala-cli/releases/download/v1.5.4/scala-cli-aarch64-apple-darwin.gz" :
"https://github.com/Virtuslab/scala-cli/releases/download/v1.5.4/scala-cli-x86_64-apple-darwin.gz"
version "1.5.4"
sha256 (RUBY_PLATFORM.include? "arm64") ?
"0e768d68178d6c20797f6ba5f58c89e460989855fae7cf23d3851321e245cfa3" :
"94bc9f39686bc467d4a77a6ec20d350ace292087c30b3f871b1bd0fccb672d87"
license "Apache-2.0"
def install
if (RUBY_PLATFORM.include? "arm64")
bin.install "scala-cli-aarch64-apple-darwin" => "scala-cli"
else
bin.install "scala-cli-x86_64-apple-darwin" => "scala-cli"
end
end
test do
(testpath / "Hello.scala").write "object Hello {
def main(args: Array[String]): Unit =
println(\"Hello from Scala\")
}"
output = shell_output("#{bin}/scala-cli Hello.scala")
assert_equal ["Hello from Scala\n"], output.lines
end
end