Class: Cask::Artifact::Manpage Private

Inherits:
Symlinked show all
Defined in:
Library/Homebrew/cask/artifact/manpage.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 manpage stanza.

Instance Attribute Summary collapse

Attributes inherited from Relocated

#source, #target

Attributes inherited from AbstractArtifact

#cask

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Symlinked

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

Methods inherited from Relocated

#summarize, #to_a

Methods inherited from AbstractArtifact

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

Methods included from Predicable

#attr_predicate

Constructor Details

#initialize(cask, source, section) ⇒ Manpage

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.

Returns a new instance of Manpage.


22
23
24
25
26
# File 'Library/Homebrew/cask/artifact/manpage.rb', line 22

def initialize(cask, source, section)
  @section = section

  super(cask, source)
end

Instance Attribute Details

#sectionObject (readonly)

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
# File 'Library/Homebrew/cask/artifact/manpage.rb', line 12

def section
  @section
end

Class Method Details

.from_args(cask, source) ⇒ Object

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.

Raises:


14
15
16
17
18
19
20
# File 'Library/Homebrew/cask/artifact/manpage.rb', line 14

def self.from_args(cask, source)
  section = source.to_s[/\.([1-8]|n|l)$/, 1]

  raise CaskInvalidError, "'#{source}' is not a valid man page name" unless section

  new(cask, source, section)
end

Instance Method Details

#resolve_target(target) ⇒ Object

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.


28
29
30
# File 'Library/Homebrew/cask/artifact/manpage.rb', line 28

def resolve_target(target)
  config.manpagedir.join("man#{section}", target)
end