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

polyphone: update 2.5.1 and add legacy macOS ver. #198812

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 53 additions & 10 deletions Casks/p/polyphone.rb
Original file line number Diff line number Diff line change
@@ -1,25 +1,68 @@
cask "polyphone" do
version "2.5.0,124"
sha256 "031ad6ab2dc78841aefd5159d35194ffcf197d4845f3a084f0e0e5bb438d962b"

Check failure on line 2 in Casks/p/polyphone.rb

View workflow job for this annotation

GitHub Actions / syntax (macos-15)

Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning.
url "https://www.polyphone.io/download/0/v#{version.csv.second}/Polyphone-MacOS_12-#{version.csv.first}.dmg",
user_agent: :browser
name "Polyphone"
desc "Soundfont editor for quickly designing musical instruments"
homepage "https://www.polyphone.io/en"
on_big_sur :or_older do
version "2.5.1,130"
sha256 "03b3509f8a6af45a7de6b93aeaf62bf5fae552aba7806b0ac46cf24ba57f37e3"

macos_version = "_MacOS_10.13"

Check failure on line 7 in Casks/p/polyphone.rb

View workflow job for this annotation

GitHub Actions / syntax (macos-15)

Lint/UselessAssignment: Useless assignment to variable - `macos_version`.
end
on_monterey :or_newer do

Check failure on line 9 in Casks/p/polyphone.rb

View workflow job for this annotation

GitHub Actions / syntax (macos-15)

Cask/StanzaOrder: `on_monterey` stanza out of order
version "2.5.1,129"
sha256 "89a60fc2444a4502719d23f2d5404a1fa9677db64ef09267ebced0eddf77a0dc"

macos_version = "-MacOS_12"

Check failure on line 13 in Casks/p/polyphone.rb

View workflow job for this annotation

GitHub Actions / syntax (macos-15)

Lint/UselessAssignment: Useless assignment to variable - `macos_version`.
end

livecheck do

Check failure on line 16 in Casks/p/polyphone.rb

View workflow job for this annotation

GitHub Actions / syntax (macos-15)

Cask/StanzaOrder: `livecheck` stanza out of order
url "https://www.polyphone.io/en/software"
regex(/Polyphone\s+(\d+(?:\.\d+)+).*download\?file_id=(\d+).*Mac OS \(/im)
regex(/file_id=(\d+)" title="Download the file “Polyphone_MacOS_10\.13-(\d+(?:[\.-]\d+)+)/i)
strategy :page_match do |page, regex|
match = page.match(regex)
next if match.blank?

"#{match[1]},#{match[2]}"
"#{match[2]},#{match[1]}"
end
end
regex(/file_id=(\d+)"\s+title=".*Polyphone#{macos_version}[._-]v?(\d+(?:\.\d+)+)\.dmg/i)

Check failure on line 26 in Casks/p/polyphone.rb

View workflow job for this annotation

GitHub Actions / syntax (macos-15)

Cask/StanzaGrouping: stanza groups should be separated by a single empty line
on_big_sur :or_older do

Check failure on line 27 in Casks/p/polyphone.rb

View workflow job for this annotation

GitHub Actions / syntax (macos-15)

Cask/StanzaOrder: `on_big_sur` stanza out of order
version "2.5-1,130"
Copy link
Member

@daeho-ro daeho-ro Jan 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tried with a variable

  macos_version = "-MacOS_12"

  on_big_sur :or_older do
    version "2.5.1,130"
    sha256 "03b3509f8a6af45a7de6b93aeaf62bf5fae552aba7806b0ac46cf24ba57f37e3"

    macos_version = "_MacOS_10.13"
  end
  on_monterey :or_newer do
    version "2.5.1,129"
    sha256 "89a60fc2444a4502719d23f2d5404a1fa9677db64ef09267ebced0eddf77a0dc"
  end

How about this? Then the remaining part can be used commonly.

sha256 "03b3509f8a6af45a7de6b93aeaf62bf5fae552aba7806b0ac46cf24ba57f37e3"

url "https://www.polyphone.io/download/0/v#{version.csv.second}/Polyphone_MacOS_10.13-#{version.csv.first}.dmg",
user_agent: :browser

depends_on macos: ">= :monterey"
livecheck do
url "https://www.polyphone.io/en/software"
regex(/file_id=(\d+)" title="Download the file “Polyphone_MacOS_10\.13-(\d+(?:[\.-]\d+)+)/i)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2.5-1 is now changed to 2.5.1.

    regex(/file_id=(\d+)"\s+title=".*Polyphone[._-]MacOS_10\.13[._-]v?(\d+(?:\.\d+)+)\.dmg/i)

or

    regex(/file_id=(\d+)"\s+title=".*Polyphone#{macos_version}[._-]v?(\d+(?:\.\d+)+)\.dmg/i)

as a common manner.

strategy :page_match do |page, regex|
match = page.match(regex)
next if match.blank?

"#{match[2]},#{match[1]}"
end
end
end
on_monterey :or_newer do

Check failure on line 45 in Casks/p/polyphone.rb

View workflow job for this annotation

GitHub Actions / syntax (macos-15)

Cask/StanzaOrder: `on_monterey` stanza out of order
version "2.5.1,129"
sha256 "89a60fc2444a4502719d23f2d5404a1fa9677db64ef09267ebced0eddf77a0dc"

url "https://www.polyphone.io/download/0/v#{version.csv.second}/Polyphone-MacOS_12-#{version.csv.first}.dmg",
user_agent: :browser
livecheck do
url "https://www.polyphone.io/en/software"
regex(/file_id=(\d+)" title="Download the file “Polyphone-MacOS_12-(\d+(?:[\.-]\d+)+)/i)
strategy :page_match do |page, regex|
match = page.match(regex)
next if match.blank?

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

name "Polyphone"

Check failure on line 63 in Casks/p/polyphone.rb

View workflow job for this annotation

GitHub Actions / syntax (macos-15)

Cask/StanzaOrder: `name` stanza out of order
desc "Soundfont editor for quickly designing musical instruments"

Check failure on line 64 in Casks/p/polyphone.rb

View workflow job for this annotation

GitHub Actions / syntax (macos-15)

Cask/StanzaOrder: `desc` stanza out of order
homepage "https://www.polyphone.io/en"

app "polyphone.app"

Expand Down
Loading