mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Merge pull request #16811 from reitermarkus/tapconfig-sig
Add type signatures for `TapConfig`.
This commit is contained in:
commit
a9f655b515
@ -1338,6 +1338,7 @@ end
|
|||||||
|
|
||||||
# Permanent configuration per {Tap} using `git-config(1)`.
|
# Permanent configuration per {Tap} using `git-config(1)`.
|
||||||
class TapConfig
|
class TapConfig
|
||||||
|
sig { returns(Tap) }
|
||||||
attr_reader :tap
|
attr_reader :tap
|
||||||
|
|
||||||
sig { params(tap: Tap).void }
|
sig { params(tap: Tap).void }
|
||||||
@ -1345,6 +1346,7 @@ class TapConfig
|
|||||||
@tap = tap
|
@tap = tap
|
||||||
end
|
end
|
||||||
|
|
||||||
|
sig { params(key: T.any(Symbol, String)).returns(T.nilable(String)) }
|
||||||
def [](key)
|
def [](key)
|
||||||
return unless tap.git?
|
return unless tap.git?
|
||||||
return unless Utils::Git.available?
|
return unless Utils::Git.available?
|
||||||
@ -1352,6 +1354,7 @@ class TapConfig
|
|||||||
Homebrew::Settings.read key, repo: tap.path
|
Homebrew::Settings.read key, repo: tap.path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
sig { params(key: T.any(Symbol, String), value: T.any(T::Boolean, String)).void }
|
||||||
def []=(key, value)
|
def []=(key, value)
|
||||||
return unless tap.git?
|
return unless tap.git?
|
||||||
return unless Utils::Git.available?
|
return unless Utils::Git.available?
|
||||||
@ -1359,6 +1362,7 @@ class TapConfig
|
|||||||
Homebrew::Settings.write key, value.to_s, repo: tap.path
|
Homebrew::Settings.write key, value.to_s, repo: tap.path
|
||||||
end
|
end
|
||||||
|
|
||||||
|
sig { params(key: T.any(Symbol, String)).void }
|
||||||
def delete(key)
|
def delete(key)
|
||||||
return unless tap.git?
|
return unless tap.git?
|
||||||
return unless Utils::Git.available?
|
return unless Utils::Git.available?
|
||||||
|
Loading…
x
Reference in New Issue
Block a user