18 lines
557 B
Ruby
18 lines
557 B
Ruby
|
class Mdbook < Formula
|
||
|
desc "Create modern online books from Markdown files"
|
||
|
homepage "https://rust-lang-nursery.github.io/mdBook"
|
||
|
url "https://github.com/rust-lang-nursery/mdBook/archive/v0.2.3.tar.gz"
|
||
|
sha256 "2e157d4f0437143caf65d9253f9084d8cc0fff7a9e42cff3641e8413e15688fa"
|
||
|
depends_on "rust" => :build
|
||
|
|
||
|
def install
|
||
|
system "cargo", "install", "--root", prefix, "--path", "."
|
||
|
end
|
||
|
|
||
|
test do
|
||
|
# simulate user input to mdbook init
|
||
|
system "sh", "-c", "printf \\n\\n | #{bin}/mdbook init"
|
||
|
system "#{bin}/mdbook", "build"
|
||
|
end
|
||
|
end
|