homebrew-core/Formula/jsdoc3.rb

36 lines
999 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-3.6.10.tgz"
sha256 "0032335768ebfb3c11b72814bb332d655da722c3cc634dc097fc498c592aa81c"
license "Apache-2.0"
head "https://github.com/jsdoc3/jsdoc.git", branch: "main"
bottle do
sha256 cellar: :any_skip_relocation, all: "b9cabf745546537eb4db50dd596d8df62e8f9159a05ccbad5b443a948801399e"
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