diff options
| author | Josh Hagins | 2016-10-24 09:50:33 -0400 |
|---|---|---|
| committer | Josh Hagins | 2016-10-24 09:50:33 -0400 |
| commit | b2870c2480744aa7d202c4975e3169b05035f7ed (patch) | |
| tree | cce4ec1732e60b15c771865c8101ee8b1760c451 /Library | |
| parent | c7e6613f7b3144c9ee45d140978e713a89977d6d (diff) | |
| download | brew-b2870c2480744aa7d202c4975e3169b05035f7ed.tar.bz2 | |
hbc/qualified_token: use regex captures instead of String#split
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/qualified_token.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/qualified_token.rb b/Library/Homebrew/cask/lib/hbc/qualified_token.rb index 21fe99682..09eedef1b 100644 --- a/Library/Homebrew/cask/lib/hbc/qualified_token.rb +++ b/Library/Homebrew/cask/lib/hbc/qualified_token.rb @@ -2,10 +2,8 @@ module Hbc module QualifiedToken def self.parse(arg) return nil unless arg.is_a?(String) - return nil unless arg.downcase =~ HOMEBREW_TAP_CASK_REGEX - # eg caskroom/cask/google-chrome - # per https://github.com/Homebrew/brew/blob/master/docs/brew-tap.md - user, repo, token = arg.downcase.split("/") + return nil unless match = arg.downcase.match(HOMEBREW_TAP_CASK_REGEX) + user, repo, token = match.captures odebug "[user, repo, token] might be [#{user}, #{repo}, #{token}]" [user, repo, token] end |
