homebrew-core/Formula/jsdoc3.rb

36 lines
998 B
Ruby

require "language/node"
class Jsdoc3 < Formula
desc "API documentation generator for JavaScript"
homepage "https://jsdoc.app/"
url "https://registry.npmjs.org/jsdoc/-/jsdoc-4.0.0.tgz"
sha256 "aee74ea546974b095d0c26b0b712955b03ece78e8f752d04a153dbe6ae72aa83"
license "Apache-2.0"
head "https://github.com/jsdoc3/jsdoc.git", branch: "main"
bottle do
sha256 cellar: :any_skip_relocation, all: "cded566302fc13f0332bf20a785d5ca5bbd4bf7a32cec9b78accede08ea05fd2"
end
depends_on "node"
def install
system "npm", "install", *Language::Node.std_npm_install_args(libexec)
bin.install_symlink Dir["#{libexec}/bin/*"]
end
test do
(testpath/"test.js").write <<~EOS
/**
* Represents a formula.
* @constructor
* @param {string} name - the name of the formula.
* @param {string} version - the version of the formula.
**/
function Formula(name, version) {}
EOS
system bin/"jsdoc", "--verbose", "test.js"
end
end