Add gzip utility function.

This commit is contained in:
Adam Vandenberg 2010-01-29 10:15:33 -08:00
parent e4b60cd3cd
commit f9a0f3e80f

View File

@ -150,6 +150,12 @@ def exec_editor *args
exec *(editor.split+args) exec *(editor.split+args)
end 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 # returns array of architectures suitable for -arch gcc flag
def archs_for_command cmd def archs_for_command cmd
cmd = `/usr/bin/which #{cmd}` unless Pathname.new(cmd).absolute? cmd = `/usr/bin/which #{cmd}` unless Pathname.new(cmd).absolute?