From f9a0f3e80f7b8885e6cc24124b6dd394c60c3a18 Mon Sep 17 00:00:00 2001 From: Adam Vandenberg Date: Fri, 29 Jan 2010 10:15:33 -0800 Subject: [PATCH] Add gzip utility function. --- Library/Homebrew/utils.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb index 79f739826c..123d67937e 100644 --- a/Library/Homebrew/utils.rb +++ b/Library/Homebrew/utils.rb @@ -150,6 +150,12 @@ def exec_editor *args exec *(editor.split+args) end +# GZips the given path, and returns the gzipped file +def gzip path + system "/usr/bin/gzip", path + return Pathname.new(path+".gz") +end + # returns array of architectures suitable for -arch gcc flag def archs_for_command cmd cmd = `/usr/bin/which #{cmd}` unless Pathname.new(cmd).absolute?