-
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.6.1/scala-cli-aarch64-apple-darwin.gz" :
"https://github.com/Virtuslab/scala-cli/releases/download/v1.6.1/scala-cli-x86_64-apple-darwin.gz"
version "1.6.1"
sha256 (RUBY_PLATFORM.include? "arm64") ?
"3f1cb0345abd6441f1acceb75f65f219173e2c28b6f4adea6929f095121a6d63" :
"269e93a02a4bee5a3caba4e754863a94e900b1c4015c95470a4dc8dd979d0f8a"
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