diff options
Diffstat (limited to 'Library')
| -rwxr-xr-x | Library/Contributions/examples/brew-server | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/Library/Contributions/examples/brew-server b/Library/Contributions/examples/brew-server index 1d461db61..c0d2910b1 100755 --- a/Library/Contributions/examples/brew-server +++ b/Library/Contributions/examples/brew-server @@ -75,16 +75,10 @@ get '/' do end get '/search' do + require 'brew.h' q = params['q'] + results = search_brews(q) - formulae = Formulary.names with_aliases=true - - if q =~ /^\/(.*)\/$/ - results = formulae.grep(Regexp.new($1)) - else - search_term = Regexp.escape(q || "") - results = formulae.grep(/.*#{search_term}.*/) - end s = <<-HTML <html> <head> |
