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.



904
905
906
# File 'tap.rb', line 904

def initialize(tap)
  @tap = tap
end

Instance Attribute Details

#tapObject (readonly)

Returns the value of attribute tap.



902
903
904
# File 'tap.rb', line 902

def tap
  @tap
end

Instance Method Details

#[](key) ⇒ Object



908
909
910
911
912
913
# File 'tap.rb', line 908

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

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

#[]=(key, value) ⇒ Object



915
916
917
918
919
920
# File 'tap.rb', line 915

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

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