homebrew-core/Formula/whistle.rb

30 lines
900 B
Ruby

require "language/node"
class Whistle < Formula
desc "HTTP, HTTP2, HTTPS, Websocket debugging proxy"
homepage "https://github.com/avwo/whistle"
url "https://registry.npmjs.org/whistle/-/whistle-2.9.28.tgz"
sha256 "f4b01d9ca295169e2d459c4159297085177343d7d5f86d135df53147cde04af1"
license "MIT"
bottle do
sha256 cellar: :any_skip_relocation, all: "5e11a769484428af9d55c6d2302e39d816c2700be1cc5b4798d72207063c4a50"
end
# `bin/proxy/mac/Whistle` was only built for `x86_64`
# upstream issue tracker, https://github.com/avwo/whistle/issues/734
depends_on arch: :x86_64
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/"package.json").write('{"name": "test"}')
system bin/"whistle", "start"
system bin/"whistle", "stop"
end
end