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:



1226
1227
1228
# File 'tap.rb', line 1226

def initialize(tap)
  @tap = tap
end

Instance Attribute Details

#tapObject (readonly)

Returns the value of attribute tap.



1223
1224
1225
# File 'tap.rb', line 1223

def tap
  @tap
end

Instance Method Details

#[](key) ⇒ Object



1230
1231
1232
1233
1234
1235
# File 'tap.rb', line 1230

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

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

#[]=(key, value) ⇒ Object



1237
1238
1239
1240
1241
1242
# File 'tap.rb', line 1237

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



1244
1245
1246
1247
1248
1249
# File 'tap.rb', line 1244

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

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