Class: Cask::Artifact::CommandWrapper Private
- Inherits:
-
Binary
- Object
- AbstractArtifact
- Relocated
- Symlinked
- Binary
- Cask::Artifact::CommandWrapper
- Defined in:
- cask/artifact/command_wrapper.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.
Artifact corresponding to the command_wrapper stanza.
Constant Summary
Constants inherited from AbstractArtifact
AbstractArtifact::DirectivesType
Instance Attribute Summary
Attributes inherited from AbstractArtifact
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(cask, source, target:, content:) ⇒ void constructor private
- #install_phase(force: false, adopt: false, command: SystemCommand, **options) ⇒ void private
- #to_args ⇒ Array<T.anything> private
Methods inherited from Binary
Methods inherited from Symlinked
english_description, link_type_english_name, #summarize_installed, #uninstall_phase
Methods included from OS::Mac::Cask::Artifact::Symlinked
Methods inherited from Relocated
#resolve_target, #source, #summarize, #target, #to_a
Methods included from OS::Linux::Cask::Artifact::Relocated
Methods inherited from AbstractArtifact
#cask_sandbox, #cask_sandbox_command, #config, dsl_key, english_article, english_name, read_script_arguments, #run_cask_sandbox, #sort_order, #staged_path_join_executable, #summarize
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_unmarked, #pretty_upgradable, #pretty_warning
Constructor Details
#initialize(cask, source, target:, content:) ⇒ 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.
37 38 39 40 41 42 |
# File 'cask/artifact/command_wrapper.rb', line 37 def initialize(cask, source, target:, content:) raise CaskInvalidError.new(cask, "'command_wrapper' requires content") if content.blank? super(cask, source, target:) @content = content end |
Class Method Details
.dirmethod ⇒ Symbol
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.
11 |
# File 'cask/artifact/command_wrapper.rb', line 11 def self.dirmethod = :binarydir |
.from_args(cask, source, options = nil) ⇒ T.attached_class
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.
20 21 22 23 24 25 26 27 |
# File 'cask/artifact/command_wrapper.rb', line 20 def self.from_args(cask, source, = nil) ||= {} .assert_valid_keys(:target, :content) raise CaskInvalidError.new(cask, "'command_wrapper' requires target") unless .key?(:target) raise CaskInvalidError.new(cask, "'command_wrapper' requires content") unless .key?(:content) new(cask, source, **) end |
Instance Method Details
#install_phase(force: false, adopt: false, command: SystemCommand, **options) ⇒ 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.
This method returns an undefined value.
52 53 54 55 56 |
# File 'cask/artifact/command_wrapper.rb', line 52 def install_phase(force: false, adopt: false, command: SystemCommand, **) source.dirname.mkpath source.write(@content) super end |
#to_args ⇒ Array<T.anything>
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.
59 60 61 |
# File 'cask/artifact/command_wrapper.rb', line 59 def to_args [@source_string, { target: @target_string, content: @content }] end |