diff options
| author | Josh Hagins | 2016-10-19 20:44:55 -0400 |
|---|---|---|
| committer | GitHub | 2016-10-19 20:44:55 -0400 |
| commit | f79cb2ba307271645aaa6cc37fc3b4d3c16ebe62 (patch) | |
| tree | 37a0749544141dbd6594b9427bdd4bcf2765b499 /Library/Homebrew/cask/lib | |
| parent | fb29a31c72a21bb4cae0b5830ce3407e3a3d068e (diff) | |
| parent | 154237ba8eea0be4d6b6a25b67cced4a4fecda9d (diff) | |
| download | brew-f79cb2ba307271645aaa6cc37fc3b4d3c16ebe62.tar.bz2 | |
Merge pull request #1325 from vin047/numbered-usernames
fix 'cask info' for external repos with numbers
Diffstat (limited to 'Library/Homebrew/cask/lib')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/cli/info.rb | 8 | ||||
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/qualified_token.rb | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli/info.rb b/Library/Homebrew/cask/lib/hbc/cli/info.rb index 0957ba4fd..be6feb63b 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/info.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/info.rb @@ -20,7 +20,7 @@ module Hbc puts "#{cask.token}: #{cask.version}" puts Formatter.url(cask.homepage) if cask.homepage installation_info(cask) - puts "From: #{Formatter.url(github_info(cask))}" if github_info(cask) + puts "From: #{Formatter.url(repo_info(cask))}" if repo_info(cask) name_info(cask) artifact_info(cask) Installer.print_caveats(cask) @@ -50,9 +50,11 @@ module Hbc puts cask.name.empty? ? Formatter.error("None") : cask.name end - def self.github_info(cask) + def self.repo_info(cask) user, repo, token = QualifiedToken.parse(Hbc.all_tokens.detect { |t| t.split("/").last == cask.token }) - "#{Tap.fetch(user, repo).default_remote}/blob/master/Casks/#{token}.rb" + remote_tap = Tap.fetch(user, repo) + return "#{remote_tap.remote}" if remote_tap.custom_remote? + "#{remote_tap.default_remote}/blob/master/Casks/#{token}.rb" end def self.artifact_info(cask) diff --git a/Library/Homebrew/cask/lib/hbc/qualified_token.rb b/Library/Homebrew/cask/lib/hbc/qualified_token.rb index adf22b533..7b2e93dcf 100644 --- a/Library/Homebrew/cask/lib/hbc/qualified_token.rb +++ b/Library/Homebrew/cask/lib/hbc/qualified_token.rb @@ -3,7 +3,7 @@ module Hbc REPO_PREFIX = "homebrew-".freeze # per https://github.com/Homebrew/homebrew/blob/4c7bc9ec3bca729c898ee347b6135ba692ee0274/Library/Homebrew/cmd/tap.rb#L121 - USER_REGEX = %r{[a-z_\-]+} + USER_REGEX = %r{[a-z0-9_\-]+} # per https://github.com/Homebrew/homebrew/blob/4c7bc9ec3bca729c898ee347b6135ba692ee0274/Library/Homebrew/cmd/tap.rb#L121 REPO_REGEX = %r{(?:#{REPO_PREFIX})?\w+} |
