Skip to content

Commit

Permalink
reveal-md 6.1.4 (new formula)
Browse files Browse the repository at this point in the history
Signed-off-by: Rui Chen <[email protected]>
  • Loading branch information
chenrui333 committed Dec 15, 2024
1 parent b383419 commit 8189009
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/autobump.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2593,6 +2593,7 @@ restic
restview
resvg
retire
reveal-md
revive
rex
rgbds
Expand Down
36 changes: 36 additions & 0 deletions Formula/r/reveal-md.rb
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

0 comments on commit 8189009

Please sign in to comment.