From 2dae483f1f5264b02fc93710d9b22d0f5893c92c Mon Sep 17 00:00:00 2001 From: Bevan Kay Date: Mon, 30 Oct 2023 09:10:10 +1100 Subject: [PATCH 1/2] ibabel 5.0.3,2023,02 --- Casks/i/ibabel.rb | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/Casks/i/ibabel.rb b/Casks/i/ibabel.rb index 3c3ddd61b8..8bb9b785ac 100644 --- a/Casks/i/ibabel.rb +++ b/Casks/i/ibabel.rb @@ -1,17 +1,35 @@ cask "ibabel" do - version "5.0.3,1" - sha256 :no_check + version "5.0.3,2023,02" + sha256 "25e8c5a311e0a45b5e5cb519fe00ab8b6b9084f5045ee18639649295f39cbc19" - url "https://macinchem.org/ibabel/version#{version.major}/iBabel.zip" + url "https://macinchem.co.uk/wp-content/uploads/#{version.csv.second}/#{version.csv.third}/iBabel.zip", + verified: "macinchem.co.uk/wp-content/uploads/" name "iBabel" homepage "https://www.macinchem.org/ibabel/" livecheck do - url :url - strategy :extract_plist + url :homepage + regex(%r{href=.*?/uploads/(\d+)/(\d+)/iBabel\.zip}i) + strategy :page_match do |page, regex| + match = page.match(regex) + + cask = CaskLoader.load("ibabel") + download_url = "https://macinchem.co.uk/wp-content/uploads/#{match[1]}/#{match[2]}/iBabel.zip" + app_version = Homebrew::Livecheck::Strategy::ExtractPlist.find_versions(cask: cask, + url: download_url)[:matches].values.max + next if app_version.blank? + + "#{app_version.to_s.split(",").first},#{match[1]},#{match[2]}" + end end depends_on formula: "open-babel" + depends_on macos: ">= :monterey" app "iBabel.app" + + zap trash: [ + "~/Library/Caches/com.macinchem.iBabel", + "~/Library/WebKit/com.macinchem.iBabel", + ] end From 7a1c095a84325ee9aed723cf5ac45b0d6c56e30b Mon Sep 17 00:00:00 2001 From: Miccal Matthews Date: Mon, 30 Oct 2023 17:10:38 +0800 Subject: [PATCH 2/2] Update ibabel.rb --- Casks/i/ibabel.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Casks/i/ibabel.rb b/Casks/i/ibabel.rb index 8bb9b785ac..bf2af8b7c4 100644 --- a/Casks/i/ibabel.rb +++ b/Casks/i/ibabel.rb @@ -2,9 +2,9 @@ cask "ibabel" do version "5.0.3,2023,02" sha256 "25e8c5a311e0a45b5e5cb519fe00ab8b6b9084f5045ee18639649295f39cbc19" - url "https://macinchem.co.uk/wp-content/uploads/#{version.csv.second}/#{version.csv.third}/iBabel.zip", - verified: "macinchem.co.uk/wp-content/uploads/" + url "https://macinchem.org/wp-content/uploads/#{version.csv.second}/#{version.csv.third}/iBabel.zip" name "iBabel" + desc "GUI for the cheminformatics toolkit OpenBabel" homepage "https://www.macinchem.org/ibabel/" livecheck do