From 0ab4b3bf126546c3da8578e4e87fd02aee421148 Mon Sep 17 00:00:00 2001 From: Max Howell Date: Fri, 5 Jun 2009 23:38:58 +0100 Subject: [PATCH] brew mk command --- bin/brew | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/bin/brew b/bin/brew index c6efe0ed78..23c38a5996 100755 --- a/bin/brew +++ b/bin/brew @@ -73,9 +73,7 @@ end def __obj name require "#{__rb name}" - o=eval(__class(name)).new - o.name=name - return o + return eval(__class(name)).new(name) end def rm keg @@ -142,7 +140,7 @@ def lnd keg, start if from.directory? # no need to put .app bundles in the path, the user can just use # spotlight, or the open command and actual mac apps use an equivalent - Find.prune if path.extname.to_s == '.app' + Find.prune if from.extname.to_s == '.app' cmd=yield from.relative_path_from(start) @@ -174,6 +172,7 @@ Commands: ln formula ... info formula abv [formula] + mk url prune EOS end @@ -224,7 +223,8 @@ begin if o.caveats ohai "Caveats" puts o.caveats - end + ohai "Summary" + end puts "#{o.prefix}: "+abv(name)+", built in #{Time.now - beginning} seconds" end when 'ln' @@ -233,6 +233,30 @@ begin puts "Created #{n} links" when 'rm' shift_formulae_from_ARGV.each {|name| rm name} + when 'mk' + require 'brewkit' + class Template