2019-04-19 15:38:03 +09:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-10-26 19:49:21 +01:00
|
|
|
require "rubocops/rubocop-cask"
|
|
|
|
|
2024-02-18 15:11:11 -08:00
|
|
|
RSpec.describe RuboCop::Cop::Cask::StanzaOrder, :config do
|
2023-05-08 11:02:44 +02:00
|
|
|
it "accepts a sole stanza" do
|
|
|
|
expect_no_offenses <<~CASK
|
|
|
|
cask 'foo' do
|
|
|
|
version :latest
|
|
|
|
end
|
|
|
|
CASK
|
2018-10-26 19:49:21 +01:00
|
|
|
end
|
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
it "accepts when all stanzas are in order" do
|
|
|
|
expect_no_offenses <<~CASK
|
|
|
|
cask 'foo' do
|
|
|
|
arch arm: "arm", intel: "x86_64"
|
|
|
|
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
|
|
|
version :latest
|
|
|
|
sha256 :no_check
|
|
|
|
foo = "bar"
|
|
|
|
end
|
|
|
|
CASK
|
2018-10-26 19:49:21 +01:00
|
|
|
end
|
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
it "reports an offense when stanzas are out of order" do
|
|
|
|
expect_offense <<~CASK
|
|
|
|
cask 'foo' do
|
|
|
|
sha256 :no_check
|
|
|
|
^^^^^^^^^^^^^^^^ `sha256` stanza out of order
|
|
|
|
version :latest
|
|
|
|
^^^^^^^^^^^^^^^ `version` stanza out of order
|
|
|
|
end
|
|
|
|
CASK
|
2018-10-26 19:49:21 +01:00
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
expect_correction <<~CASK
|
|
|
|
cask 'foo' do
|
|
|
|
version :latest
|
|
|
|
sha256 :no_check
|
|
|
|
end
|
|
|
|
CASK
|
2018-10-26 19:49:21 +01:00
|
|
|
end
|
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
it "reports an offense when an `arch` stanza is out of order" do
|
|
|
|
expect_offense <<~CASK
|
|
|
|
cask 'foo' do
|
|
|
|
version :latest
|
|
|
|
^^^^^^^^^^^^^^^ `version` stanza out of order
|
|
|
|
sha256 :no_check
|
|
|
|
^^^^^^^^^^^^^^^^ `sha256` stanza out of order
|
|
|
|
arch arm: "arm", intel: "x86_64"
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `arch` stanza out of order
|
|
|
|
end
|
|
|
|
CASK
|
2022-08-05 15:35:25 -04:00
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
expect_correction <<~CASK
|
|
|
|
cask 'foo' do
|
|
|
|
arch arm: "arm", intel: "x86_64"
|
|
|
|
version :latest
|
|
|
|
sha256 :no_check
|
|
|
|
end
|
|
|
|
CASK
|
|
|
|
end
|
2022-08-05 15:35:25 -04:00
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
it "reports an offense when an `on_arch_conditional` variable assignment is out of order" do
|
|
|
|
expect_offense <<~CASK
|
|
|
|
cask 'foo' do
|
|
|
|
arch arm: "arm", intel: "x86_64"
|
|
|
|
sha256 :no_check
|
|
|
|
^^^^^^^^^^^^^^^^ `sha256` stanza out of order
|
|
|
|
version :latest
|
|
|
|
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `on_arch_conditional` stanza out of order
|
|
|
|
end
|
|
|
|
CASK
|
|
|
|
|
|
|
|
expect_correction <<~CASK
|
|
|
|
cask 'foo' do
|
|
|
|
arch arm: "arm", intel: "x86_64"
|
|
|
|
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
|
|
|
version :latest
|
|
|
|
sha256 :no_check
|
|
|
|
end
|
|
|
|
CASK
|
2022-08-05 15:35:25 -04:00
|
|
|
end
|
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
it "reports an offense when an `on_arch_conditional` variable assignment is above an `arch` stanza" do
|
|
|
|
expect_offense <<~CASK
|
|
|
|
cask 'foo' do
|
|
|
|
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `on_arch_conditional` stanza out of order
|
|
|
|
arch arm: "arm", intel: "x86_64"
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `arch` stanza out of order
|
|
|
|
version :latest
|
|
|
|
sha256 :no_check
|
|
|
|
end
|
|
|
|
CASK
|
|
|
|
|
|
|
|
expect_correction <<~CASK
|
|
|
|
cask 'foo' do
|
|
|
|
arch arm: "arm", intel: "x86_64"
|
|
|
|
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin"
|
|
|
|
version :latest
|
|
|
|
sha256 :no_check
|
|
|
|
end
|
|
|
|
CASK
|
|
|
|
end
|
2022-08-05 15:35:25 -04:00
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
it "reports an offense when multiple stanzas are out of order" do
|
|
|
|
expect_offense <<~CASK
|
|
|
|
cask 'foo' do
|
|
|
|
url 'https://foo.brew.sh/foo.zip'
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `url` stanza out of order
|
|
|
|
uninstall :quit => 'com.example.foo',
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `uninstall` stanza out of order
|
|
|
|
:kext => 'com.example.foo.kext'
|
|
|
|
version :latest
|
|
|
|
^^^^^^^^^^^^^^^ `version` stanza out of order
|
|
|
|
app 'Foo.app'
|
|
|
|
sha256 :no_check
|
|
|
|
^^^^^^^^^^^^^^^^ `sha256` stanza out of order
|
|
|
|
end
|
|
|
|
CASK
|
|
|
|
|
|
|
|
expect_correction <<~CASK
|
|
|
|
cask 'foo' do
|
|
|
|
version :latest
|
|
|
|
sha256 :no_check
|
|
|
|
url 'https://foo.brew.sh/foo.zip'
|
|
|
|
app 'Foo.app'
|
|
|
|
uninstall :quit => 'com.example.foo',
|
|
|
|
:kext => 'com.example.foo.kext'
|
|
|
|
end
|
|
|
|
CASK
|
|
|
|
end
|
2022-08-05 15:35:25 -04:00
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
it "does not reorder multiple stanzas of the same type" do
|
|
|
|
expect_offense <<~CASK
|
|
|
|
cask 'foo' do
|
|
|
|
name 'Foo'
|
|
|
|
^^^^^^^^^^ `name` stanza out of order
|
|
|
|
url 'https://foo.brew.sh/foo.zip'
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `url` stanza out of order
|
|
|
|
name 'FancyFoo'
|
|
|
|
^^^^^^^^^^^^^^^ `name` stanza out of order
|
|
|
|
version :latest
|
|
|
|
^^^^^^^^^^^^^^^ `version` stanza out of order
|
|
|
|
app 'Foo.app'
|
|
|
|
^^^^^^^^^^^^^ `app` stanza out of order
|
|
|
|
sha256 :no_check
|
|
|
|
^^^^^^^^^^^^^^^^ `sha256` stanza out of order
|
|
|
|
name 'FunkyFoo'
|
|
|
|
^^^^^^^^^^^^^^^ `name` stanza out of order
|
|
|
|
end
|
|
|
|
CASK
|
|
|
|
|
|
|
|
expect_correction <<~CASK
|
|
|
|
cask 'foo' do
|
|
|
|
version :latest
|
|
|
|
sha256 :no_check
|
|
|
|
url 'https://foo.brew.sh/foo.zip'
|
|
|
|
name 'Foo'
|
|
|
|
name 'FancyFoo'
|
|
|
|
name 'FunkyFoo'
|
|
|
|
app 'Foo.app'
|
|
|
|
end
|
|
|
|
CASK
|
2022-08-05 15:35:25 -04:00
|
|
|
end
|
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
it "keeps associated comments when auto-correcting" do
|
|
|
|
expect_offense <<~CASK
|
|
|
|
cask 'foo' do
|
|
|
|
version :latest
|
|
|
|
# comment with an empty line between
|
|
|
|
|
|
|
|
# comment directly above
|
|
|
|
postflight do
|
|
|
|
^^^^^^^^^^^^^ `postflight` stanza out of order
|
|
|
|
puts 'We have liftoff!'
|
2022-08-05 15:35:25 -04:00
|
|
|
end
|
2023-05-08 11:02:44 +02:00
|
|
|
sha256 :no_check # comment on same line
|
|
|
|
^^^^^^^^^^^^^^^^ `sha256` stanza out of order
|
|
|
|
end
|
|
|
|
CASK
|
2022-08-05 15:35:25 -04:00
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
expect_correction <<~CASK, loop: false
|
|
|
|
cask 'foo' do
|
|
|
|
version :latest
|
|
|
|
sha256 :no_check # comment on same line
|
|
|
|
# comment with an empty line between
|
2022-08-05 15:35:25 -04:00
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
# comment directly above
|
|
|
|
postflight do
|
|
|
|
puts 'We have liftoff!'
|
|
|
|
end
|
|
|
|
end
|
|
|
|
CASK
|
2022-08-05 15:35:25 -04:00
|
|
|
end
|
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
it "reports an offense when an `on_arch_conditional` variable assignment with a comment is out of order" do
|
|
|
|
expect_offense <<~CASK
|
|
|
|
cask 'foo' do
|
|
|
|
version :latest
|
|
|
|
^^^^^^^^^^^^^^^ `version` stanza out of order
|
|
|
|
sha256 :no_check
|
|
|
|
^^^^^^^^^^^^^^^^ `sha256` stanza out of order
|
|
|
|
# comment with an empty line between
|
|
|
|
|
|
|
|
# comment directly above
|
|
|
|
postflight do
|
|
|
|
^^^^^^^^^^^^^ `postflight` stanza out of order
|
|
|
|
puts 'We have liftoff!'
|
2018-10-26 19:49:21 +01:00
|
|
|
end
|
2023-05-08 11:02:44 +02:00
|
|
|
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin" # comment on same line
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `on_arch_conditional` stanza out of order
|
|
|
|
end
|
|
|
|
CASK
|
|
|
|
|
|
|
|
expect_correction <<~CASK
|
|
|
|
cask 'foo' do
|
|
|
|
folder = on_arch_conditional arm: "darwin-arm64", intel: "darwin" # comment on same line
|
|
|
|
version :latest
|
|
|
|
sha256 :no_check
|
|
|
|
# comment with an empty line between
|
|
|
|
|
|
|
|
# comment directly above
|
|
|
|
postflight do
|
|
|
|
puts 'We have liftoff!'
|
2018-10-26 19:49:21 +01:00
|
|
|
end
|
2023-05-08 11:02:44 +02:00
|
|
|
end
|
|
|
|
CASK
|
2018-10-26 19:49:21 +01:00
|
|
|
end
|
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
shared_examples "caveats" do
|
|
|
|
it "reports an offense when a `caveats` stanza is out of order" do
|
|
|
|
# Indent all except the first line.
|
|
|
|
interpolated_caveats = caveats.lines.map { |l| " #{l}" }.join.strip
|
|
|
|
|
|
|
|
expect_offense <<~CASK
|
2018-10-26 19:49:21 +01:00
|
|
|
cask 'foo' do
|
|
|
|
name 'Foo'
|
2023-05-08 11:02:44 +02:00
|
|
|
^^^^^^^^^^ `name` stanza out of order
|
2018-11-28 20:51:55 +01:00
|
|
|
url 'https://foo.brew.sh/foo.zip'
|
2023-05-08 11:02:44 +02:00
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `url` stanza out of order
|
|
|
|
#{interpolated_caveats}
|
2018-10-26 19:49:21 +01:00
|
|
|
version :latest
|
2023-05-08 11:02:44 +02:00
|
|
|
^^^^^^^^^^^^^^^ `version` stanza out of order
|
2018-10-26 19:49:21 +01:00
|
|
|
app 'Foo.app'
|
|
|
|
sha256 :no_check
|
2023-05-08 11:02:44 +02:00
|
|
|
^^^^^^^^^^^^^^^^ `sha256` stanza out of order
|
2018-10-26 19:49:21 +01:00
|
|
|
end
|
|
|
|
CASK
|
2023-05-08 11:02:44 +02:00
|
|
|
|
|
|
|
# Remove offense annotations.
|
|
|
|
corrected_caveats = interpolated_caveats.gsub(/\n\s*\^+\s+.*$/, "")
|
|
|
|
|
|
|
|
expect_correction <<~CASK
|
2018-10-26 19:49:21 +01:00
|
|
|
cask 'foo' do
|
|
|
|
version :latest
|
|
|
|
sha256 :no_check
|
2018-11-28 20:51:55 +01:00
|
|
|
url 'https://foo.brew.sh/foo.zip'
|
2018-10-26 19:49:21 +01:00
|
|
|
name 'Foo'
|
|
|
|
app 'Foo.app'
|
2023-05-08 11:02:44 +02:00
|
|
|
#{corrected_caveats}
|
2018-10-26 19:49:21 +01:00
|
|
|
end
|
|
|
|
CASK
|
|
|
|
end
|
2023-05-08 11:02:44 +02:00
|
|
|
end
|
2018-10-26 19:49:21 +01:00
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
context "when caveats is a one-line string" do
|
|
|
|
let(:caveats) do
|
|
|
|
<<~CAVEATS
|
|
|
|
caveats 'This is a one-line caveat.'
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `caveats` stanza out of order
|
|
|
|
CAVEATS
|
2018-10-26 19:49:21 +01:00
|
|
|
end
|
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
include_examples "caveats"
|
|
|
|
end
|
2018-10-26 19:49:21 +01:00
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
context "when caveats is a heredoc" do
|
|
|
|
let(:caveats) do
|
|
|
|
<<~CAVEATS
|
|
|
|
caveats <<~EOS
|
|
|
|
^^^^^^^^^^^^^^ `caveats` stanza out of order
|
|
|
|
This is a multiline caveat.
|
2018-10-26 19:49:21 +01:00
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
Let's hope it doesn't cause any problems!
|
|
|
|
EOS
|
|
|
|
CAVEATS
|
2018-10-26 19:49:21 +01:00
|
|
|
end
|
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
include_examples "caveats"
|
2018-10-26 19:49:21 +01:00
|
|
|
end
|
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
context "when caveats is a block" do
|
|
|
|
let(:caveats) do
|
|
|
|
<<~CAVEATS
|
|
|
|
caveats do
|
|
|
|
^^^^^^^^^^ `caveats` stanza out of order
|
|
|
|
puts 'This is a multiline caveat.'
|
2022-08-05 15:35:25 -04:00
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
puts "Let's hope it doesn't cause any problems!"
|
2022-08-05 15:35:25 -04:00
|
|
|
end
|
2023-05-08 11:02:44 +02:00
|
|
|
CAVEATS
|
2022-08-05 15:35:25 -04:00
|
|
|
end
|
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
include_examples "caveats"
|
2022-08-05 15:35:25 -04:00
|
|
|
end
|
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
it "reports an offense when the `postflight` stanza is out of order" do
|
|
|
|
expect_offense <<~CASK
|
|
|
|
cask 'foo' do
|
|
|
|
name 'Foo'
|
|
|
|
^^^^^^^^^^ `name` stanza out of order
|
|
|
|
url 'https://foo.brew.sh/foo.zip'
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `url` stanza out of order
|
|
|
|
postflight do
|
|
|
|
^^^^^^^^^^^^^ `postflight` stanza out of order
|
|
|
|
puts 'We have liftoff!'
|
2018-10-26 19:49:21 +01:00
|
|
|
end
|
2023-05-08 11:02:44 +02:00
|
|
|
version :latest
|
|
|
|
^^^^^^^^^^^^^^^ `version` stanza out of order
|
|
|
|
app 'Foo.app'
|
|
|
|
sha256 :no_check
|
|
|
|
^^^^^^^^^^^^^^^^ `sha256` stanza out of order
|
2018-10-26 19:49:21 +01:00
|
|
|
end
|
2023-05-08 11:02:44 +02:00
|
|
|
CASK
|
|
|
|
|
|
|
|
expect_correction <<~CASK
|
|
|
|
cask 'foo' do
|
|
|
|
version :latest
|
|
|
|
sha256 :no_check
|
|
|
|
url 'https://foo.brew.sh/foo.zip'
|
|
|
|
name 'Foo'
|
|
|
|
app 'Foo.app'
|
|
|
|
postflight do
|
|
|
|
puts 'We have liftoff!'
|
|
|
|
end
|
2018-10-26 19:49:21 +01:00
|
|
|
end
|
2023-05-08 11:02:44 +02:00
|
|
|
CASK
|
2018-10-26 19:49:21 +01:00
|
|
|
end
|
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
it "supports `on_arch` blocks and their contents" do
|
|
|
|
expect_offense <<~CASK
|
|
|
|
cask 'foo' do
|
|
|
|
on_intel do
|
|
|
|
^^^^^^^^^^^ `on_intel` stanza out of order
|
|
|
|
url "https://foo.brew.sh/foo-intel.zip"
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `url` stanza out of order
|
|
|
|
|
2018-10-26 19:49:21 +01:00
|
|
|
version :latest
|
2023-05-08 11:02:44 +02:00
|
|
|
^^^^^^^^^^^^^^^ `version` stanza out of order
|
2018-10-26 19:49:21 +01:00
|
|
|
sha256 :no_check
|
2023-05-08 11:02:44 +02:00
|
|
|
^^^^^^^^^^^^^^^^ `sha256` stanza out of order
|
2018-10-26 19:49:21 +01:00
|
|
|
end
|
2023-05-08 11:02:44 +02:00
|
|
|
on_arm do
|
|
|
|
^^^^^^^^^ `on_arm` stanza out of order
|
2018-10-26 19:49:21 +01:00
|
|
|
version :latest
|
|
|
|
sha256 :no_check
|
2023-05-08 11:02:44 +02:00
|
|
|
|
|
|
|
url "https://foo.brew.sh/foo-arm.zip"
|
2018-10-26 19:49:21 +01:00
|
|
|
end
|
2023-05-08 11:02:44 +02:00
|
|
|
end
|
|
|
|
CASK
|
2018-10-26 19:49:21 +01:00
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
expect_correction <<~CASK
|
|
|
|
cask 'foo' do
|
|
|
|
on_arm do
|
|
|
|
version :latest
|
|
|
|
sha256 :no_check
|
2018-10-26 19:49:21 +01:00
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
url "https://foo.brew.sh/foo-arm.zip"
|
2023-03-14 23:08:22 +00:00
|
|
|
end
|
2023-05-08 11:02:44 +02:00
|
|
|
on_intel do
|
|
|
|
version :latest
|
2023-03-14 23:08:22 +00:00
|
|
|
|
2023-05-08 11:02:44 +02:00
|
|
|
sha256 :no_check
|
|
|
|
url "https://foo.brew.sh/foo-intel.zip"
|
2023-03-14 23:08:22 +00:00
|
|
|
end
|
2023-05-08 11:02:44 +02:00
|
|
|
end
|
|
|
|
CASK
|
2023-03-14 23:47:39 +00:00
|
|
|
end
|
|
|
|
|
2023-05-07 10:04:28 +02:00
|
|
|
it "registers an offense when `on_os` stanzas and their contents are out of order" do
|
|
|
|
expect_offense <<~CASK
|
|
|
|
cask "foo" do
|
|
|
|
on_ventura do
|
|
|
|
^^^^^^^^^^^^^ `on_ventura` stanza out of order
|
|
|
|
sha256 "abc123"
|
|
|
|
^^^^^^^^^^^^^^^ `sha256` stanza out of order
|
|
|
|
version :latest
|
|
|
|
^^^^^^^^^^^^^^^ `version` stanza out of order
|
|
|
|
url "https://foo.brew.sh/foo-ventura.zip"
|
2023-03-14 23:47:39 +00:00
|
|
|
end
|
2023-05-07 10:04:28 +02:00
|
|
|
on_catalina do
|
|
|
|
sha256 "def456"
|
|
|
|
^^^^^^^^^^^^^^^ `sha256` stanza out of order
|
|
|
|
version "0.7"
|
|
|
|
^^^^^^^^^^^^^ `version` stanza out of order
|
|
|
|
url "https://foo.brew.sh/foo-catalina.zip"
|
|
|
|
end
|
|
|
|
on_mojave do
|
|
|
|
^^^^^^^^^^^^ `on_mojave` stanza out of order
|
|
|
|
version :latest
|
|
|
|
sha256 "ghi789"
|
|
|
|
url "https://foo.brew.sh/foo-mojave.zip"
|
|
|
|
end
|
|
|
|
on_big_sur do
|
|
|
|
^^^^^^^^^^^^^ `on_big_sur` stanza out of order
|
|
|
|
sha256 "jkl012"
|
|
|
|
^^^^^^^^^^^^^^^ `sha256` stanza out of order
|
|
|
|
version :latest
|
|
|
|
^^^^^^^^^^^^^^^ `version` stanza out of order
|
2023-03-14 23:47:39 +00:00
|
|
|
|
2023-05-07 10:04:28 +02:00
|
|
|
url "https://foo.brew.sh/foo-big-sur.zip"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
CASK
|
2023-04-16 23:46:37 +01:00
|
|
|
|
2023-05-07 10:04:28 +02:00
|
|
|
expect_correction <<~CASK
|
|
|
|
cask "foo" do
|
|
|
|
on_mojave do
|
|
|
|
version :latest
|
|
|
|
sha256 "ghi789"
|
|
|
|
url "https://foo.brew.sh/foo-mojave.zip"
|
2023-03-14 23:47:39 +00:00
|
|
|
end
|
2023-05-07 10:04:28 +02:00
|
|
|
on_catalina do
|
|
|
|
version "0.7"
|
|
|
|
sha256 "def456"
|
|
|
|
url "https://foo.brew.sh/foo-catalina.zip"
|
|
|
|
end
|
|
|
|
on_big_sur do
|
|
|
|
version :latest
|
|
|
|
sha256 "jkl012"
|
2023-03-14 23:47:39 +00:00
|
|
|
|
2023-05-07 10:04:28 +02:00
|
|
|
url "https://foo.brew.sh/foo-big-sur.zip"
|
|
|
|
end
|
|
|
|
on_ventura do
|
|
|
|
version :latest
|
|
|
|
sha256 "abc123"
|
|
|
|
url "https://foo.brew.sh/foo-ventura.zip"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
CASK
|
2023-03-14 23:47:39 +00:00
|
|
|
end
|
2018-10-26 19:49:21 +01:00
|
|
|
end
|