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.



933
934
935
# File 'tap.rb', line 933

def initialize(tap)
  @tap = tap
end

Instance Attribute Details

#tapObject (readonly)

Returns the value of attribute tap.



931
932
933
# File 'tap.rb', line 931

def tap
  @tap
end

Instance Method Details

#[](key) ⇒ Object



937
938
939
940
941
942
# File 'tap.rb', line 937

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

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

#[]=(key, value) ⇒ Object



944
945
946
947
948
949
# File 'tap.rb', line 944

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



951
952
953
954
955
956
# File 'tap.rb', line 951

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

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