Skip to content

Instantly share code, notes, and snippets.

@tanakahisateru
Forked from ritalin/HomebrewAdminTest.rb
Created October 5, 2011 19:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanakahisateru/1265349 to your computer and use it in GitHub Desktop.
Save tanakahisateru/1265349 to your computer and use it in GitHub Desktop.
Homwbrew on the web
require 'rubygems'
require 'sinatra'
require "stringio"
$LOAD_PATH.push "/usr/local/Library/Homebrew"
require "global"
require "cmd/list"
get '/' do
stream = StringIO.new
$stdout = stream
Homebrew.send "list"
return stream.string
end
module Kernel
def exec(program, *args)
arg = args.join(' ')
puts `#{program} #{arg}`
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment