Class: Cask::Artifact::Binary Private

Inherits:
Symlinked show all
Defined in:
Library/Homebrew/cask/artifact/binary.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Artifact corresponding to the binary stanza.

Instance Attribute Summary

Attributes inherited from Relocated

#source, #target

Attributes inherited from AbstractArtifact

#cask

Instance Method Summary collapse

Methods inherited from Symlinked

english_description, #install_phase, link_type_english_name, #summarize_installed, #uninstall_phase

Methods inherited from Relocated

from_args, #initialize, #resolve_target, #summarize, #to_a

Methods inherited from AbstractArtifact

#<=>, #config, dirmethod, dsl_key, english_article, english_name, #initialize, read_script_arguments, #staged_path_join_executable, #to_s

Methods included from Predicable

#attr_predicate

Constructor Details

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

Instance Method Details

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.


12
13
14
15
16
17
18
19
20
21
# File 'Library/Homebrew/cask/artifact/binary.rb', line 12

def link(command: nil, **options)
  super(command: command, **options)
  return if source.executable?

  if source.writable?
    FileUtils.chmod "+x", source
  else
    command.run!("/bin/chmod", args: ["+x", source], sudo: true)
  end
end