-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Rui Chen <[email protected]>
- Loading branch information
1 parent
b383419
commit 8189009
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2593,6 +2593,7 @@ restic | |
restview | ||
resvg | ||
retire | ||
reveal-md | ||
revive | ||
rex | ||
rgbds | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
class RevealMd < Formula | ||
desc "Get beautiful reveal.js presentations from your Markdown files" | ||
homepage "https://github.com/webpro/reveal-md" | ||
url "https://registry.npmjs.org/reveal-md/-/reveal-md-6.1.4.tgz" | ||
sha256 "699d44c19f8437f294464ca457d35ad779e6f605299a38ea293b7aa75363d6f9" | ||
license "MIT" | ||
|
||
depends_on "node" | ||
|
||
def install | ||
system "npm", "install", *std_npm_args | ||
bin.install_symlink Dir["#{libexec}/bin/*"] | ||
|
||
# Remove incompatible pre-built `bare-fs`/`bare-os` binaries | ||
os = OS.kernel_name.downcase | ||
arch = Hardware::CPU.intel? ? "x64" : Hardware::CPU.arch.to_s | ||
node_modules = libexec/"lib/node_modules/reveal-md/node_modules" | ||
node_modules.glob("{bare-fs,bare-os}/prebuilds/*") | ||
.each { |dir| rm_r(dir) if dir.basename.to_s != "#{os}-#{arch}" } | ||
end | ||
|
||
test do | ||
(testpath/"test.md").write("# Hello, Reveal-md!") | ||
|
||
output_log = testpath/"output.log" | ||
pid = spawn bin/"reveal-md", testpath/"test.md", [:out, :err] => output_log.to_s | ||
sleep 8 | ||
sleep 8 if OS.mac? && Hardware::CPU.intel? | ||
assert_match "Serving reveal.js", output_log.read | ||
|
||
assert_match version.to_s, shell_output("#{bin}/reveal-md --version") | ||
ensure | ||
Process.kill("TERM", pid) | ||
Process.wait(pid) | ||
end | ||
end |