Skip to content

Commit

Permalink
Add type signatures for TapConfig.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Mar 4, 2024
1 parent 8d4e841 commit 9b08a03
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Library/Homebrew/tap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1344,20 +1344,23 @@ def initialize(tap)
@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?

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?

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?
Expand Down

0 comments on commit 9b08a03

Please sign in to comment.