Class: Cask::Artifact::BashCompletion Private

Inherits:
ShellCompletion show all
Defined in:
cask/artifact/bashcompletion.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 bash_completion stanza.

Instance Attribute Summary

Attributes inherited from AbstractArtifact

#cask

Instance Method Summary collapse

Methods inherited from ShellCompletion

from_args

Methods inherited from Symlinked

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

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

#create_filesystem_link

Methods included from OS::Mac::Cask::Artifact::Symlinked

#create_filesystem_link

Methods inherited from Relocated

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

Methods inherited from AbstractArtifact

#config, dirmethod, dsl_key, english_article, english_name, #initialize, read_script_arguments, #staged_path_join_executable, #summarize, #to_args

Constructor Details

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

Instance Method Details

#resolve_target(target) ⇒ Pathname

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.

Parameters:

Returns:



11
12
13
14
15
16
17
18
19
20
21
22
# File 'cask/artifact/bashcompletion.rb', line 11

def resolve_target(target)
  name = if File.extname(target).nil?
    target
  else
    new_name = File.basename(target, File.extname(target))
    odebug "Renaming completion #{target} to #{new_name}"

    new_name
  end

  config.bash_completion/name
end