Spec-Zone.ru › Homebrew

Class: Cask::Artifact::Manpage Private

Inherits:
Symlinked
  • Object
  • AbstractArtifact
  • Relocated
  • Symlinked
  • Cask::Artifact::Manpage
show all
Defined in:
cask/artifact/manpage.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 manpage stanza.

Constant Summary

Constants inherited from AbstractArtifact

AbstractArtifact::DirectivesType

Instance Attribute Summary collapse

  • #section ⇒ String readonly private

Attributes inherited from AbstractArtifact

#cask

Class Method Summary collapse

  • .from_args(cask, source, _target_hash = nil) ⇒ T.attached_class private

Instance Method Summary collapse

  • #initialize(cask, source, section) ⇒ void constructor private
  • #resolve_target(target, base_dir: nil) ⇒ Pathname private

Methods inherited from Symlinked

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

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

#create_filesystem_link

Methods inherited from Relocated

#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, 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

#initialize(cask, source, section) ⇒ 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.

Parameters:

  • cask (Cask)
  • source (String, Pathname)
  • section (String)


29
30
31
32
33
# File 'cask/artifact/manpage.rb', line 29

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

  super(cask, source)
end

Instance Attribute Details

#section ⇒ String (readonly)

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/manpage.rb', line 11

def section
  @section
end

Class Method Details

.from_args(cask, source, _target_hash = 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.

Parameters:

  • cask (Cask)
  • source (String, Pathname)
  • _target_hash (T.anything) (defaults to: nil)

Returns:

  • (T.attached_class)

Raises:

  • (CaskInvalidError)


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

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

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

  new(cask, source, section)
end

Instance Method Details

#resolve_target(target, base_dir: nil) ⇒ 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:

  • target (String, Pathname)
  • base_dir (Pathname, nil) (defaults to: nil)

Returns:

  • (Pathname)


36
37
38
# File 'cask/artifact/manpage.rb', line 36

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

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

Spec-Zone.ru

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