aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/utils.rb
diff options
context:
space:
mode:
authorAdam Vandenberg2010-01-29 10:15:33 -0800
committerAdam Vandenberg2010-01-30 10:39:56 -0800
commitef69db2e3d593be4ba594eb826f4e8a389c911d6 (patch)
tree7b315014de9c4cc9d34ad5f2bfc2479c7fc0d555 /Library/Homebrew/utils.rb
parentc37845e95252ddcbc0f64db94c3b8a9eed192f61 (diff)
downloadhomebrew-ef69db2e3d593be4ba594eb826f4e8a389c911d6.tar.bz2
Add gzip utility function.
Diffstat (limited to 'Library/Homebrew/utils.rb')
-rw-r--r--Library/Homebrew/utils.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/Library/Homebrew/utils.rb b/Library/Homebrew/utils.rb
index 79f739826..123d67937 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?