Skip to content
Snippets Groups Projects
Commit 4cf74bc9 authored by at@an-ti.eu's avatar at@an-ti.eu Committed by Adam Vandenberg
Browse files

List all local installed packages in brew server

parent be9d91b2
No related branches found
No related tags found
No related merge requests found
......@@ -50,6 +50,7 @@ def html_page
<div id="header">
<h1><a href="./">Homebrew</a></h1>
<p id="subtitle"><strong>The missing package manager for OS X</strong></p>
<p id="installed"><a href="/installed">Show installed packages</a></p>
</div>
<div id="informations">
......@@ -171,4 +172,37 @@ get '/formula/:name' do
return s
end
def installed_formulas
Formula.all.select{|formula| formula.installed?}
end
get '/installed' do
s = <<-HTML
<html>
<head>
<title>Installed Formulas</title>
#{css_style}
</head>
<body>
<h1>Installed Fomulas</h1>
<ul>
HTML
installed_formulas.each do |formula|
s << "<li>#{link_to_formula(formula.name)}</li>"
end
s += <<-HTML
</ul>
<div>&larr; <a href="/">Back to menu</a></div>
</body>
</html>
HTML
return s
end
puts "View our tasting menu at http://localhost:4567/\nUse \"Control-C\" to exit.\n\n"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment