Spec-Zone.ru › Homebrew

Class: TapConfig Private

Inherits:
Object
  • Object
  • TapConfig
show all
Defined in:
tap/tap_config.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.

Permanent configuration per Tap using git-config(1).

Instance Attribute Summary collapse

  • #tap ⇒ Tap readonly private

Instance Method Summary collapse

  • #[](key) ⇒ Boolean? private
  • #[]=(key, value) ⇒ void private
  • #delete(key) ⇒ void private
  • #initialize(tap) ⇒ void constructor private

Constructor Details

#initialize(tap) ⇒ 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:

  • tap (Tap)


10
11
12
# File 'tap/tap_config.rb', line 10

def initialize(tap)
  @tap = tap
end

Instance Attribute Details

#tap ⇒ Tap (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:

  • (Tap)


7
8
9
# File 'tap/tap_config.rb', line 7

def tap
  @tap
end

Instance Method Details

#[](key) ⇒ Boolean?

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:

  • key (Symbol)

Returns:

  • (Boolean, nil)


15
16
17
18
19
20
21
22
23
# File 'tap/tap_config.rb', line 15

def [](key)
  return unless tap.git?
  return unless Utils::Git.available?

  case Homebrew::Settings.read(key, repo: tap.path)
  when "true" then true
  when "false" then false
  end
end

#[]=(key, value) ⇒ 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:

  • key (Symbol)
  • value (Boolean)


26
27
28
29
30
31
# File 'tap/tap_config.rb', line 26

def []=(key, value)
  return unless tap.git?
  return unless Utils::Git.available?

  Homebrew::Settings.write key, value.to_s, repo: tap.path
end

#delete(key) ⇒ 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:

  • key (Symbol)


34
35
36
37
38
39
# File 'tap/tap_config.rb', line 34

def delete(key)
  return unless tap.git?
  return unless Utils::Git.available?

  Homebrew::Settings.delete key, repo: tap.path
end

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

Spec-Zone.ru

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