Tweak brew server - fixes Homebrew/homebrew#2191
This commit is contained in:
parent
492748bc0b
commit
1bf407dd35
@ -4,17 +4,24 @@
|
||||
# Note: this external command is ruby, but set up as a shell script, so that it gets exec'd.
|
||||
# This is required for sinatra's run-loop to take over.
|
||||
|
||||
puts "View our tasting menu at http://localhost:4567/\nUse \"Control-C\" to exit.\n\n"
|
||||
$:.unshift(ENV['HOMEBREW_LIBRARY_PATH'])
|
||||
|
||||
require 'rubygems'
|
||||
require 'sinatra'
|
||||
|
||||
require 'cgi'
|
||||
|
||||
require 'global'
|
||||
require 'formula'
|
||||
|
||||
require 'rubygems'
|
||||
|
||||
begin
|
||||
require 'sinatra'
|
||||
rescue LoadError
|
||||
onoe 'Sinatra required but not found'
|
||||
puts 'To install: gem install sinatra'
|
||||
exit 1
|
||||
end
|
||||
|
||||
require 'cgi'
|
||||
|
||||
|
||||
def link_to_formula name
|
||||
"<a href=\"/formula/#{CGI.escape(name)}\">#{name}</a>"
|
||||
end
|
||||
@ -145,7 +152,7 @@ get '/formula/:name' do
|
||||
end
|
||||
|
||||
used_by = Formula.all.select{|ff| ff.deps.include?(klass.name)}.map{|f| f.name}.flatten.uniq.sort
|
||||
unless used_by == nil
|
||||
unless used_by.empty?
|
||||
s << <<-HTML
|
||||
<dt>Used by</td>
|
||||
HTML
|
||||
@ -164,3 +171,5 @@ get '/formula/:name' do
|
||||
|
||||
return s
|
||||
end
|
||||
|
||||
puts "View our tasting menu at http://localhost:4567/\nUse \"Control-C\" to exit.\n\n"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user