diff options
| author | Markus Reiter | 2017-08-18 16:26:30 +0200 |
|---|---|---|
| committer | GitHub | 2017-08-18 16:26:30 +0200 |
| commit | 3b92f69869f0bc88c2f99854392535d4d522902c (patch) | |
| tree | 1563205d2b103f94207af17f10a870379ee76fa5 /Library/Homebrew/cmd | |
| parent | daa0ea4b8a53b3d2965b84ff673c58310a6937ed (diff) | |
| parent | ca05c7f010ed952b316fe541f94a8fc2a83446ec (diff) | |
| download | brew-3b92f69869f0bc88c2f99854392535d4d522902c.tar.bz2 | |
Merge pull request #3054 from BenMusch/github-refactor
Clean-up code in GitHub module to reduce duplication & coupling w/ Github API
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/search.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb index 53767e75f..0718a3af4 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -109,8 +109,9 @@ module Homebrew $stderr.puts Formatter.headline("Searching taps on GitHub...", color: :blue) valid_dirnames = ["Formula", "HomebrewFormula", "Casks", "."].freeze - matches = GitHub.search_code("user:Homebrew", "user:caskroom", "filename:#{query}", "extension:rb") - [*matches].map do |match| + matches = GitHub.search_code(user: ["Homebrew", "caskroom"], filename: query, extension: "rb") + + matches.map do |match| dirname, filename = File.split(match["path"]) next unless valid_dirnames.include?(dirname) tap = Tap.fetch(match["repository"]["full_name"]) |
