Skip to content

Commit

Permalink
mermaid-cli 8.8.4 (new formula)
Browse files Browse the repository at this point in the history
* mermaid-cli 8.8.4 (new formula)
* mermaid-cli 8.8.4 (new formula)
  mermaid-cli 8.8.4 (new formula)

  Add bin to test

Closes #67804.

Co-authored-by: Dawid Dziurla <dawidd0811@gmail.com>
Co-authored-by: Bastian Zimmermann <10774221+BastianZim@users.noreply.github.com>
Signed-off-by: chenrui <rui@chenrui.dev>
  • Loading branch information
2 people authored and chenrui333 committed Dec 30, 2020
1 parent 9a6ff75 commit 0606ddc
Showing 1 changed file with 42 additions and 0 deletions.
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

0 comments on commit 0606ddc

Please sign in to comment.