Class: TapConfig
- Inherits:
-
Object
- Object
- TapConfig
- Defined in:
- Library/Homebrew/tap.rb
Overview
Permanent configuration per Tap using git-config(1)
.
Instance Attribute Summary collapse
-
#tap ⇒ Object
readonly
Returns the value of attribute tap.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
-
#initialize(tap) ⇒ TapConfig
constructor
A new instance of TapConfig.
Constructor Details
#initialize(tap) ⇒ TapConfig
Returns a new instance of TapConfig.
707 708 709 |
# File 'Library/Homebrew/tap.rb', line 707 def initialize(tap) @tap = tap end |
Instance Attribute Details
#tap ⇒ Object (readonly)
Returns the value of attribute tap
705 706 707 |
# File 'Library/Homebrew/tap.rb', line 705 def tap @tap end |
Instance Method Details
#[](key) ⇒ Object
711 712 713 714 715 716 717 718 |
# File 'Library/Homebrew/tap.rb', line 711 def [](key) return unless tap.git? return unless Utils::Git.available? tap.path.cd do Utils.popen_read("git", "config", "--get", "homebrew.#{key}").chomp.presence end end |
#[]=(key, value) ⇒ Object
720 721 722 723 724 725 726 727 |
# File 'Library/Homebrew/tap.rb', line 720 def []=(key, value) return unless tap.git? return unless Utils::Git.available? tap.path.cd do safe_system "git", "config", "--replace-all", "homebrew.#{key}", value.to_s end end |