Skip to content
Snippets Groups Projects
Commit f32d0e6a authored by Max Howell's avatar Max Howell
Browse files

UncompressedScriptFormula

parent def522a5
No related branches found
No related tags found
No related merge requests found
......@@ -159,6 +159,18 @@ private
end
end
# you have to reimplement initialize to set the version, for example usage
# see the ack script
class UncompressedScriptFormula < Formula
def initialize(url)
@url=url
@name=File.basename url
end
def uncompress path
path.dirname
end
end
def inreplace(path, before, after)
before=before.to_s.gsub('"', '\"').gsub('/', '\/')
after=after.to_s.gsub('"', '\"').gsub('/', '\/')
......
......@@ -4,22 +4,19 @@ require 'fileutils'
homepage='http://betterthangrep.com/'
class UncompressedFormula < Formula
class AckFormula < UncompressedScriptFormula
def initialize
@name='ack'
super('http://ack.googlecode.com/svn/tags/1.88/ack')
@version='1.88'
@url='http://ack.googlecode.com/svn/tags/1.88/ack'
@md5='8009a13ab0fc66047bea0ea2ad89419c'
end
def uncompress path
path.dirname
end
end
UncompressedFormula.new.brew do |prefix|
ack=AckFormula.new
ack.brew do |prefix|
bin=prefix+'bin'
FileUtils.mkpath bin
FileUtils.cp 'ack', bin
`chmod u+x #{bin}/ack`
bin.mkpath
FileUtils.cp ack.name, bin
(bin+ack.name).chmod 0544
nil
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment