Merge pull request #198799 from Homebrew/bump-huly-0.6.411
[Homebrew/homebrew-cask.git] / Casks / n / ngrok.rb
blobca7ed97f95e62d776c0f8a8d28188c8a32efc7d9
1 cask "ngrok" do
2   arch arm: "arm64", intel: "amd64"
4   on_arm do
5     version "3.19.0,6eUJ9CKgUtA,a"
6     sha256 "cd8675fd3f89160b36c4fc1cf0e38dd7d294982235edceaa2ed203417a9cf9fc"
7   end
8   on_intel do
9     version "3.19.0,59HYdr4iC4K,a"
10     sha256 "12b3dfdbadbf7fc7ab026f6350b80f5e41458105fe8fbece37d2f0005494dcfe"
11   end
13   url "https://bin.equinox.io/#{version.csv.third}/#{version.csv.second}/ngrok-v#{version.major}-#{version.csv.first}-darwin-#{arch}.zip",
14       verified: "bin.equinox.io/"
15   name "ngrok"
16   desc "Reverse proxy, secure introspectable tunnels to localhost"
17   homepage "https://ngrok.com/"
19   livecheck do
20     url "https://dl.equinox.io/ngrok/ngrok-v#{version.major}/stable/archive"
21     regex(%r{href=.*?/([^/]+)/([^/]+)/ngrok[._-]v#{version.major}[._-]v?(\d+(?:\.\d+)+)[._-]darwin[._-]#{arch}\.zip}i)
22     strategy :page_match do |page, regex|
23       page.scan(regex).map { |match| "#{match[2]},#{match[1]},#{match[0]}" }
24     end
25   end
27   binary "ngrok"
29   postflight do
30     set_permissions "#{staged_path}/ngrok", "0755"
31   end
33   zap trash: [
34     "~/.ngrok#{version.major}",
35     "~/Library/Application Support/ngrok",
36   ]
38   caveats <<~EOS
39     To install shell completions, add this to your profile:
40       if command -v ngrok &>/dev/null; then
41         eval "$(ngrok completion)"
42       fi
43   EOS
44 end