Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mermaid-cli 8.8.4 (new formula) #67804

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
42 changes: 42 additions & 0 deletions Formula/mermaid-cli.rb
@@ -0,0 +1,42 @@
require "language/node"

class MermaidCli < Formula
desc "Command-line interface (CLI) for mermaid"
homepage "https://github.com/mermaid-js/mermaid-cli"
url "https://registry.npmjs.org/@mermaid-js/mermaid-cli/-/mermaid-cli-8.8.4.tgz"
sha256 "d56089a4e82c0c2bba00397bd7ee73164338da32b8e1c381518242a00e29689b"
license "MIT"

depends_on "node"

def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]
end

test do
(testpath/"test.mmd").write <<~EOS
sequenceDiagram
participant Alice
participant Bob
Alice->>John: Hello John, how are you?
loop Healthcheck
John->>John: Fight against hypochondria
end
Note right of John: Rational thoughts <br/>prevail!
John-->>Alice: Great!
John->>Bob: How about you?
Bob-->>John: Jolly good!
EOS

(testpath/"puppeteer-config.json").write <<~EOS
{
"args": ["--no-sandbox"]
}
EOS

system bin/"mmdc", "-p", "puppeteer-config.json", "-i", "#{testpath}/test.mmd", "-o", "#{testpath}/out.svg"

assert_predicate testpath/"out.svg", :exist?
end
end