aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cask/lib
diff options
context:
space:
mode:
authorMarkus Reiter2016-08-26 08:48:35 +0200
committerMarkus Reiter2016-09-05 21:43:03 +0200
commitc20a7fa8594b397a451edf50661aac737bc65eec (patch)
tree443b6168fdac87f762cb1b76034138e22381a8da /Library/Homebrew/cask/lib
parent89a63fb1778dbfd4140a774c32dededf5b2a4585 (diff)
downloadbrew-c20a7fa8594b397a451edf50661aac737bc65eec.tar.bz2
Remove `homebrew-fonts` hack from search.
Diffstat (limited to 'Library/Homebrew/cask/lib')
-rw-r--r--Library/Homebrew/cask/lib/hbc/cli/search.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/cli/search.rb b/Library/Homebrew/cask/lib/hbc/cli/search.rb
index 2149a524b..5c57ba43d 100644
--- a/Library/Homebrew/cask/lib/hbc/cli/search.rb
+++ b/Library/Homebrew/cask/lib/hbc/cli/search.rb
@@ -16,12 +16,11 @@ class Hbc::CLI::Search < Hbc::CLI::Base
partial_matches = []
search_term = arguments.join(" ")
search_regexp = extract_regexp arguments.first
+ all_tokens = Hbc::CLI.nice_listing(Hbc.all_tokens)
if search_regexp
search_term = arguments.first
- partial_matches = Hbc::CLI.nice_listing(Hbc.all_tokens).grep(%r{#{search_regexp}}i)
+ partial_matches = all_tokens.grep(%r{#{search_regexp}}i)
else
- # suppressing search of the font Tap is a quick hack until behavior can be made configurable
- all_tokens = Hbc::CLI.nice_listing Hbc.all_tokens.reject { |t| %r{^caskroom/fonts/}.match(t) }
simplified_tokens = all_tokens.map { |t| t.sub(%r{^.*\/}, "").gsub(%r{[^a-z0-9]+}i, "") }
simplified_search_term = search_term.sub(%r{\.rb$}i, "").gsub(%r{[^a-z0-9]+}i, "")
exact_match = simplified_tokens.grep(%r{^#{simplified_search_term}$}i) { |t| all_tokens[simplified_tokens.index(t)] }.first