32 lines
1.1 KiB
Ruby
32 lines
1.1 KiB
Ruby
cask "quaternion" do
|
|
version "0.0.95.1"
|
|
sha256 "d2f80cfd17ab25b4062032afa76aa7bf509d32fb72c91858ab04347e216df9a7"
|
|
|
|
url "https://github.com/quotient-im/Quaternion/releases/download/#{version}/quaternion-#{version}.dmg"
|
|
name "Quaternion"
|
|
desc "IM client for Matrix"
|
|
homepage "https://github.com/quotient-im/Quaternion"
|
|
|
|
livecheck do
|
|
url "https://github.com/quotient-im/Quaternion/releases/latest"
|
|
regex(/href=.*?quaternion[._-]v?(\d+(?:\.\d+)+)\.dmg/i)
|
|
strategy :header_match do |headers, regex|
|
|
next if headers["location"].blank?
|
|
|
|
# Identify the latest tag from the response's `location` header
|
|
latest_tag = File.basename(headers["location"])
|
|
next if latest_tag.blank?
|
|
|
|
# Fetch the assets list HTML for the latest tag and match within it
|
|
assets_page = Homebrew::Livecheck::Strategy.page_content(
|
|
@url.sub(%r{/releases/?.+}, "/releases/expanded_assets/#{latest_tag}"),
|
|
)
|
|
assets_page[:content]&.scan(regex)&.map { |match| match[0] }
|
|
end
|
|
end
|
|
|
|
depends_on macos: ">= :high_sierra"
|
|
|
|
app "quaternion.app"
|
|
end
|