Class: TapConfig

Inherits:
Object show all
Defined in:
tap.rb

Overview

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tap) ⇒ void

Parameters:



1028
1029
1030
# File 'tap.rb', line 1028

def initialize(tap)
  @tap = tap
end

Instance Attribute Details

#tapObject (readonly)

Returns the value of attribute tap.



1025
1026
1027
# File 'tap.rb', line 1025

def tap
  @tap
end

Instance Method Details

#[](key) ⇒ Object



1032
1033
1034
1035
1036
1037
# File 'tap.rb', line 1032

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

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

#[]=(key, value) ⇒ Object



1039
1040
1041
1042
1043
1044
# File 'tap.rb', line 1039

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) ⇒ Object



1046
1047
1048
1049
1050
1051
# File 'tap.rb', line 1046

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

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