diff --git a/Library/Homebrew/cask/artifact/appimage.rb b/Library/Homebrew/cask/artifact/appimage.rb index edf00aa98c..0993110845 100644 --- a/Library/Homebrew/cask/artifact/appimage.rb +++ b/Library/Homebrew/cask/artifact/appimage.rb @@ -5,6 +5,7 @@ require "cask/artifact/symlinked" module Cask module Artifact + # Artifact corresponding to the `app_image` stanza. class AppImage < Symlinked sig { override.params(target: T.any(String, Pathname), base_dir: T.nilable(Pathname)).returns(Pathname) } def resolve_target(target, base_dir: nil) diff --git a/Library/Homebrew/cask/artifact/install_steps.rb b/Library/Homebrew/cask/artifact/install_steps.rb index cb6d8e5874..b8b11da525 100644 --- a/Library/Homebrew/cask/artifact/install_steps.rb +++ b/Library/Homebrew/cask/artifact/install_steps.rb @@ -6,6 +6,7 @@ require "install_steps" module Cask module Artifact + # Abstract superclass for install steps artifacts. class AbstractInstallSteps < AbstractArtifact abstract! @@ -34,6 +35,7 @@ module Cask end end + # Artifact corresponding to the `preflight_steps` stanza. class PreflightSteps < AbstractInstallSteps sig { params(command: T.class_of(SystemCommand), _options: T.anything).void } def install_phase(command: SystemCommand, **_options) @@ -46,6 +48,7 @@ module Cask end end + # Artifact corresponding to the `postflight_steps` stanza. class PostflightSteps < AbstractInstallSteps sig { params(command: T.class_of(SystemCommand), _options: T.anything).void } def install_phase(command: SystemCommand, **_options) @@ -58,6 +61,7 @@ module Cask end end + # Artifact corresponding to the `uninstall_preflight_steps` stanza. class UninstallPreflightSteps < AbstractInstallSteps sig { params(command: T.class_of(SystemCommand), _options: T.anything).void } def uninstall_phase(command: SystemCommand, **_options) @@ -65,6 +69,7 @@ module Cask end end + # Artifact corresponding to the `uninstall_postflight_steps` stanza. class UninstallPostflightSteps < AbstractInstallSteps sig { params(command: T.class_of(SystemCommand), _options: T.anything).void } def uninstall_phase(command: SystemCommand, **_options) diff --git a/Library/Homebrew/cask/artifact/shellcompletion.rb b/Library/Homebrew/cask/artifact/shellcompletion.rb index 41e1fdf1f8..ec58d5b314 100644 --- a/Library/Homebrew/cask/artifact/shellcompletion.rb +++ b/Library/Homebrew/cask/artifact/shellcompletion.rb @@ -5,6 +5,7 @@ require "cask/artifact/symlinked" module Cask module Artifact + # Superclass for all artifacts that are installed as shell completions. class ShellCompletion < Symlinked sig { override.overridable.params(_: T.any(String, Pathname), base_dir: T.nilable(Pathname)).returns(Pathname) } def resolve_target(_, base_dir: nil) diff --git a/Library/Homebrew/rubocops/cask/constants/stanza.rb b/Library/Homebrew/rubocops/cask/constants/stanza.rb index 2a66f6053f..5e84651962 100644 --- a/Library/Homebrew/rubocops/cask/constants/stanza.rb +++ b/Library/Homebrew/rubocops/cask/constants/stanza.rb @@ -42,7 +42,7 @@ module RuboCop [ :suite, :app, - :appimage, + :app_image, :pkg, :generated_script, :installer, diff --git a/Library/Homebrew/test/rubocops/cask/stanza_order_spec.rb b/Library/Homebrew/test/rubocops/cask/stanza_order_spec.rb index f4677125c8..d578bc4b66 100644 --- a/Library/Homebrew/test/rubocops/cask/stanza_order_spec.rb +++ b/Library/Homebrew/test/rubocops/cask/stanza_order_spec.rb @@ -16,7 +16,7 @@ RSpec.describe RuboCop::Cop::Cask::StanzaOrder, :config do :on_macos, :on_linux, :on_system_conditional, - :appimage, + :app_image, :generated_script, :command_wrapper, :generate_completions_from_executable, @@ -86,11 +86,11 @@ RSpec.describe RuboCop::Cop::Cask::StanzaOrder, :config do CASK end - it "orders `appimage` after `app`" do + it "orders `app_image` after `app`" do expect_offense <<~CASK cask 'foo' do - appimage 'Foo.AppImage' - ^^^^^^^^^^^^^^^^^^^^^^^ `appimage` stanza out of order + app_image 'Foo.AppImage' + ^^^^^^^^^^^^^^^^^^^^^^^^ `app_image` stanza out of order app 'Foo.app' ^^^^^^^^^^^^^ `app` stanza out of order end @@ -99,7 +99,7 @@ RSpec.describe RuboCop::Cop::Cask::StanzaOrder, :config do expect_correction <<~CASK cask 'foo' do app 'Foo.app' - appimage 'Foo.AppImage' + app_image 'Foo.AppImage' end CASK end diff --git a/docs/Cask-Cookbook.md b/docs/Cask-Cookbook.md index 14207bc264..ff2c799d90 100644 --- a/docs/Cask-Cookbook.md +++ b/docs/Cask-Cookbook.md @@ -74,7 +74,7 @@ Having a common order for stanzas makes casks easier to update and parse. Below suite app - appimage + app_image pkg generated_script installer @@ -145,13 +145,13 @@ This skips automated homepage availability audits for one year. Do not use a fut Each cask must declare one or more [artifacts](/rubydoc/Cask/Artifact.html) (i.e. something to install). Not every artifact type is supported on every operating system and a cask does not need to support both macOS and Linux. -The `appimage` stanza is Linux-only, macOS integration stanzas such as `app` and `pkg` are macOS-only and portable stanzas such as `binary` can be used on either operating system. +The `app_image` stanza is Linux-only, macOS integration stanzas such as `app` and `pkg` are macOS-only and portable stanzas such as `binary` can be used on either operating system. | name | multiple occurrences allowed? | value | | -------------------------------------------------------------------------------------- | :---------------------------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [`suite`](#stanza-suite) | yes | Relative path to a containing directory that should be moved into the `/Applications` folder on installation. | | [`app`](#stanza-app) | yes | Relative path to an `.app` that should be moved into the `/Applications` folder on installation. | -| `appimage` | yes | Relative path to an AppImage that should be linked into the configured AppImage directory on installation. | +| `app_image` | yes | Relative path to an AppImage that should be linked into the configured AppImage directory on installation. | | [`pkg`](#stanza-pkg) | yes | Relative path to a `.pkg` file containing the distribution. | | [`generated_script`](#stanza-generated_script) | yes | Generates a script for another artifact or install step to use. | | [`installer`](#stanza-installer) | yes | Describes an executable which must be run to complete the installation. |