From cebeef54a260499cb84d870666048e02d031550d Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:40 -0400 Subject: [PATCH 01/46] 8/86box: update livecheck --- Casks/8/86box.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/8/86box.rb b/Casks/8/86box.rb index e405ab6514..67993e87a2 100644 --- a/Casks/8/86box.rb +++ b/Casks/8/86box.rb @@ -9,20 +9,15 @@ cask "86box" do homepage "https://86box.net/" livecheck do - url "https://github.com/86Box/86Box/releases/latest" - regex(%r{href=.*?/download/v?(\d+(?:\.\d+)*)/86Box[._-]macOS.*?[._-]b(\d+).zip}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(%r{/v?(\d+(?:\.\d+)*)/86Box[._-]macOS.*?[._-]b(\d+)\.zip$}i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["browser_download_url"]&.match(regex) + next if match.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]},#{match[1]}" } + "#{match[1]},#{match[2]}" + end end end From b3f13c15c17710754fdbf9c10bc459097d6f3eab Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:40 -0400 Subject: [PATCH 02/46] c/cockatrice: update livecheck --- Casks/c/cockatrice.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/c/cockatrice.rb b/Casks/c/cockatrice.rb index f2a1e6fa02..5911dbd825 100644 --- a/Casks/c/cockatrice.rb +++ b/Casks/c/cockatrice.rb @@ -26,20 +26,15 @@ cask "cockatrice" do homepage "https://cockatrice.github.io/" livecheck do - url "https://github.com/Cockatrice/Cockatrice/releases/latest/" - regex(%r{href=".*?/(\d+(?:-\d+)+)-Release-(\d+(?:\.\d+)+)/Cockatrice-([^/]+)-\2-macOS-[.\w]*\.dmg"}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(%r{/(\d+(?:-\d+)+)-Release-(\d+(?:\.\d+)+)/Cockatrice-([^/]+)-\2-macOS-[.\w]*\.dmg$}i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["browser_download_url"]&.match(regex) + next if match.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[1]},#{match[0]},#{match[2]}" } + "#{match[2]},#{match[1]},#{match[3]}" + end end end From 6a8fb4ecea2b0d012356dc14df35e1c7e3ab6461 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:40 -0400 Subject: [PATCH 03/46] c/codeedit: update livecheck --- Casks/c/codeedit.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/c/codeedit.rb b/Casks/c/codeedit.rb index 83b566a005..d9f01992c4 100644 --- a/Casks/c/codeedit.rb +++ b/Casks/c/codeedit.rb @@ -9,20 +9,15 @@ cask "codeedit" do homepage "https://www.codeedit.app/" livecheck do - url "https://github.com/CodeEditApp/CodeEdit/releases/latest" - regex(%r{href=.*?/download/\D*?([^/]+?)/CodeEdit[._-]([a-f0-9]+)\.dmg}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(%r{/\D*?([^/]+?)/CodeEdit[._-]([a-f0-9]+)\.dmg$}i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["browser_download_url"]&.match(regex) + next if match.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]},#{match[1]}" } + "#{match[1]},#{match[2]}" + end end end From 56a9d94604e2168ae26c19af48bc46e9ba91ce0b Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:40 -0400 Subject: [PATCH 04/46] c/codeexpander: update livecheck --- Casks/c/codeexpander.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/c/codeexpander.rb b/Casks/c/codeexpander.rb index 686697b2e5..0d4d449499 100644 --- a/Casks/c/codeexpander.rb +++ b/Casks/c/codeexpander.rb @@ -8,20 +8,15 @@ cask "codeexpander" do homepage "https://github.com/oncework/codeexpander" livecheck do - url "https://github.com/oncework/codeexpander/releases/latest" - regex(%r{href=.*?/CodeExpander-(\d+(?:\.\d+)+)\.dmg}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^CodeExpander[._-]v?(\d+(?:\.\d+)+)\.dmg$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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] } + match[1] + end end end From 4278f30310addb3e6919f18955c5a044b8eeb933 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:40 -0400 Subject: [PATCH 05/46] d/devcleaner: update livecheck --- Casks/d/devcleaner.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/d/devcleaner.rb b/Casks/d/devcleaner.rb index 13168d2b92..c1dad2941d 100644 --- a/Casks/d/devcleaner.rb +++ b/Casks/d/devcleaner.rb @@ -8,20 +8,15 @@ cask "devcleaner" do homepage "https://github.com/vashpan/xcode-dev-cleaner" livecheck do - url "https://github.com/vashpan/xcode-dev-cleaner/releases/latest" - regex(/DevCleaner[._-]v?(\d+(?:[.-]\d+)+)\.zip/i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^DevCleaner[._-]v?(\d+(?:[.-]\d+)+)\.zip$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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] } + match[1] + end end end From c58b0e9c2f8fa302b81dfa2f656c47922d437e3e Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:40 -0400 Subject: [PATCH 06/46] d/dosbox-x: update livecheck --- Casks/d/dosbox-x.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/d/dosbox-x.rb b/Casks/d/dosbox-x.rb index 1115f3b742..7ca8ccff7c 100644 --- a/Casks/d/dosbox-x.rb +++ b/Casks/d/dosbox-x.rb @@ -17,20 +17,15 @@ cask "dosbox-x" do homepage "https://dosbox-x.com/" livecheck do - url "https://github.com/joncampbell123/dosbox-x/releases/latest" - regex(%r{href=".*?/dosbox-x-v?(\d+(?:\.\d+)+)/dosbox-x-macosx-#{arch}-([^/]+)\.zip"}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(%r{/dosbox-x-v?(\d+(?:\.\d+)+)/dosbox-x-macosx-#{arch}-([^/]+)\.zip$}i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["browser_download_url"]&.match(regex) + next if match.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]},#{match[1]}" } + "#{match[1]},#{match[2]}" + end end end From cc87ff4c2ae136b86db02d1a1004f8aed5f084db Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:41 -0400 Subject: [PATCH 07/46] d/dynobase: update livecheck --- Casks/d/dynobase.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/d/dynobase.rb b/Casks/d/dynobase.rb index 5058d3b902..281ff37a99 100644 --- a/Casks/d/dynobase.rb +++ b/Casks/d/dynobase.rb @@ -12,20 +12,15 @@ cask "dynobase" do homepage "https://dynobase.dev/" livecheck do - url "https://github.com/Dynobase/dynobase/releases/latest" - regex(%r{(\d+(?:\.\d+)+)/Dynobase[._-](\d+(?:\.\d+)+)[._-]+Build[._-](\S+)[._-]#{arch}\.dmg}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(%r{/v?(\d+(?:\.\d+)+)/Dynobase[._-](\d+(?:\.\d+)+)[._-]+Build[._-](\S+)[._-]#{arch}\.dmg$}i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["browser_download_url"]&.match(regex) + next if match.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[1]},#{match[2]},#{match[0]}" } + "#{match[2]},#{match[3]},#{match[1]}" + end end end From 45ff496f609f9d4e4de9d58401b86e0fc53a67a7 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:41 -0400 Subject: [PATCH 08/46] f/fontforge: update livecheck --- Casks/f/fontforge.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/f/fontforge.rb b/Casks/f/fontforge.rb index 7ec5af9629..7b98789fc0 100644 --- a/Casks/f/fontforge.rb +++ b/Casks/f/fontforge.rb @@ -9,20 +9,15 @@ cask "fontforge" do homepage "https://fontforge.github.io/en-US/" livecheck do - url "https://github.com/fontforge/fontforge/releases/latest" - regex(%r{href=.*?/FontForge-(\d+(?:-\d+)*)-([0-9a-f]+)\.app\.dmg}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^FontForge[._-]v?(\d+(?:-\d+)+)-([0-9a-f]+)\.app\.dmg/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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]},#{match[1]}" } + "#{match[1]},#{match[2]}" + end end end From 3287513bf2936c7f63798a669d810d1ca604f9c9 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:41 -0400 Subject: [PATCH 09/46] g/ganttproject: update livecheck --- Casks/g/ganttproject.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/g/ganttproject.rb b/Casks/g/ganttproject.rb index c6d7cf90a8..28bb707e95 100644 --- a/Casks/g/ganttproject.rb +++ b/Casks/g/ganttproject.rb @@ -9,20 +9,15 @@ cask "ganttproject" do homepage "https://www.ganttproject.biz/" livecheck do - url "https://github.com/bardsoftware/ganttproject/releases/latest" - regex(%r{href=.*ganttproject[._-]v?(\d+(?:\.\d+)+)/ganttproject[._-]v?(\d+(?:\.\d+)+)\.dmg}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(%r{/ganttproject[._-]v?(\d+(?:\.\d+)+)/ganttproject[._-]v?(\d+(?:\.\d+)+)\.dmg$}i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["browser_download_url"]&.match(regex) + next if match.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]},#{match[1]}" } + "#{match[1]},#{match[2]}" + end end end From 59be282e4c8ce7d53bce0d9b6ef8c635eef99c10 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:41 -0400 Subject: [PATCH 10/46] g/get-iplayer-automator: update livecheck --- Casks/g/get-iplayer-automator.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/g/get-iplayer-automator.rb b/Casks/g/get-iplayer-automator.rb index 5cf2345c26..238295b73b 100644 --- a/Casks/g/get-iplayer-automator.rb +++ b/Casks/g/get-iplayer-automator.rb @@ -8,20 +8,15 @@ cask "get-iplayer-automator" do homepage "https://github.com/Ascoware/get-iplayer-automator" livecheck do - url "https://github.com/Ascoware/get-iplayer-automator/releases/latest" - regex(%r{href=.*?/Get\.?iPlayer\.?Automator\.?v?(\d+(?:.\d+)*).b(\d+)\.zip}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^Get\.?iPlayer\.?Automator\.?v?(\d+(?:.\d+)*)\.b(\d+)\.zip$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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]},#{match[1]}" } + "#{match[1]},#{match[2]}" + end end end From 4dd41805d8b8fa158761d0fc0dfe827be085e52a Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:41 -0400 Subject: [PATCH 11/46] g/ghidra: update livecheck --- Casks/g/ghidra.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/g/ghidra.rb b/Casks/g/ghidra.rb index 22ba358a2e..bb230910b1 100644 --- a/Casks/g/ghidra.rb +++ b/Casks/g/ghidra.rb @@ -9,20 +9,15 @@ cask "ghidra" do homepage "https://www.ghidra-sre.org/" livecheck do - url "https://github.com/NationalSecurityAgency/ghidra/releases/latest" - regex(/href=.*?ghidra[._-]v?(\d+(?:\.\d+)+)[._-]PUBLIC[._-](\d+)\.zip/i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^ghidra[._-]v?(\d+(?:\.\d+)+)[._-]PUBLIC[._-](\d+)\.zip$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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]},#{match[1]}" } + "#{match[1]},#{match[2]}" + end end end From 85cdb6866b1585007bd3083a946de709577191db Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:41 -0400 Subject: [PATCH 12/46] g/gittyup: update livecheck --- Casks/g/gittyup.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/g/gittyup.rb b/Casks/g/gittyup.rb index 06e2a291fd..9b2232eb77 100644 --- a/Casks/g/gittyup.rb +++ b/Casks/g/gittyup.rb @@ -9,20 +9,15 @@ cask "gittyup" do homepage "https://murmele.github.io/Gittyup/" livecheck do - url "https://github.com/Murmele/Gittyup/releases/latest" - regex(%r{href=.*?/Gittyup-(\d+(?:\.\d+)+)\.dmg}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^Gittyup[._-]v?(\d+(?:\.\d+)+)\.dmg$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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] } + match[1] + end end end From 555dc552375b19ea96f7be9a4722577fd09d444e Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:42 -0400 Subject: [PATCH 13/46] g/gnucash: update livecheck --- Casks/g/gnucash.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/g/gnucash.rb b/Casks/g/gnucash.rb index dd0e8936d1..b11acba86f 100644 --- a/Casks/g/gnucash.rb +++ b/Casks/g/gnucash.rb @@ -9,20 +9,15 @@ cask "gnucash" do homepage "https://www.gnucash.org/" livecheck do - url "https://github.com/Gnucash/gnucash/releases/latest" - regex(%r{href=.*/Gnucash-Intel-v?(\d+\.\d+-\d+)\.dmg}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^Gnucash-Intel[._-]v?(\d+(?:[.-]\d+)+)\.dmg$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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] } + match[1] + end end end From 42e5588f1f4a3bdd6d58ab3828fe02cbd0a7de91 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:42 -0400 Subject: [PATCH 14/46] g/gramps: update livecheck --- Casks/g/gramps.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/g/gramps.rb b/Casks/g/gramps.rb index 3bfbb8f5dd..990494b292 100644 --- a/Casks/g/gramps.rb +++ b/Casks/g/gramps.rb @@ -12,20 +12,15 @@ cask "gramps" do homepage "https://gramps-project.org/blog/" livecheck do - url "https://github.com/gramps-project/gramps/releases/latest" - regex(/Gramps[._-]#{arch}[._-]v?(\d+(?:.\d+)+)[._-](\d+)\.dmg/i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^Gramps[._-]#{arch}[._-]v?(\d+(?:.\d+)+)[._-](\d+)\.dmg$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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]},#{match[1]}" } + "#{match[1]},#{match[2]}" + end end end From e160049b8775954c3c54a416dc2a7c54432eeeed Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:42 -0400 Subject: [PATCH 15/46] i/iconchanger: update livecheck --- Casks/i/iconchanger.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/i/iconchanger.rb b/Casks/i/iconchanger.rb index 7b17bcb890..75f7c8d323 100644 --- a/Casks/i/iconchanger.rb +++ b/Casks/i/iconchanger.rb @@ -8,20 +8,15 @@ cask "iconchanger" do homepage "https://github.com/underthestars-zhy/IconChanger" livecheck do - url "https://github.com/underthestars-zhy/IconChanger/releases/latest" - regex(%r{href=.*?download/v?(\d+(?:\.\d+)*)/IconChanger[._-](\d+(?:-\d+)*)[._-](\d+(?:-\d+)*).zip}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(%r{/v?(\d+(?:\.\d+)+)/IconChanger[._-](\d+(?:-\d+)+)[._-](\d+(?:-\d+)+)\.zip$}i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["browser_download_url"]&.match(regex) + next if match.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]},#{match[1]},#{match[2]}" } + "#{match[1]},#{match[2]},#{match[3]}" + end end end From a05e47f49e69bb2548b15923de4fedb1745f2fd3 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:42 -0400 Subject: [PATCH 16/46] i/inform: update livecheck --- Casks/i/inform.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/i/inform.rb b/Casks/i/inform.rb index 979d20c814..c027a00c8c 100644 --- a/Casks/i/inform.rb +++ b/Casks/i/inform.rb @@ -9,20 +9,15 @@ cask "inform" do homepage "https://ganelson.github.io/inform-website" livecheck do - url "https://github.com/ganelson/inform/releases/latest" - regex(%r{href=.*?/v?(\d+(?:\.\d+)+)/.*?macOS[._-](\d+(?:_\d+)+)\.dmg}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(%r{/v?(\d+(?:\.\d+)+)/.*?macOS[._-]v?(\d+(?:_\d+)+)\.dmg$}i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["browser_download_url"]&.match(regex) + next if match.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]},#{match[1]}" } + "#{match[1]},#{match[2]}" + end end end From 0cd6964b445867fec8c2e5fb4d0a6d55d2eed761 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:42 -0400 Subject: [PATCH 17/46] j/jmc: update livecheck --- Casks/j/jmc.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Casks/j/jmc.rb b/Casks/j/jmc.rb index 02d11ea3d4..e5b1864991 100644 --- a/Casks/j/jmc.rb +++ b/Casks/j/jmc.rb @@ -7,9 +7,13 @@ cask "jmc" do desc "Media organizer" homepage "https://github.com/jcm93/jmc" + # This regex should be removed or tightened (/^v?(\d+(?:\.\d+)+)$/i) when + # upstream starts publishing stable versions. Until then, it has to be loose + # enough to match unstable versions like `0.2-beta.6`, etc.). livecheck do - url "https://github.com/jcm93/jmc/releases/latest" - regex(%r{releases/tag/v?(\d+(?:\.\d+)*((?:-beta)?)*(\d+)?)}i) + url :url + regex(/^v?(\d+(?:\.\d+)+.+)$/i) + strategy :github_latest end app "jmc.app" From d7b561dbc1f801c10cff6492bad39c3c0c9409d8 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:42 -0400 Subject: [PATCH 18/46] k/kapitainsky-rclone-browser: update livecheck --- Casks/k/kapitainsky-rclone-browser.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/k/kapitainsky-rclone-browser.rb b/Casks/k/kapitainsky-rclone-browser.rb index 85da9a2360..c4ee312c36 100644 --- a/Casks/k/kapitainsky-rclone-browser.rb +++ b/Casks/k/kapitainsky-rclone-browser.rb @@ -8,20 +8,15 @@ cask "kapitainsky-rclone-browser" do homepage "https://github.com/kapitainsky/RcloneBrowser" livecheck do - url "https://github.com/kapitainsky/RcloneBrowser/releases/latest" - regex(%r{href=.*?/rclone-browser-(\d+(?:.\d+)*)-([0-9a-f]+)-macos\.dmg}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^rclone-browser[._-]v?(\d+(?:\.\d+)+)-([0-9a-f]+)-macos\.dmg/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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]},#{match[1]}" } + "#{match[1]},#{match[2]}" + end end end From b7b5ef0129ce3463eabe8f5313fed611f22d0bd4 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:43 -0400 Subject: [PATCH 19/46] k/klogg: update livecheck --- Casks/k/klogg.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/k/klogg.rb b/Casks/k/klogg.rb index c1e48a0931..a851363217 100644 --- a/Casks/k/klogg.rb +++ b/Casks/k/klogg.rb @@ -8,20 +8,15 @@ cask "klogg" do homepage "https://github.com/variar/klogg" livecheck do - url "https://github.com/variar/klogg/releases/latest" - regex(%r{href=.*?/klogg-(\d+(?:\.\d+)*)-OSX-Qt5\.dmg}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^klogg[._-]v?(\d+(?:\.\d+)+)-OSX-Qt5\.dmg$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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] } + match[1] + end end end From 10fd3bb8da12c8dae698fbe70aeb48bc015bdd8e Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:43 -0400 Subject: [PATCH 20/46] l/lyricsx: update livecheck --- Casks/l/lyricsx.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/l/lyricsx.rb b/Casks/l/lyricsx.rb index c2d0004072..81a03a7b1b 100644 --- a/Casks/l/lyricsx.rb +++ b/Casks/l/lyricsx.rb @@ -8,20 +8,15 @@ cask "lyricsx" do homepage "https://github.com/ddddxxx/LyricsX" livecheck do - url "https://github.com/ddddxxx/LyricsX/releases/latest" - regex(%r{href=.*?/LyricsX_(\d+(?:\.\d+)*)\+(\d+)\.zip}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^LyricsX[._-]v?(\d+(?:\.\d+)+)\+(\d+)\.zip$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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]},#{match[1]}" } + "#{match[1]},#{match[2]}" + end end end From f32f0fb29f7798c5f593a992256fc5608d6883bf Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:43 -0400 Subject: [PATCH 21/46] m/mediaelch: update livecheck --- Casks/m/mediaelch.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/m/mediaelch.rb b/Casks/m/mediaelch.rb index e246f8e5cf..171efa0a20 100644 --- a/Casks/m/mediaelch.rb +++ b/Casks/m/mediaelch.rb @@ -9,20 +9,15 @@ cask "mediaelch" do homepage "https://www.kvibes.de/en/mediaelch/" livecheck do - url "https://github.com/Komet/MediaElch/releases/latest" - regex(%r{href=.*?/MediaElch_macOS_.*?[._-](\d+(?:\.\d+)*)_(\d+(?:.\d+)*)_git-([^/]*?)\.dmg}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^MediaElch_macOS_.*?[._-]v?(\d+(?:\.\d+)+)_(\d+(?:.\d+)*)_git-(.+?)\.dmg$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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]},#{match[1]},#{match[2]}" } + "#{match[1]},#{match[2]},#{match[3]}" + end end end From aabc815ef8570e5200079b91b7364c9a014438b7 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:43 -0400 Subject: [PATCH 22/46] m/mindforger: update livecheck --- Casks/m/mindforger.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/m/mindforger.rb b/Casks/m/mindforger.rb index 9fd1e50a89..90922b511e 100644 --- a/Casks/m/mindforger.rb +++ b/Casks/m/mindforger.rb @@ -9,20 +9,15 @@ cask "mindforger" do homepage "https://www.mindforger.com/" livecheck do - url "https://github.com/dvorka/mindforger/releases/latest" - regex(/href=.*?mindforger[._-]v?(\d+(?:[.-]\d+)+)-intel\.dmg/i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^mindforger[._-]v?(\d+(?:[.-]\d+)+)-intel\.dmg$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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] } + match[1] + end end end From b06ce8fa073b3ba0602c7658a4ff39c724fc8fc1 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:43 -0400 Subject: [PATCH 23/46] m/munki: update livecheck --- Casks/m/munki.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/m/munki.rb b/Casks/m/munki.rb index cf5606ac25..e64512aa73 100644 --- a/Casks/m/munki.rb +++ b/Casks/m/munki.rb @@ -9,20 +9,15 @@ cask "munki" do homepage "https://www.munki.org/munki/" livecheck do - url "https://github.com/munki/munki/releases/latest" - regex(%r{href=.*?/munkitools[._-]v?(\d+(?:\.\d+)+)\.pkg}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^munkitools[._-]v?(\d+(?:\.\d+)+)\.pkg$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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] } + match[1] + end end end From 17fcc7d692828d0c618235467c029e631a0b3e3f Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:44 -0400 Subject: [PATCH 24/46] m/musescore: update livecheck --- Casks/m/musescore.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/m/musescore.rb b/Casks/m/musescore.rb index 887804dbe4..248d3e8fd8 100644 --- a/Casks/m/musescore.rb +++ b/Casks/m/musescore.rb @@ -9,20 +9,15 @@ cask "musescore" do homepage "https://musescore.org/" livecheck do - url "https://github.com/musescore/MuseScore/releases/latest" - regex(%r{href=.*?/MuseScore[._-]v?(\d+(?:\.\d+)+)\.dmg}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^MuseScore[._-]v?(\d+(?:\.\d+)+)\.dmg$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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] } + match[1] + end end end From eb1c74b7b133b54fb5df9459599b6efcefa2c65d Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:44 -0400 Subject: [PATCH 25/46] n/nextcloud: update livecheck --- Casks/n/nextcloud.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/n/nextcloud.rb b/Casks/n/nextcloud.rb index 744c5bc404..8a2c9cd837 100644 --- a/Casks/n/nextcloud.rb +++ b/Casks/n/nextcloud.rb @@ -19,20 +19,15 @@ cask "nextcloud" do homepage "https://nextcloud.com/" livecheck do - url "https://github.com/nextcloud-releases/desktop/releases/latest" - regex(/Nextcloud[._-]v?(\d+(?:\.\d+)+)\.pkg/i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^Nextcloud[._-]v?(\d+(?:\.\d+)+)\.pkg$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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] } + match[1] + end end end From 537285f9b0a79a63f118e393efa05bef37479188 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:44 -0400 Subject: [PATCH 26/46] n/nightingale: update livecheck --- Casks/n/nightingale.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/n/nightingale.rb b/Casks/n/nightingale.rb index 214ceaa3c1..d1be733c57 100644 --- a/Casks/n/nightingale.rb +++ b/Casks/n/nightingale.rb @@ -9,20 +9,15 @@ cask "nightingale" do homepage "https://getnightingale.com/" livecheck do - url "https://github.com/nightingale-media-player/nightingale-hacking/releases/latest" - regex(%r{href=.*?/Nightingale_(\d+(?:\.\d+)*)-(\d+)_macosx-i686\.dmg}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^Nightingale[._-]v?(\d+(?:\.\d+)+)-(\d+)_macosx-i686\.dmg$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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]},#{match[1]}" } + "#{match[1]},#{match[2]}" + end end end From c9d83025ea2dfa57d515a9289e5b62e26d72d350 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:44 -0400 Subject: [PATCH 27/46] o/openbci: update livecheck --- Casks/o/openbci.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/o/openbci.rb b/Casks/o/openbci.rb index b8637d80f9..5c970de1e8 100644 --- a/Casks/o/openbci.rb +++ b/Casks/o/openbci.rb @@ -9,20 +9,15 @@ cask "openbci" do homepage "https://openbci.com/" livecheck do - url "https://github.com/OpenBCI/OpenBCI_GUI/releases/latest" - regex(/openbcigui[._-]v?(\d+(?:\.\d+)+)[._-](.+)[._-]macosx\.dmg/i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^openbcigui[._-]v?(\d+(?:\.\d+)+)[._-](.+)[._-]macosx\.dmg$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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]},#{match[1]}" } + "#{match[1]},#{match[2]}" + end end end From 3c6d8d1b83e30a93e2df3fafa1c801bfa8d247fb Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:44 -0400 Subject: [PATCH 28/46] o/otx: update livecheck --- Casks/o/otx.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/o/otx.rb b/Casks/o/otx.rb index a88448b7f7..502484ab09 100644 --- a/Casks/o/otx.rb +++ b/Casks/o/otx.rb @@ -8,20 +8,15 @@ cask "otx" do homepage "https://github.com/x43x61x69/otx" livecheck do - url "https://github.com/x43x61x69/otx/releases/latest" - regex(%r{href=.*?/v?(\d+(?:\.\d+)+)/otx[._-](\h+)\.zip}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(%r{/v?(\d+(?:\.\d+)+)/otx[._-](\h+)\.zip$}i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["browser_download_url"]&.match(regex) + next if match.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]},#{match[1]}" } + "#{match[1]},#{match[2]}" + end end end From 4ee95d780f994015337805d371a98dafcade326a Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:44 -0400 Subject: [PATCH 29/46] p/postgres-unofficial: update livecheck --- Casks/p/postgres-unofficial.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/p/postgres-unofficial.rb b/Casks/p/postgres-unofficial.rb index 151b9aa264..2a9a97ed67 100644 --- a/Casks/p/postgres-unofficial.rb +++ b/Casks/p/postgres-unofficial.rb @@ -9,20 +9,15 @@ cask "postgres-unofficial" do homepage "https://postgresapp.com/" livecheck do - url "https://github.com/PostgresApp/PostgresApp/releases/latest" - regex(/href=.*?Postgres[._-]v?(\d+(?:\.\d+)+)[._-](\d+(?:-\d+)+)\.dmg/i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^Postgres[._-]v?(\d+(?:\.\d+)+)[._-](\d+(?:-\d+)+)\.dmg$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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]},#{match[1]}" } + "#{match[1]},#{match[2]}" + end end end From 6365ff305dec5fa0d4682fe4afad2a9deb3e4787 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:44 -0400 Subject: [PATCH 30/46] p/praat: update livecheck --- Casks/p/praat.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/p/praat.rb b/Casks/p/praat.rb index a319df9d95..561e656555 100644 --- a/Casks/p/praat.rb +++ b/Casks/p/praat.rb @@ -9,20 +9,15 @@ cask "praat" do homepage "https://www.fon.hum.uva.nl/praat/" livecheck do - url "https://github.com/praat/praat/releases/latest" - regex(%r{href=.*?(\d+(?:\.\d+)+)/praat(\d+)[._-]mac\.dmg}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(%r{/v?(\d+(?:\.\d+)+)/praat(\d+)[._-]mac\.dmg$}i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["browser_download_url"]&.match(regex) + next if match.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]},#{match[1]}" } + "#{match[1]},#{match[2]}" + end end end From 3c4fd87675952d1d132b659e2fbe5ffc20cfb281 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:45 -0400 Subject: [PATCH 31/46] p/pronterface: update livecheck --- Casks/p/pronterface.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Casks/p/pronterface.rb b/Casks/p/pronterface.rb index 30846e1156..9af3e2b296 100644 --- a/Casks/p/pronterface.rb +++ b/Casks/p/pronterface.rb @@ -17,10 +17,15 @@ cask "pronterface" do homepage "https://github.com/kliment/Printrun" livecheck do - url "https://api.github.com/repos/kliment/Printrun/releases/latest" - regex(/printrun[._-]v?(\d+(?:\.\d+)+)[._-]macos(?:.+)[._-]py(\d+(?:\.\d+)+)\.zip/i) - strategy :page_match do |page, regex| - page.scan(regex).map { |match| "#{match[0]},#{match[1]}" } + url :url + regex(/^printrun[._-]v?(\d+(?:\.\d+)+)[._-]macos(?:.+)[._-]py(\d+(?:\.\d+)+)\.zip$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.blank? + + "#{match[1]},#{match[2]}" + end end end From 3e00a868678faa7449b1f483b7f4edd416a2d61c Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:45 -0400 Subject: [PATCH 32/46] p/pure-writer: update livecheck --- Casks/p/pure-writer.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/p/pure-writer.rb b/Casks/p/pure-writer.rb index ca19b75cbc..96817beaf7 100644 --- a/Casks/p/pure-writer.rb +++ b/Casks/p/pure-writer.rb @@ -9,20 +9,15 @@ cask "pure-writer" do homepage "https://writer.drakeet.com/desktop" livecheck do - url "https://github.com/PureWriter/desktop/releases/latest" - regex(%r{href=.*?([^/]+)/PureWriter[._-]v?(\d+(?:\.\d+)+)-macOS\.dmg}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(%r{/v?(\d+(?:\.\d+)+)/PureWriter[._-]v?(\d+(?:\.\d+)+)-macOS\.dmg$}i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["browser_download_url"]&.match(regex) + next if match.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]},#{match[1]}" } + "#{match[1]},#{match[2]}" + end end end From 68edf1079f7d7ef4edbae7ff8fcc35005de97012 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:45 -0400 Subject: [PATCH 33/46] q/qlvideo: update livecheck --- Casks/q/qlvideo.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Casks/q/qlvideo.rb b/Casks/q/qlvideo.rb index 93010c6536..7233f4a80e 100644 --- a/Casks/q/qlvideo.rb +++ b/Casks/q/qlvideo.rb @@ -8,12 +8,15 @@ cask "qlvideo" do homepage "https://github.com/Marginal/QLVideo" livecheck do - url "https://api.github.com/repos/Marginal/QLVideo/releases/latest" - strategy :page_match do |page| - match = page.match(/QLVideo[._-]v?(\d+?)(\d+)\.dmg/i) - next if match.blank? + url :url + regex(/^QLVideo[._-]v?(\d+?)(\d+)\.dmg$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.blank? - "#{match[1]}.#{match[2]}" + "#{match[1]}.#{match[2]}" + end end end From b2534ecbd391e1d3df691923185c59b2385fdb23 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:45 -0400 Subject: [PATCH 34/46] q/quaternion: update livecheck --- Casks/q/quaternion.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/q/quaternion.rb b/Casks/q/quaternion.rb index ea6dfe5331..8165779a4a 100644 --- a/Casks/q/quaternion.rb +++ b/Casks/q/quaternion.rb @@ -8,20 +8,15 @@ cask "quaternion" do 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? + url :url + regex(/^quaternion[._-]v?(\d+(?:\.\d+)+)\.dmg$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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] } + match[1] + end end end From 7cc8a8baaed024853cb663e88d7e119bdcca77bf Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:45 -0400 Subject: [PATCH 35/46] r/raze: update livecheck --- Casks/r/raze.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/r/raze.rb b/Casks/r/raze.rb index bdba914043..1b4f3dc445 100644 --- a/Casks/r/raze.rb +++ b/Casks/r/raze.rb @@ -8,20 +8,15 @@ cask "raze" do homepage "https://github.com/coelckers/Raze" livecheck do - url "https://github.com/coelckers/Raze/releases/latest" - regex(/raze[._-]macos[._-]v?(\d+(?:\.\d+)+)\.zip/i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^raze[._-]macos[._-]v?(\d+(?:\.\d+)+)\.zip$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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] } + match[1] + end end end From 2cdce075a2228d9114feead71d0d8733fe6a1e5c Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:45 -0400 Subject: [PATCH 36/46] s/sage: update livecheck --- Casks/s/sage.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/s/sage.rb b/Casks/s/sage.rb index 2d2702bffd..00a0d4bb15 100644 --- a/Casks/s/sage.rb +++ b/Casks/s/sage.rb @@ -12,20 +12,15 @@ cask "sage" do homepage "https://www.sagemath.org/" livecheck do - url "https://github.com/3-manifolds/Sage_macOS/releases/latest" - regex(%r{href=.*?/v?(\d+(?:\.\d+)+)/SageMath[._-]v?(\d+(?:\.\d+)+)[._-].*?#{arch}\.dmg}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(%r{/v?(\d+(?:\.\d+)+)/SageMath[._-]v?(\d+(?:\.\d+)+)[._-].*?#{arch}\.dmg$}i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["browser_download_url"]&.match(regex) + next if match.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[1]},#{match[0]}" } + "#{match[2]},#{match[1]}" + end end end From 901894e78a9cb09ad6cd0444091a78acbeb622fa Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:46 -0400 Subject: [PATCH 37/46] s/schildichat: update livecheck --- Casks/s/schildichat.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Casks/s/schildichat.rb b/Casks/s/schildichat.rb index 611205c38b..a9f1964994 100644 --- a/Casks/s/schildichat.rb +++ b/Casks/s/schildichat.rb @@ -9,8 +9,9 @@ cask "schildichat" do homepage "https://schildi.chat/desktop/" livecheck do - url "https://github.com/SchildiChat/schildichat-desktop/releases/latest" - regex(%r{href=["']?[^"' >]*?/tag/v?(\d+(?:\.\d+)+-\w*?\.?\d*?)["' >]}i) + url :url + regex(/^v?(\d+(?:\.\d+)+(?:-sc\.?\d+)?)$/i) + strategy :github_latest end app "SchildiChat.app" From 9d515208163f3c089352d80008c696bea375468c Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:46 -0400 Subject: [PATCH 38/46] s/solar2d: update livecheck --- Casks/s/solar2d.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/s/solar2d.rb b/Casks/s/solar2d.rb index d6d5f64c91..2087305b87 100644 --- a/Casks/s/solar2d.rb +++ b/Casks/s/solar2d.rb @@ -9,20 +9,15 @@ cask "solar2d" do homepage "https://solar2d.com/" livecheck do - url "https://github.com/coronalabs/corona/releases/latest" - regex(%r{href=.*?/Solar2D[._-]macOS[._-]v?(\d+(?:\.\d+)+)\.dmg}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^Solar2D[._-]macOS[._-]v?(\d+(?:\.\d+)+)\.dmg$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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] } + match[1] + end end end From c6c036cb45f840e6ef1a4af4b654a06f92cb9e50 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:46 -0400 Subject: [PATCH 39/46] s/stoplight-studio: update livecheck --- Casks/s/stoplight-studio.rb | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Casks/s/stoplight-studio.rb b/Casks/s/stoplight-studio.rb index 7f2fc17592..700f3aa517 100644 --- a/Casks/s/stoplight-studio.rb +++ b/Casks/s/stoplight-studio.rb @@ -12,10 +12,15 @@ cask "stoplight-studio" do homepage "https://stoplight.io/studio/" livecheck do - url "https://github.com/stoplightio/studio/releases/latest" - regex(%r{href=.*?/v?(\d+(?:\.\d+)+)[._-]stable[._-]([^/]+)/stoplight[._-]studio[._-]#{arch}\.dmg}i) - strategy :page_match do |page, regex| - page.scan(regex).map { |match| "#{match[0]},#{match[1]}" } + url :url + regex(%r{/v?(\d+(?:\.\d+)+)[._-]stable[._-]([^/]+)/stoplight[._-]studio[._-]#{arch}\.dmg$}i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["browser_download_url"]&.match(regex) + next if match.blank? + + "#{match[1]},#{match[2]}" + end end end From 1a7b3708ebcfc947577eec4191bb087cc3d435d3 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:46 -0400 Subject: [PATCH 40/46] s/switchhosts: update livecheck --- Casks/s/switchhosts.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/s/switchhosts.rb b/Casks/s/switchhosts.rb index 5da1e36c9c..a7c61e1b45 100644 --- a/Casks/s/switchhosts.rb +++ b/Casks/s/switchhosts.rb @@ -12,20 +12,15 @@ cask "switchhosts" do homepage "https://oldj.github.io/SwitchHosts/" livecheck do - url "https://github.com/oldj/SwitchHosts/releases/latest" - regex(%r{/SwitchHosts_mac_#{arch}[._-]v?(\d+(?:\.\d+)+)\.dmg}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^SwitchHosts_mac_#{arch}[._-]v?(\d+(?:\.\d+)+)\.dmg$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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] } + match[1] + end end end From 2a16230c129f1a634d54f14e496404557beeac17 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:46 -0400 Subject: [PATCH 41/46] t/tabby: update livecheck --- Casks/t/tabby.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Casks/t/tabby.rb b/Casks/t/tabby.rb index c1fbb221c1..49be10e292 100644 --- a/Casks/t/tabby.rb +++ b/Casks/t/tabby.rb @@ -13,8 +13,8 @@ cask "tabby" do homepage "https://eugeny.github.io/tabby/" livecheck do - url "https://github.com/Eugeny/tabby/releases/latest" - strategy :header_match + url :url + strategy :github_latest end auto_updates true From fb0c56b8dae580e34c94a76d54c4742d26fd65fa Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:47 -0400 Subject: [PATCH 42/46] t/texworks: update livecheck --- Casks/t/texworks.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/t/texworks.rb b/Casks/t/texworks.rb index a858423725..a583991abb 100644 --- a/Casks/t/texworks.rb +++ b/Casks/t/texworks.rb @@ -9,20 +9,15 @@ cask "texworks" do homepage "https://www.tug.org/texworks/" livecheck do - url "https://github.com/TeXworks/texworks/releases/latest" - regex(%r{href=.*?/TeXworks-macos10.15-(\d+(?:\.\d+)*)-(\d+)-git_(.*?)\.dmg}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^TeXworks-macos10.15[._-]v?(\d+(?:\.\d+)+)-(\d+)-git_(.*?)\.dmg$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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]},#{match[1]},#{match[2]}" } + "#{match[1]},#{match[2]},#{match[3]}" + end end end From e1797811769ee5684e2e00b16f7b07e14db9af78 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:47 -0400 Subject: [PATCH 43/46] t/toolreleases: update livecheck --- Casks/t/toolreleases.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/t/toolreleases.rb b/Casks/t/toolreleases.rb index 8440a0fbd3..a3574dc12f 100644 --- a/Casks/t/toolreleases.rb +++ b/Casks/t/toolreleases.rb @@ -8,20 +8,15 @@ cask "toolreleases" do homepage "https://github.com/DeveloperMaris/ToolReleases" livecheck do - url "https://github.com/DeveloperMaris/ToolReleases/releases/latest" - regex(%r{href=.*?/ToolReleases_v?(\d+(?:\.\d+)*)\.b(\d+)\.zip}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^ToolReleases[._-]v?(\d+(?:\.\d+)+)[._-]b(\d+)\.zip$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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]},#{match[1]}" } + "#{match[1]},#{match[2]}" + end end end From b4ebe1df6dd9b97770622282df6a4924437d2012 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:47 -0400 Subject: [PATCH 44/46] u/uhk-agent: update livecheck --- Casks/u/uhk-agent.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Casks/u/uhk-agent.rb b/Casks/u/uhk-agent.rb index 374945ee02..6fd364a390 100644 --- a/Casks/u/uhk-agent.rb +++ b/Casks/u/uhk-agent.rb @@ -9,8 +9,8 @@ cask "uhk-agent" do homepage "https://github.com/UltimateHackingKeyboard/agent" livecheck do - url "https://github.com/UltimateHackingKeyboard/agent/releases/latest" - strategy :header_match + url :url + strategy :github_latest end app "UHK Agent.app" From 5fc1ae6b4ec94e74c011b1af507e08551c586c90 Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:47 -0400 Subject: [PATCH 45/46] v/vimr: update livecheck --- Casks/v/vimr.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Casks/v/vimr.rb b/Casks/v/vimr.rb index 967bc8ddf6..e87613be38 100644 --- a/Casks/v/vimr.rb +++ b/Casks/v/vimr.rb @@ -9,9 +9,10 @@ cask "vimr" do homepage "http://vimr.org/" livecheck do - url "https://github.com/qvacua/vimr/releases/latest" - strategy :page_match do |page| - match = page.match(/v?(\d+(?:\.\d+)+)[._-](\d+(?:\.\d+)+)/i) + url :url + regex(/^v?(\d+(?:\.\d+)+)[._-](\d+(?:\.\d+)+)$/i) + strategy :github_latest do |json, regex| + match = json["tag_name"]&.match(regex) next if match.blank? "#{match[1]},#{match[2]}" From 1a4d4e6ad0d18df139a8917105c8e033d2da8afc Mon Sep 17 00:00:00 2001 From: Sam Ford <1584702+samford@users.noreply.github.com> Date: Fri, 29 Sep 2023 23:57:47 -0400 Subject: [PATCH 46/46] w/wwdc: update livecheck --- Casks/w/wwdc.rb | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/Casks/w/wwdc.rb b/Casks/w/wwdc.rb index fd68458aa8..cbdaa7a9e2 100644 --- a/Casks/w/wwdc.rb +++ b/Casks/w/wwdc.rb @@ -9,20 +9,15 @@ cask "wwdc" do homepage "https://wwdc.io/" livecheck do - url "https://github.com/insidegui/WWDC/releases/latest" - regex(%r{href=.*?/WWDC[._-]v?(\d+(?:[.-]\d+)+)\.dmg}i) - strategy :header_match do |headers, regex| - next if headers["location"].blank? + url :url + regex(/^WWDC[._-]v?(\d+(?:[.-]\d+)+)\.dmg$/i) + strategy :github_latest do |json, regex| + json["assets"]&.map do |asset| + match = asset["name"]&.match(regex) + next if match.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].tr("-", ",").to_s } + match[1].tr("-", ",") + end end end