diff options
| author | Ben Muschol | 2017-08-13 13:10:38 -0400 |
|---|---|---|
| committer | Ben Muschol | 2017-08-13 15:03:44 -0400 |
| commit | e93ec12b32f3449f4669cf53469a4d5308b10cc3 (patch) | |
| tree | 72476000915220c84b580c3628a33efe26d524b1 /Library/Homebrew/cmd | |
| parent | d6d681ca01f8acf6b8d5e66cc1ca67310e9b8913 (diff) | |
| download | brew-e93ec12b32f3449f4669cf53469a4d5308b10cc3.tar.bz2 | |
Remove duplicate url generation logic in Github module
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 5b83d80e2..4607f6d1a 100644 --- a/Library/Homebrew/cmd/search.rb +++ b/Library/Homebrew/cmd/search.rb @@ -102,8 +102,9 @@ module Homebrew def search_taps(query) 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") + + Array(matches).map do |match| dirname, filename = File.split(match["path"]) next unless valid_dirnames.include?(dirname) tap = Tap.fetch(match["repository"]["full_name"]) |
