diff options
| author | Adam Vandenberg | 2010-06-17 10:51:45 -0700 |
|---|---|---|
| committer | Adam Vandenberg | 2010-06-17 11:42:24 -0700 |
| commit | 4b9a6e0a7fa1d1f46aa053432c0b71db07920be2 (patch) | |
| tree | 60cbd4e4869d785a82e52aeeb41887ea2c7b1a9f /Library | |
| parent | 8bd0f736eab629f000740ea93e9b9fd08df7ed0f (diff) | |
| download | homebrew-4b9a6e0a7fa1d1f46aa053432c0b71db07920be2.tar.bz2 | |
brew server - use search method
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> |
