Skip to content

Commit

Permalink
Fix loading versioned casks/formulae from API.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Feb 9, 2024
1 parent a0eec8a commit 45f5040
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Library/Homebrew/tap_constants.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@
# Match taps' formulae, e.g. `someuser/sometap/someformula`
HOMEBREW_TAP_FORMULA_REGEX = T.let(%r{^(?<user>[\w-]+)/(?<repo>[\w-]+)/(?<name>[\w+-.@]+)$}, Regexp)
# Match default formula taps' formulae, e.g. `homebrew/core/someformula` or `someformula`
HOMEBREW_DEFAULT_TAP_FORMULA_REGEX = T.let(%r{^(?:[Hh]omebrew/(?:homebrew-)?core/)?(?<name>[a-z0-9\-_]+)$}, Regexp)
HOMEBREW_DEFAULT_TAP_FORMULA_REGEX = T.let(
%r{^(?:[Hh]omebrew/(?:homebrew-)?core/)?(?<name>[a-z0-9\-_]+(?:@[a-z0-9\-_.]+)?)$},
Regexp,
)
# Match taps' casks, e.g. `someuser/sometap/somecask`
HOMEBREW_TAP_CASK_REGEX = T.let(%r{^([\w-]+)/([\w-]+)/([a-z0-9\-_]+)$}, Regexp)
# Match default cask taps' casks, e.g. `homebrew/cask/somecask` or `somecask`
HOMEBREW_DEFAULT_TAP_CASK_REGEX = T.let(
%r{^(?:[Hh]omebrew/(?:homebrew-)?cask/)?(?<token>[a-z0-9\-_]+)$}, Regexp
%r{^(?:[Hh]omebrew/(?:homebrew-)?cask/)?(?<token>[a-z0-9\-_]+(?:@[a-z0-9\-_.]+)?)$},
Regexp,
)
# Match taps' directory paths, e.g. `HOMEBREW_LIBRARY/Taps/someuser/sometap`
HOMEBREW_TAP_DIR_REGEX = T.let(
Expand Down

0 comments on commit 45f5040

Please sign in to comment.