Skip to content

Commit 4d1dca0

Browse files
committed
statesmith 0.17.5 (new formula)
1 parent 5749d1b commit 4d1dca0

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

Formula/s/statesmith.rb

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
class Statesmith < Formula
2+
desc "State machine code generation tool suitable for bare metal, embedded and more"
3+
homepage "https://github.com/StateSmith/StateSmith"
4+
url "https://github.com/StateSmith/StateSmith/archive/refs/tags/cli-v0.17.5.tar.gz"
5+
sha256 "185fc6c05c8c950153bb871ffdad6de47ebf2db18c4607cd4005662d5d9f79b6"
6+
license "Apache-2.0"
7+
8+
depends_on "dotnet"
9+
depends_on "icu4c@77"
10+
uses_from_macos "zlib"
11+
12+
def install
13+
dotnet = Formula["dotnet"]
14+
args = %W[
15+
-c Release
16+
--framework net#{dotnet.version.major_minor}
17+
-p:Version=#{version}
18+
]
19+
20+
system "dotnet", "publish", "src/StateSmith.Cli", *args
21+
(bin/"ss.cli").write_env_script libexec/"StateSmith.Cli", DOTNET_ROOT: "${DOTNET_ROOT:-#{dotnet.opt_libexec}}"
22+
end
23+
24+
test do
25+
if OS.mac?
26+
# We have to do a different test on mac due to https://github.com/orgs/Homebrew/discussions/5966
27+
# Confirming that it fails as expected per the formula cookbook
28+
output = pipe_output("#{bin}/ss.cli --version 2>&1")
29+
assert_match "UnauthorizedAccessException", output
30+
else
31+
assert_match version.to_s, shell_output("#{bin}/ss.cli --version")
32+
33+
File.write("lightbulb.puml", <<~HERE)
34+
@startuml lightbulb
35+
[*] -> Off
36+
Off -> On : Switch
37+
On -> Off : Switch
38+
@enduml
39+
HERE
40+
41+
shell_output("#{bin}/ss.cli run --lang=JavaScript --no-ask --no-csx -h -b")
42+
assert_match version.to_s, File.read(testpath/"lightbulb.js")
43+
end
44+
end
45+
end

0 commit comments

Comments
 (0)