Class: TapConfig

Inherits:
Object
  • 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) ⇒ TapConfig

Returns a new instance of TapConfig.



950
951
952
# File 'tap.rb', line 950

def initialize(tap)
  @tap = tap
end

Instance Attribute Details

#tapObject (readonly)

Returns the value of attribute tap.



948
949
950
# File 'tap.rb', line 948

def tap
  @tap
end

Instance Method Details

#[](key) ⇒ Object



954
955
956
957
958
959
# File 'tap.rb', line 954

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

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

#[]=(key, value) ⇒ Object



961
962
963
964
965
966
# File 'tap.rb', line 961

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



968
969
970
971
972
973
# File 'tap.rb', line 968

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

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