Class: Cask::Artifact::AbstractUninstall Private
- Inherits:
-
AbstractArtifact
- Object
- AbstractArtifact
- Cask::Artifact::AbstractUninstall
- Defined in:
- cask/artifact/abstract_uninstall.rb
Overview
This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.
Abstract superclass for uninstall artifacts.
Constant Summary collapse
- ORDERED_DIRECTIVES =
This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.
[ :early_script, :launchctl, :quit, :signal, :login_item, :kext, :script, :pkgutil, :delete, :trash, :rmdir, ].freeze
- METADATA_KEYS =
This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.
[ :on_upgrade, ].freeze
Constants inherited from AbstractArtifact
Cask::Artifact::AbstractArtifact::DirectivesType
Instance Attribute Summary collapse
- #directives ⇒ Hash{Symbol => DirectivesType} readonly private
Attributes inherited from AbstractArtifact
Class Method Summary collapse
Instance Method Summary collapse
- #bundle_ids_to_reopen ⇒ Array<String> private
- #initialize(cask, **directives) ⇒ void constructor private
- #summarize ⇒ String private
- #to_h ⇒ Hash{Symbol => DirectivesType} private
Methods included from SystemCommand::Mixin
#system_command, #system_command!
Methods inherited from AbstractArtifact
#cask_sandbox, #cask_sandbox_command, #config, dirmethod, dsl_key, english_article, english_name, read_script_arguments, #run_cask_sandbox, #sort_order, #staged_path_join_executable, #to_args
Methods included from Utils::Output::Mixin
#issue_reporting_message, #odebug, #odeprecated, #odie, #odisabled, #ofail, #oh1, #oh1_title, #ohai, #ohai_title, #onoe, #opoo, #opoo_outside_github_actions, #opoo_without_github_actions_annotation, #pretty_deprecated, #pretty_disabled, #pretty_duration, #pretty_install_status, #pretty_installed, #pretty_uninstalled, #pretty_upgradable
Constructor Details
#initialize(cask, **directives) ⇒ void
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'cask/artifact/abstract_uninstall.rb', line 47 def initialize(cask, **directives) directives.assert_valid_keys(*ORDERED_DIRECTIVES, *METADATA_KEYS) super directives[:signal] = Array(directives[:signal]).flatten.each_slice(2).to_a @directives = directives # This is already included when loading from the API. return if cask.loaded_from_api? return unless directives.key?(:kext) cask.caveats do T.bind(self, ::Cask::DSL::Caveats) kext end end |
Instance Attribute Details
#directives ⇒ Hash{Symbol => DirectivesType} (readonly)
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
44 45 46 |
# File 'cask/artifact/abstract_uninstall.rb', line 44 def directives @directives end |
Class Method Details
.from_args(cask, **directives) ⇒ AbstractUninstall
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
39 40 41 |
# File 'cask/artifact/abstract_uninstall.rb', line 39 def self.from_args(cask, **directives) new(cask, **directives) end |
Instance Method Details
#bundle_ids_to_reopen ⇒ Array<String>
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
75 76 77 |
# File 'cask/artifact/abstract_uninstall.rb', line 75 def bundle_ids_to_reopen @bundle_ids_to_reopen ||= T.let([], T.nilable(T::Array[String])) end |
#summarize ⇒ String
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
70 71 72 |
# File 'cask/artifact/abstract_uninstall.rb', line 70 def summarize to_h.flat_map { |key, val| Array(val).map { |v| "#{key.inspect} => #{v.inspect}" } }.join(", ") end |
#to_h ⇒ Hash{Symbol => DirectivesType}
This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.
65 66 67 |
# File 'cask/artifact/abstract_uninstall.rb', line 65 def to_h directives.to_h end |