From bdc02ad69674991a5dc7517a52ee8afadce5430f Mon Sep 17 00:00:00 2001 From: Max Howell Date: Mon, 25 May 2009 11:56:30 +0100 Subject: [PATCH] Owner made term a full project He requested I remove the gist --- Cellar/homebrew/brewkit.rb | 10 +++++++++- Formula/term.rb | 17 +++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/Cellar/homebrew/brewkit.rb b/Cellar/homebrew/brewkit.rb index 65ac2fb4cf..8965e3bf55 100644 --- a/Cellar/homebrew/brewkit.rb +++ b/Cellar/homebrew/brewkit.rb @@ -104,7 +104,8 @@ class Formula raise end ensure - FileUtils.rm_rf tmp + FileUtils.rm_rf tmp if tmp + FileUtils.rm tgz if tgz and not self.cache? end ohai 'Finishing up' @@ -176,6 +177,10 @@ protected raise "Too many folders in uncompressed result. You need to reimplement the Recipe.uncompress function." if entries.length > 1 return entries.first end + + def cache? + true + end private def method_added(method) @@ -193,6 +198,9 @@ class UncompressedScriptFormula < Formula def uncompress path path.dirname end + def cache? + false + end end class GithubGistFormula < Formula diff --git a/Formula/term.rb b/Formula/term.rb index cc06723f76..fb8149a3cf 100644 --- a/Formula/term.rb +++ b/Formula/term.rb @@ -3,6 +3,19 @@ require 'brewkit' require 'fileutils' homepage='http://gist.github.com/116587' -url='http://gist.github.com/raw/116587/f253c26290fc0b79cd4ce5584b03585b311c28d8/term' -GithubGistFormula.new(url, '184301c748e1df92f07dee7879f17a08') \ No newline at end of file +class TermFormula < UncompressedScriptFormula + def initialize + super('http://github.com/liyanage/macosx-shell-scripts/raw/e29f7eaa1eb13d78056dec85dc517626ab1d93e3/term') + @md5='1bbf4509a50224b27ac8c20d3fe8682e' + @version='2.1' + end +end + +term=TermFormula.new +term.brew do |prefix| + bin=(prefix+'bin') + bin.mkpath + FileUtils.cp term.name, bin + nil +end \ No newline at end of file