Class: TapConfig Private

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

Instance Method Summary collapse

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:



1492
1493
1494
# File 'tap.rb', line 1492

def initialize(tap)
  @tap = tap
end

Instance Attribute Details

#tapTap (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:



1489
1490
1491
# File 'tap.rb', line 1489

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:

Returns:

  • (Boolean, nil)


1497
1498
1499
1500
1501
1502
1503
1504
1505
# File 'tap.rb', line 1497

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)


1508
1509
1510
1511
1512
1513
# File 'tap.rb', line 1508

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:



1516
1517
1518
1519
1520
1521
# File 'tap.rb', line 1516

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

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