37 lines
1.2 KiB
Ruby
37 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
|
|
sha256 cellar: :any_skip_relocation, all: "1773c8a03cb393930e09490dd4d2897be016ab6c0d63a59628d2f0aaab73b2c8"
|
|
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
|