homebrew-core/Formula/pandocomatic.rb

39 lines
1.2 KiB
Ruby

class Pandocomatic < Formula
desc "Automate the use of pandoc"
homepage "https://heerdebeer.org/Software/markdown/pandocomatic/"
url "https://github.com/htdebeer/pandocomatic/archive/0.2.8.tar.gz"
sha256 "72ae22c76695174728e02d49ee7eb0a35a708cd328ed4f4c670be78719aca363"
license "GPL-3.0-or-later"
bottle do
rebuild 1
sha256 cellar: :any_skip_relocation, all: "1b44f290cd904b2100f258a322e255c9699bcd63e61c275a4203f93ab07f198b"
end
depends_on "pandoc"
depends_on "ruby"
def install
ENV["GEM_HOME"] = libexec
system "gem", "build", "#{name}.gemspec"
system "gem", "install", "#{name}-#{version}.gem"
bin.install libexec/"bin/#{name}"
bin.env_script_all_files(libexec/"bin", GEM_HOME: ENV["GEM_HOME"])
end
test do
(testpath/"test.md").write <<~EOS
# Homebrew
A package manager for humans. Cats should take a look at Tigerbrew.
EOS
expected_html = <<~EOS
<h1 id="homebrew">Homebrew</h1>
<p>A package manager for humans. Cats should take a look at
Tigerbrew.</p>
EOS
system "#{bin}/pandocomatic", "-i", "test.md", "-o", "test.html"
assert_equal expected_html, (testpath/"test.html").read
end
end