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.39.tgz"
sha256 "da392833b3f3f286e8c2299e505408ec8223ffd133857ad902b901975d5d9951"
license "MIT"
bottle do
sha256 cellar: :any_skip_relocation, all: "de465ab1a5a8cdaf471e5126f3e59cc65daa769d21d879220a6f568da8a3616a"
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