mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Add type signatures for TapConfig
.
This commit is contained in:
parent
8d4e841965
commit
00d69284e4
@ -1337,6 +1337,7 @@ end
|
||||
|
||||
# Permanent configuration per {Tap} using `git-config(1)`.
|
||||
class TapConfig
|
||||
sig { returns(Tap) }
|
||||
attr_reader :tap
|
||||
|
||||
sig { params(tap: Tap).void }
|
||||
@ -1344,6 +1345,7 @@ class TapConfig
|
||||
@tap = tap
|
||||
end
|
||||
|
||||
sig { params(key: T.any(Symbol, String)).returns(T.nilable(String)) }
|
||||
def [](key)
|
||||
return unless tap.git?
|
||||
return unless Utils::Git.available?
|
||||
@ -1351,6 +1353,7 @@ class TapConfig
|
||||
Homebrew::Settings.read key, repo: tap.path
|
||||
end
|
||||
|
||||
sig { params(key: T.any(Symbol, String), value: T.any(T::Boolean, String)).void }
|
||||
def []=(key, value)
|
||||
return unless tap.git?
|
||||
return unless Utils::Git.available?
|
||||
@ -1358,6 +1361,7 @@ class TapConfig
|
||||
Homebrew::Settings.write key, value.to_s, repo: tap.path
|
||||
end
|
||||
|
||||
sig { params(key: T.any(Symbol, String)).void }
|
||||
def delete(key)
|
||||
return unless tap.git?
|
||||
return unless Utils::Git.available?
|
||||
|
Loading…
x
Reference in New Issue
Block a user