s/stoplight-studio: update livecheck
This commit is contained in:
parent
9d51520816
commit
c6c036cb45
|
@ -12,10 +12,15 @@ cask "stoplight-studio" do
|
||||||
homepage "https://stoplight.io/studio/"
|
homepage "https://stoplight.io/studio/"
|
||||||
|
|
||||||
livecheck do
|
livecheck do
|
||||||
url "https://github.com/stoplightio/studio/releases/latest"
|
url :url
|
||||||
regex(%r{href=.*?/v?(\d+(?:\.\d+)+)[._-]stable[._-]([^/]+)/stoplight[._-]studio[._-]#{arch}\.dmg}i)
|
regex(%r{/v?(\d+(?:\.\d+)+)[._-]stable[._-]([^/]+)/stoplight[._-]studio[._-]#{arch}\.dmg$}i)
|
||||||
strategy :page_match do |page, regex|
|
strategy :github_latest do |json, regex|
|
||||||
page.scan(regex).map { |match| "#{match[0]},#{match[1]}" }
|
json["assets"]&.map do |asset|
|
||||||
|
match = asset["browser_download_url"]&.match(regex)
|
||||||
|
next if match.blank?
|
||||||
|
|
||||||
|
"#{match[1]},#{match[2]}"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue