Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove url do blocks #186501

Merged
merged 8 commits into from
Sep 25, 2024
16 changes: 11 additions & 5 deletions Casks/d/[email protected]
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
cask "dolphin@dev" do
version :latest
sha256 :no_check
version "2409-48,4c,e6"
sha256 "6a720704035b5b80bd9da8354456ef5dc0a0b629752bebafa986adbe61f08703"

url "https://dolphin-emu.org/download/list/master/1/" do |page|
page[/href="([^"]+\.dmg)"/, 1]
end
url "https://dl.dolphin-emu.org/builds/#{version.csv.second}/#{version.csv.third}/dolphin-master-#{version.csv.first}-universal.dmg"
name "Dolphin Dev"
desc "Emulator to play GameCube and Wii games"
homepage "https://dolphin-emu.org/"

livecheck do
url "https://dolphin-emu.org/download/"
regex(%r{href=.*?/builds/([^/]+?)/([^/]+?)/dolphin[._-]master[._-]v?(\d+(?:[.-]\d+)+)-universal\.dmg}i)
strategy :page_match do |page, regex|
page.scan(regex).map { |match| "#{match[2]},#{match[0]},#{match[1]}" }
end
end

conflicts_with cask: [
"dolphin",
"dolphin@beta",
Expand Down
31 changes: 25 additions & 6 deletions Casks/k/[email protected]
Original file line number Diff line number Diff line change
@@ -1,15 +1,34 @@
cask "keepassxc@snapshot" do
version :latest
sha256 :no_check
version "2.8.0,252895"
sha256 "bde7044cc2b7bb30c01d3991dcc756da052d2ce5538d56a789323f3168426221"

url "https://snapshot.keepassxc.org/latest/" do |page|
file_path = page[/href="([^"]+-snapshot\.dmg)"/, 1]
URI.join(page.url, file_path)
end
url "https://snapshot.keepassxc.org/build-#{version.csv.second}/KeePassXC-#{version.csv.first}-snapshot.dmg"
name "KeePassXC"
desc "Password manager app"
homepage "https://keepassxc.org/"

livecheck do
url "https://snapshot.keepassxc.org/"
regex(/href=.*?KeePassXC[._-]v?(\d+(?:\.\d+)+)-snapshot\.dmg/i)
strategy :page_match do |page, regex|
# Identify build numbers from directories like `build-123456`
newest_build = page.scan(%r{href=["']?build[._-]v?(\d+(?:\.\d+)*)/?["' >]}i)
.flatten
.uniq
.max
next if newest_build.blank?

# Fetch the directory listing page for newest build
build_response = Homebrew::Livecheck::Strategy.page_content("https://snapshot.keepassxc.org/build-#{newest_build}/")
next if (build_page = build_response[:content]).blank?

match = build_page.match(regex)
next if match.blank?

"#{match[1]},#{newest_build}"
end
end

deprecate! date: "2025-05-01", because: :unsigned

app "KeePassXC.app"
Expand Down
19 changes: 12 additions & 7 deletions Casks/t/[email protected]
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
cask "transmission@nightly" do
version :latest
sha256 :no_check
version "9662,ed2c6c4085"
sha256 "7b705f4fcad1a200f6327c363c8ce8cdb923dd7ac08dbb22a87260f9199282a0"

url "https://build.transmissionbt.com/job/trunk-mac/lastSuccessfulBuild/artifact/release/" do |page|
file_path = page[/href="([^"]+.dmg)"/, 1]
URI.join(page.url, file_path)
end
url "https://build.transmissionbt.com/job/trunk-mac/#{version.csv.first}/artifact/release/Transmission-#{version.csv.second}.dmg"
name "Transmission"
desc "Open-source BitTorrent client"
homepage "https://transmissionbt.com/"

livecheck do
url "https://build.transmissionbt.com/job/trunk-mac/lastSuccessfulBuild/artifact/release/"
regex(/>\s*\#(\d+)\s*<.+?href=.*?Transmission[._-](\h+)\.dmg/im)
strategy :page_match do |page, regex|
page.scan(regex).map { |match| "#{match[0]},#{match[1]}" }
end
end

deprecate! date: "2025-05-01", because: :unsigned

conflicts_with cask: "transmission"
depends_on macos: ">= :mojave"
depends_on macos: ">= :big_sur"

app "Transmission.app"

Expand Down
43 changes: 35 additions & 8 deletions Casks/v/[email protected]
Original file line number Diff line number Diff line change
@@ -1,20 +1,47 @@
cask "vlc@nightly" do
arch arm: "arm64", intel: "x86_64"
livecheck_arch = on_arch_conditional arm: "-arm64", intel: "-intel64"

version :latest
sha256 :no_check
on_arm do
version "4.0.0,20240925-0413,7df26860"
sha256 "62843cf361be0018d4aca1ef5d1edc283fe25464f52b585475cf0ccfcdcfdd31"

url "https://artifacts.videolan.org/vlc/nightly-macos-#{arch}/" do |page|
folder_path = page[%r{\d+-\d+/}]
url URI.join(page.url, folder_path) do |version_page|
file_path = version_page[/href="([^"]+.dmg)"/, 1]
URI.join(version_page.url, file_path)
end
url "https://artifacts.videolan.org/vlc/nightly-macos-#{arch}/#{version.csv.second}/vlc-#{version.csv.first}-dev-arm64-#{version.csv.third}.dmg"
end
on_intel do
version "4.0.0,20240925-0415,7df26860"
sha256 "42814cb5289539e08867c6f721ed629e177aa80a05598562385516299dd1a5b7"

url "https://artifacts.videolan.org/vlc/nightly-macos-#{arch}/#{version.csv.second}/vlc-#{version.csv.first}-dev-intel64-#{version.csv.third}.dmg"
end

name "VLC media player"
desc "Open-source cross-platform multimedia player"
homepage "https://www.videolan.org/vlc/"

livecheck do
url "https://artifacts.videolan.org/vlc/nightly-macos-#{arch}/"
regex(/href=.*?vlc[._-]v?(\d+(?:\.\d+)+)-dev#{livecheck_arch}-(\h+)\.dmg/i)
strategy :page_match do |page, regex|
directory = page.scan(%r{href=["']?v?(\d+(?:[.-]\d+)+)/?["' >]}i)
.flatten
.uniq
.max
next if directory.blank?

# Fetch the directory listing page for newest build
build_response = Homebrew::Livecheck::Strategy.page_content(
"https://artifacts.videolan.org/vlc/nightly-macos-#{arch}/#{directory}/",
)
next if (build_page = build_response[:content]).blank?

match = build_page.match(regex)
next if match.blank?

"#{match[1]},#{directory},#{match[2]}"
end
end

deprecate! date: "2025-05-01", because: :unsigned

conflicts_with cask: "vlc"
Expand Down
Loading