Spec-Zone.ru › Homebrew

Class: Cask::Artifact::Symlinked Private

Inherits:
Relocated
  • Object
  • AbstractArtifact
  • Relocated
  • Cask::Artifact::Symlinked
show all
Includes:
OS::Mac::Cask::Artifact::Symlinked
Defined in:
cask/artifact/symlinked.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.

Superclass for all artifacts which are installed by symlinking them to the target location.

Direct Known Subclasses

AppImage, Binary, Manpage, ShellCompletion

Constant Summary

Constants inherited from AbstractArtifact

AbstractArtifact::DirectivesType

Instance Attribute Summary

Attributes inherited from AbstractArtifact

#cask

Class Method Summary collapse

  • .english_description ⇒ String private
  • .link_type_english_name ⇒ String private

Instance Method Summary collapse

  • #install_phase(force: false, adopt: false, command: SystemCommand, **options) ⇒ void private
  • #summarize_installed ⇒ String private
  • #uninstall_phase(command: SystemCommand, **_options) ⇒ void private

Methods inherited from Relocated

from_args, #initialize, #resolve_target, #source, #summarize, #target, #to_a

Methods included from OS::Linux::Cask::Artifact::Relocated

#add_altname_metadata

Methods inherited from AbstractArtifact

#cask_sandbox, #cask_sandbox_command, #config, dirmethod, dsl_key, english_article, english_name, #initialize, read_script_arguments, #run_cask_sandbox, #sort_order, #staged_path_join_executable, #summarize, #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, #pretty_warning

Constructor Details

This class inherits a constructor from Cask::Artifact::Relocated

Class Method Details

.english_description ⇒ 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.

Returns:

  • (String)


16
17
18
# File 'cask/artifact/symlinked.rb', line 16

def self.english_description
  "#{english_name}#{link_type_english_name}s"
end

.link_type_english_name ⇒ 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.

Returns:

  • (String)


11
12
13
# File 'cask/artifact/symlinked.rb', line 11

def self.link_type_english_name
  "Symlink"
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.

Parameters:

  • force (Boolean) (defaults to: false)
  • adopt (Boolean) (defaults to: false)
  • command (T.class_of(SystemCommand)) (defaults to: SystemCommand)
  • options (T.anything)


28
29
30
# File 'cask/artifact/symlinked.rb', line 28

def install_phase(force: false, adopt: false, command: SystemCommand, **options)
  link(force:, adopt:, command:, **options)
end

#summarize_installed ⇒ 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.

Returns:

  • (String)


43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'cask/artifact/symlinked.rb', line 43

def summarize_installed
  if target.symlink? && target.exist? && target.readlink.exist?
    "#{printable_target} -> #{target.readlink} (#{target.readlink.abv})"
  else
    string = if target.symlink?
      "#{printable_target} -> #{target.readlink}"
    else
      printable_target
    end

    Formatter.error(string, label: "Broken Link")
  end
end

#uninstall_phase(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.

Parameters:

  • command (T.class_of(SystemCommand)) (defaults to: SystemCommand)
  • _options (T.anything)


38
39
40
# File 'cask/artifact/symlinked.rb', line 38

def uninstall_phase(command: SystemCommand, **_options)
  unlink(command:)
end

© 2009–present Homebrew contributors
Licensed under the BSD 2-Clause License.
https://docs.brew.sh/rubydoc/Cask/Artifact/Symlinked.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API